Monday 5 March 2018

تعلم الآلة التنبؤ الفوركس


جون V.


البيانات الكبيرة. الشركات الناشئة. تجارة.


البيانات الكبيرة. الشركات الناشئة. تجارة.


آلة يدق الإنسان: استخدام آلة التعلم في الفوركس.


تعلم الآلة والتداول هو موضوع مثير جدا للاهتمام. بل هو أيضا موضوع حيث يمكنك قضاء طن من الوقت كتابة التعليمات البرمجية وأوراق القراءة وبعد ذلك طفل يمكن أن يضربك في حين لعب ماريو كارت.


في المشاركات التالية، سنتحدث عن:


تحسين الإدخالات والمخارج. وهذا فقط وهذا يمكن أن تجعل طن من الفرق في لفة البنك الخاص بك. حساب حجم الموقف (في حال كنت لا تحب معيار كيلي) البحث عن علاقة محتملة بين أزواج مختلفة (تداول الزوج). أنا أحب اليورو مقابل الدولار مقابل مقابل غبجبي الارتباط! حساب الدعم & أمب؛ خطوط المقاومة.


ولكن ما هو التعلم الآلي؟


خوارزميات التعلم الآلي هي خوارزميات حيث يمكن للآلة تحديد الأنماط في البيانات الخاصة بك. ياب، هو بهذه البساطة. على سبيل المثال، تجد جميع الحيوانات في هذه الصورة ورسم مربع من حولهم. أيضا، اسم هذا الحيوان. مجنون أعرف. للتداول كما يمكنك أن تتخيل أنها مشابهة جدا:


من أجل آلة ل "تعلم"، تحتاج إلى تعليمه ما هو حق أو خطأ (التعلم تحت الإشراف) أو إعطائها مجموعة كبيرة من البيانات والسماح لها حصلت البرية (غير خاضعة للرقابة). لتحديد الأجسام هذا هو مباشرة إلى الأمام ولكن ماذا عن التداول؟


نظرت حولي لمعرفة ما إذا كان هناك أي برنامج تعلم الآلة التي يمكن تحديد خطوط S / R ولكن دون جدوى. لذلك قررت أن أكتب أول برنامج تعلم الآلة في الثعبان الذي يحدد خطوط الدعم والمقاومة في بيثون. آخر أول! الصيحة!


ولكن كيف يمكن للخوارزمية تحديد هذه المجالات؟ Hoooooow؟ السيدات والرجال (والروبوتات)، واسمحوا لي أن أعرض لكم ل مينشيفت، خوارزمية غير خاضعة للرقابة التي تستخدم في الغالب للتعرف على الصور وغير تافهة جدا لإعداد وتشغيل (ولكن أيضا بطيئة جدا).


والفكرة هي أن هذه الخوارزمية سوف تسمح لي تقسيم البيانات الخاصة بي (القراد النقد الاجنبى) في المناطق وبعد ذلك يمكنني استخدام "حواف" كخطوط الدعم والمقاومة. فكرة باردة ولكن هل يعمل؟


نحن نحلل حوالي 12 مليون داتابوانتس من اليورو مقابل الدولار الأميركي في عام 2017 وشهرين من عام 2018. يتم وضع خطوط المقاومة تلقائيا من خلال خوارزمية التعلم الآلي.


ما هو رائع حقا (ومشبك) هو أن الخوارزمية إلى حد كبير المسامير ذلك. الأظافر من الصعب. فإنه يحصل عصبي حقا عندما نحن ذاهبون لاستخدام خوارزمية لتحديد الهياكل الصغيرة وبدء سلخ فروة الرأس.


النظام قادر على معالجة أي نوع من بيانات المرات (الأسهم، الفوركس، الذهب، أيا كان)، وسوف تجعل الرسم البياني التفاعلية هتمل (مثل الرسم البياني أعلاه) مع البيانات الخاصة بك والآلة ولدت S / L. رمز هنا حتى يذهب مجنون.


الآن دعونا خطوة من خلال التعليمات البرمجية. بعد أن يكون لديك مجموعة من البيانات تحتاج إلى قراءتها وتنظيفها. الاستعداد لبعض السحر الباندا.


نحن إسقاط القيم الفارغة (عطلة نهاية الأسبوع) وبعد ذلك نحن إعادة رسم البيانات إلى 24 ساعة الشمعدانات (أوهكل). وهذا يجعل من الأسهل بكثير مؤامرة. و grouped_data هي البيانات التي سوف تتغذى في خوارزمية مل.


ثم نقوم بإعداد البيانات التي نحن ذاهبون لاستخدامها في الغو.


في المنصب التالي، سنناقش كيفية جعل هذا العمل أفضل، ونناقش بعض النتائج المثيرة جدا للاهتمام (هل يمكن للخوارزمية التنبؤ فعلا بالمستقبل؟) والبدء في استخدامه في التداول الخاص بنا. إذا كنت ترغب في التحقق من المقال التالي وقراءة المزيد عن التداول والاستثمار باستخدام الخوارزميات، الاشتراك في النشرة الإخبارية.


القادمة القادمة: تعلم آلة ذهب البرية - استخدام التعليمات البرمجية!


إذا كان لديك المزيد من ردود الفعل، بينغ لي في جونروميرو أو الاشتراك في النشرة الإخبارية.


قانوني خارجي. هذا هو برنامج تعليمي هندسي حول كيفية بناء منصة ألغوترادينغ للتجريب و فان. أي اقتراحات هنا ليست النصائح المالية. إذا كنت تفقد أي (أو كل) لك المال لأنك اتبعت أي نصائح التداول أو نشر هذا النظام في الإنتاج، لا يمكنك إلقاء اللوم على هذه بلوق عشوائي (و / أو لي). استمتع على مسؤوليتك الخاصة.


بناء استراتيجيات أفضل! الجزء الرابع: تعلم الآلة.


وكان الأزرق العميق أول كمبيوتر فاز في بطولة العالم الشطرنج. كان ذلك عام 1996، واستغرق الأمر 20 عاما حتى برنامج آخر، ألفاغو، يمكن أن هزيمة أفضل لاعب غو الإنسان. كان الأزرق العميق نظاما يستند إلى نموذج مع قواعد الشطرنج هاردويريد. ألفاغو هو نظام استخراج البيانات، شبكة العصبية العميقة المدربة مع الآلاف من الألعاب الذهاب. لم تتحسن الأجهزة، ولكن انفراجة في البرنامج كان ضروريا لخطوة من الضرب كبار لاعبي الشطرنج لضرب كبار اللاعبين الذهاب.


في هذا الجزء 4 من سلسلة مصغرة نحن & # 8217؛ سوف ننظر في نهج استخراج البيانات لتطوير استراتيجيات التداول. هذا الأسلوب لا يهتم بآليات السوق. انها مجرد مسح منحنيات السعر أو مصادر البيانات الأخرى للنماذج التنبؤية. تعلم الآلة أو & # 8220؛ الذكاء الاصطناعي & # 8221؛ لا تشارك دائما في استراتيجيات استخراج البيانات. في الواقع الأكثر شعبية & # 8211؛ والمربحة بشكل مثير للدهشة & # 8211؛ طريقة استخراج البيانات يعمل دون أي الشبكات العصبية الهوى أو آلات ناقلات الدعم.


مبادئ التعلم الآلي.


يتم تغذية خوارزمية التعلم مع عينات البيانات، وعادة ما تستمد بطريقة ما من الأسعار التاريخية. وتتألف كل عينة من متغيرات n × 1 .. x n، التي يطلق عليها عادة تنبؤات، وميزات، وإشارات، أو ببساطة إدخال. يمكن لهذه التنبؤات أن تكون عائدات السعر من آخر أشرطة n، أو مجموعة من المؤشرات الكلاسيكية، أو أي وظائف أخرى يمكن تخيلها من منحنى السعر (I & # 8217؛ حتى رأيت بكسل من صورة الرسم البياني للسعر المستخدمة كمنبؤات لعصبية شبكة الاتصال!). كل عينة تشمل عادة متغير الهدف y، مثل عودة التجارة المقبلة بعد أخذ العينة، أو حركة السعر المقبل. في الأدب يمكنك أن تجد ذ اسمه أيضا تسمية أو موضوعية. في عملية التدريب، والخوارزمية يتعلم التنبؤ الهدف ذ من تنبؤات x 1 .. س ن. الذاكرة & # 8216؛ الذاكرة & # 8217؛ يتم تخزينها في بنية بيانات اسمها النموذج الذي هو محدد للخوارزمية (لا ينبغي الخلط بينه وبين نموذج مالي للاستراتيجيات القائمة على نموذج!). يمكن أن يكون نموذج التعلم الآلي وظيفة مع قواعد التنبؤ في رمز C، التي تم إنشاؤها بواسطة عملية التدريب. أو يمكن أن يكون مجموعة من أوزان الاتصال للشبكة العصبية.


يجب على التنبؤات، والميزات، أو ما تسمونه، يجب أن تحمل معلومات كافية للتنبؤ الهدف ذ مع بعض الدقة. كما أنها غالبا ما تفي بمتطلبين رسميين. أولا، يجب أن تكون جميع قيم التنبؤ في نفس النطاق، مثل -1 .. +1 (لمعظم خوارزميات R) أو -100 .. +100 (لخوارزميات زورو أو تسب). لذلك تحتاج إلى تطبيع لهم في بعض الطريق قبل إرسالها إلى الجهاز. ثانيا، يجب أن تكون العينات متوازنة، أي موزعة بالتساوي على جميع قيم المتغير المستهدف. لذلك يجب أن يكون هناك حول العديد من الفوز كما تفقد العينات. إذا لم تلاحظ هذين الشرطين، فإنك تتساءل عن سبب حصولك على نتائج سيئة من خوارزمية تعلم الآلة.


تتوقع خوارزميات الانحدار قيمة رقمية، مثل حجم وعلامة حركة السعر التالية. تتنبأ خوارزميات التصنيف بفئة عينة نوعية، على سبيل المثال، ما إذا كانت النتيجة تسبق الفوز أو الخسارة. بعض الخوارزميات، مثل الشبكات العصبية، أشجار القرار، أو دعم ناقلات الآلات، يمكن تشغيلها في كلا الوضعين.


وهناك عدد قليل من الخوارزميات تعلم تقسيم العينات إلى فئات دون الحاجة إلى أي هدف ذ. هذا التعلم غير الخاضع للرقابة، بدلا من التعلم تحت الإشراف باستخدام الهدف. في مكان ما في المنتصف هو التعلم التعزيز، حيث يقوم النظام بتدريب نفسه عن طريق تشغيل المحاكاة مع ميزات معينة، واستخدام النتيجة كهدف التدريب. ألفازيرو، خليفة ألفاغو، استخدم التعلم التعزيز من خلال اللعب الملايين من ألعاب الذهاب ضد نفسها. في مجال التمويل هناك عدد قليل من التطبيقات للتعلم غير الخاضعة للرقابة أو التعزيز. 99٪ من استراتيجيات التعلم الآلي تستخدم التعلم تحت الإشراف.


أيا كانت الإشارات التي نستخدمها للتنبؤات في التمويل، فإنها على الأرجح تحتوي على الكثير من الضجيج وقليل من المعلومات، وسوف تكون غير مستقرة على رأسها. لذلك التنبؤ المالي هو واحد من أصعب المهام في التعلم الآلي. الخوارزميات الأكثر تعقيدا لا تحقق بالضرورة نتائج أفضل. اختيار التنبؤات أمر بالغ الأهمية للنجاح. ليست فكرة جيدة لاستخدام الكثير من التنبؤات، لأن هذا يسبب ببساطة الإفراط في الفشل والفشل في الخروج من عملية العينة. لذلك استراتيجيات استخراج البيانات غالبا ما تطبق خوارزمية الاختيار الأولي الذي يحدد عدد قليل من التنبؤات من مجموعة من العديد. ويمكن أن يستند الاختيار المسبق إلى العلاقة بين المتنبئات، وعلى الأهمية، وعلى محتوى المعلومات، أو ببساطة على نجاح التنبؤ مع مجموعة اختبار. التجارب العملية مع اختيار ميزة يمكن العثور عليها في مقالة حديثة عن بلوق روبوت الثروة.


هنا & # 8217؛ s قائمة من الأكثر شعبية استخراج البيانات الطرق المستخدمة في التمويل.


1. حساء المؤشر.


معظم النظم التجارية نحن & # 8217؛ إعادة البرمجة للعملاء لا تستند إلى نموذج مالي. العميل يريد فقط إشارات التجارة من بعض المؤشرات الفنية، تصفيتها مع المؤشرات الفنية الأخرى في تركيبة مع المزيد من المؤشرات الفنية. وعندما سئل عن كيف يمكن لهذا الخليط من المؤشرات أن يكون استراتيجية مربحة، أجاب عادة: & # 8220؛ ثق بي. I & # 8217؛ م التداول يدويا، وأنه يعمل. & # 8221؛


لقد فعلت ذلك بالفعل. على الأقل في بعض الأحيان. على الرغم من أن معظم تلك النظم لم يمر اختبار وفا (وبعض حتى لا باكتست بسيط)، وعدد كبير من المستغرب فعلت. وكانت تلك أيضا في كثير من الأحيان مربحة في التداول الحقيقي. وقد أجرى العميل تجربة منهجية للمؤشرات الفنية حتى وجد مزيجا يعمل في التداول المباشر مع أصول معينة. هذه الطريقة من التحليل الفني التجريبي والخطأ هو نهج استخراج البيانات الكلاسيكية، مجرد إعدام من قبل الإنسان وليس من قبل آلة. لا أستطيع حقا أن أوصي هذا الأسلوب & # 8211؛ والكثير من الحظ، لا الكلام عن المال، وربما تشارك & # 8211؛ ولكن يمكنني أن أشهد أنه يؤدي أحيانا إلى أنظمة مربحة.


2. أنماط شمعة.


لا ينبغي الخلط مع تلك أنماط الشموع اليابانية التي كان لها أفضل قبل تاريخ طويل، منذ فترة طويلة. المعادل الحديث هو تداول حركة السعر. أنت & # 8217؛ لا تزال تبحث في مفتوحة، عالية، منخفضة، وإغلاق الشموع. أنت & # 8217؛ لا تزال تأمل في العثور على نمط يتنبأ بإتجاه السعر. ولكن أنت & # 8217؛ الآن استخراج البيانات المعاصرة السعر المنحنيات لجمع تلك الأنماط. وهناك حزم برامج لهذا الغرض. يبحثون عن أنماط مربحة من قبل بعض المعايير المعرفة من قبل المستخدم، واستخدامها لبناء وظيفة كشف نمط معين. يمكن أن يبدو مثل هذا واحد (من زورو & # 8217؛ ق نمط محلل):


ترجع الدالة C 1 عندما تطابق الإشارات أحد الأنماط، وإلا 0. يمكنك أن ترى من الشفرة الطويلة أن هذه ليست أسرع طريقة للكشف عن الأنماط. طريقة أفضل، التي يستخدمها زورو عندما لا يتم تصدير وظيفة الكشف، هو فرز الإشارات من حيث حجمها والتحقق من ترتيب الفرز. ومثال على هذا النظام يمكن العثور عليها هنا.


يمكن سعر التداول العمل حقا العمل؟ تماما مثل حساء المؤشر، فإنه لا يستند إلى أي نموذج مالي عقلاني. يمكن للمرء أن يتصور في أفضل الأحوال أن تسلسل تحركات الأسعار يسبب المشاركين في السوق للرد بطريقة معينة، وبهذه الطريقة إنشاء نمط تنبؤي مؤقت. ومع ذلك فإن عدد من أنماط محدودة جدا عند النظر فقط في تسلسل عدد قليل من الشموع المتجاورة. الخطوة التالية هي مقارنة الشموع التي ليست متاخمة، ولكن يتم اختيارها بشكل تعسفي خلال فترة زمنية أطول. وبهذه الطريقة يمكنك الحصول على عدد غير محدود تقريبا من الأنماط & # 8211؛ ولكن على حساب ترك أخيرا مجال العقلاني. من الصعب أن نتخيل كيف يمكن توقع حركة السعر من قبل بعض أنماط الشموع منذ أسابيع.


ومع ذلك، هناك الكثير من الجهد في ذلك. يدير زميل المدون، دانيال فرنانديز، موقع الاشتراك على الانترنت (أسيريكوي) المتخصصة في استخراج البيانات أنماط شمعة. انه صقل نمط التداول وصولا الى أصغر التفاصيل، وإذا كان أي شخص من أي وقت مضى تحقيق أي ربح بهذه الطريقة، سيكون له. ولكن لمشتركيه & # 8217؛ خيبة أمل، تداول أنماطه الحية (كوريكوانت) أنتج نتائج مختلفة جدا من له باكتيستس رائعة. إذا كانت أنظمة العمل السعر مربحة موجودة حقا، على ما يبدو لا أحد قد وجدت لهم حتى الآن.


3. الانحدار الخطي.


أساس بسيط من العديد من خوارزميات التعلم الآلي المعقدة: التنبؤ المتغير الهدف ذ من قبل مزيج خطي من التنبؤات × 1 .. س ن.


والمعاملات a هي النموذج. يتم حسابها لتقليل مجموع الاختلافات المربعة بين القيم الحقيقية y من عينات التدريب وتوقعها y من الصيغة أعلاه:


للعينات الموزعة العادية، والتقليل من الممكن مع بعض الحساب المصفوفة، لذلك لا حاجة التكرارات. في الحالة n = 1 & # 8211؛ مع متغير واحد فقط متغير x & # 8211؛ يتم تقليل صيغة الانحدار إلى.


وهو الانحدار الخطي البسيط، بدلا من الانحدار الخطي متعدد المتغيرات حيث n & غ؛ 1 - الانحدار الخطي البسيط متوفر في معظم منصات التداول، f. i. مع مؤشر لينريغ في تا-ليب. مع y = برايس و x = تايم & # 8217؛ s غالبا ما تستخدم كبديل للمتوسط ​​المتحرك. الانحدار الخطي متعدد المتغيرات متاح في منصة R من خلال الدالة (..) التي تأتي مع التثبيت القياسي. البديل هو الانحدار متعدد الحدود. مثل الانحدار البسيط فإنه يستخدم متغير واحد فقط متغير x، ولكن أيضا مربعه ودرجاته العليا، بحيث x n == x n:


مع n = 2 أو n = 3، غالبا ما يستخدم الانحدار متعدد الحدود للتنبؤ بالسعر المتوسط ​​التالي من الأسعار المسطحة للأشرطة الأخيرة. وظيفة بوليفيت من ماتلاب، R، زورو، والعديد من المنصات الأخرى يمكن أن تستخدم لانحدار متعدد الحدود.


4. بيرسيبترون.


غالبا ما يشار إليها باسم الشبكة العصبية مع واحد فقط من الخلايا العصبية. في الواقع بيرسيبترون هو وظيفة الانحدار مثل أعلاه، ولكن مع نتيجة ثنائية، مما يسمى الانحدار اللوجستي. انها & # 8217؛ s لا الانحدار الرغم من ذلك، انها & # 8217؛ s خوارزمية التصنيف. تولد الدالة زورو & # 8217 s (بيرسيبترون، & # 8230؛) شفرة C ترجع إما 100 أو -100، وتعتمد على ما إذا كانت النتيجة المتوقعة أعلى من عتبة أم لا:


يمكنك أن ترى أن صفيف سيغ يعادل الميزات x n في صيغة الانحدار، والعوامل الرقمية هي المعاملات n.


5. الشبكات الإلكترونية N.


الانحدار الخطي أو اللوجستي يمكن أن تحل المشاكل الخطية فقط. العديد من لا تقع في هذه الفئة & # 8211؛ مثال مشهور هو التنبؤ الناتج من وظيفة شور بسيطة. وعلى الأرجح أيضا التنبؤ الأسعار أو عائدات التجارة. يمكن للشبكة العصبية الاصطناعية (أن) معالجة المشاكل غير الخطية. انها مجموعة من بيرسيبترونس التي ترتبط معا في مجموعة من الطبقات. أي بيرسيبترون هو الخلايا العصبية من الشبكة. خرجها يذهب إلى مدخلات جميع الخلايا العصبية من الطبقة التالية، مثل هذا:


وكما هو الحال في المنظور، تتعلم الشبكة العصبية أيضا من خلال تحديد المعاملات التي تقلل من الخطأ بين التنبؤ بالعينة وهدف العينة. ولكن هذا يتطلب الآن عملية تقريب، وعادة مع باكبروباغاتينغ الخطأ من الإخراج إلى المدخلات، وتحسين الأوزان في طريقها. وتفرض هذه العملية قيادتين. أولا، يجب أن تكون مخرجات الخلايا العصبية الآن وظائف مختلفة بشكل مستمر بدلا من عتبة الإدراك الحسي البسيط. ثانيا، يجب ألا تكون الشبكة عميقة جدا & # 8211؛ يجب ألا يحتوي على عدد كبير جدا من & # 8216؛ الطبقات المخفية & # 8217؛ من الخلايا العصبية بين المدخلات والمخرجات. هذا التقييد الثاني يحد من تعقيد المشاكل التي يمكن أن تحلها الشبكة العصبية القياسية.


عند استخدام الشبكة العصبية للتنبؤ بالصفقات، لديك الكثير من المعلمات التي يمكنك اللعب حولها، وإذا كنت & # 8217؛ لا حذرا، تنتج الكثير من التحيز الاختيار:


عدد الطبقات المخفية عدد الخلايا العصبية في طبقة مخفية عدد دورات باكبروباغاتيون، وعناوين اسمه معدل التعلم، وعرض خطوة من عصر الزخم، عامل الجمود للأوزان التكيف وظيفة التنشيط.


وظيفة التنشيط يحاكي عتبة بيرسيبترون. ل باكبروباغاتيون تحتاج إلى وظيفة التفريق بشكل مستمر أن يولد & # 8216؛ لينة & # 8217؛ خطوة على قيمة x معينة. عادة يتم استخدام وظيفة السيني، تانه، أو سوفتماكس. في بعض الأحيان انها أيضا وظيفة خطية التي ترجع فقط المبلغ المرجح لجميع المدخلات. في هذه الحالة يمكن استخدام الشبكة للانحدار، للتنبؤ بقيمة رقمية بدلا من نتيجة ثنائية.


الشبكات العصبية متوفرة في تركيب R القياسية (نيت، شبكة طبقة مخفية واحدة) وفي العديد من الحزم، على سبيل المثال رسنس و FCNN4R.


6. التعلم العميق.


تستخدم طرق التعلم العميق الشبكات العصبية مع العديد من الطبقات الخفية والآلاف من الخلايا العصبية، والتي لا يمكن تدريبها بشكل فعال بعد الآن من قبل باكبروباغاتيون التقليدية. أصبحت عدة طرق شعبية في السنوات الأخيرة لتدريب مثل هذه الشبكات الضخمة. وهم عادة ما قبل تدريب طبقات الخلايا العصبية الخفية لتحقيق عملية التعلم أكثر فعالية. A بولتزمان مقيدة آلة (ربم) هو خوارزمية تصنيف غير خاضعة للرقابة مع بنية شبكة خاصة لا يوجد لديه اتصالات بين الخلايا العصبية الخفية. يستخدم جهاز الاشتعال المتفرق (ساي) بنية الشبكة التقليدية، ولكن قبل القطارات الطبقات المخفية بطريقة ذكية من خلال إعادة إنتاج إشارات الإدخال على مخرجات الطبقة مع عدد قليل من الاتصالات النشطة ممكن. وتتيح هذه الأساليب لشبكات معقدة جدا لمعالجة مهام التعلم المعقدة للغاية. مثل الضرب العالم & # 8217؛ لاعب أفضل الإنسان الذهاب.


شبكات التعلم العميق متوفرة في حزم ديبنيت و دارتش R. يوفر ديبنيت أوتوينكودر، دارتش آلة بولتزمان مقيدة. أنا لم تجرب حتى الآن مع دارتش، ولكن هنا & # 8217؛ s مثال النصي R باستخدام ديبنيت أوتوينكودر مع 3 طبقات مخفية لإشارات التجارة من خلال زورو & # 8217؛ s العصبية () وظيفة:


7. دعم ناقلات الآلات.


مثل شبكة العصبية، آلة ناقلات الدعم (سفم) هو امتداد آخر للانحدار الخطي. عندما ننظر إلى صيغة الانحدار مرة أخرى،


يمكننا تفسير ملامح x ن كإحداثيات مساحة ميزة n - dimensional. تحديد المتغير الهدف y إلى قيمة ثابتة يحدد مستوي في تلك المساحة، يسمى هبربلان لأنه يحتوي على أكثر من اثنين (في الواقع، ن -1) أبعاد. تفصل اللوحة المفرطة العينات مع y & غ؛ o من العينات مع y & لوت؛ 0. ويمكن حساب المعاملات n بطريقة تجعل مسافات الطائرة أقرب العينات & # 8211؛ والتي تسمى & # 8216؛ ناقلات الدعم & # 8217؛ من الطائرة، وبالتالي اسم الخوارزمية & # 8211؛ هو الحد الأقصى. بهذه الطريقة لدينا المصنف ثنائي مع الفصل الأمثل من العينات الفائزة والخاسرة.


المشكلة: عادة لا تكون هذه العينات قابلة للفصل خطيا & # 8211؛ فهي متناثرة حول بشكل غير منتظم في الفضاء ميزة. لا يمكن أن تقلص طائرة مسطحة بين الفائزين والخاسرين. إذا كان يمكن، كان لدينا أساليب أبسط لحساب تلك الطائرة، f. i. التحليل التمييزي الخطي. ولكن بالنسبة للحالة المشتركة نحن بحاجة إلى خدعة سفم: إضافة المزيد من الأبعاد لمساحة الميزة. لهذا الخوارزمية سفم تنتج المزيد من الميزات مع وظيفة النواة التي تجمع بين أي اثنين من التنبؤات الحالية إلى ميزة جديدة. وهذا يشبه الخطوة أعلاه من الانحدار البسيط إلى الانحدار متعدد الحدود، حيث تضيف أيضا المزيد من الميزات عن طريق أخذ المتنبأ الوحيد بالسلطة n. والمزيد من الأبعاد التي تضيفها، وأسهل هو لفصل العينات مع لوحة مسطحة مسطحة. ثم يتم تحويل هذه الطائرة مرة أخرى إلى الفضاء N - الأبعاد الأصلي، والحصول على التجاعيد وتكتل على الطريق. بواسطة ذكي اختيار وظيفة النواة، ويمكن تنفيذ العملية دون حساب الواقع التحول.


مثل الشبكات العصبية، سفمز يمكن استخدامها ليس فقط للتصنيف، ولكن أيضا للانحدار. كما أنها توفر بعض المعلمات لتحسين عملية التنبؤ وربما تحسينها:


وظيفة النواة. كنت عادة استخدام نواة ربف (وظيفة أساس شعاعي، نواة متماثلة)، ولكن لديك أيضا اختيار حبات أخرى، مثل السيني، متعدد الحدود، والخطي. غاما، وعرض نواة ربف معلمة التكلفة C، و & # 8216؛ ركلة جزاء & # 8217؛ للتصنيفات الخاطئة في عينات التدريب.


سفم المستخدمة في كثير من الأحيان هي مكتبة ليبسفم. كما أنها متوفرة في R في حزمة e1071. في الجزء التالي والأخير من هذه السلسلة أخطط لوصف استراتيجية التداول باستخدام هذا سفم.


8. K - أقرب الجيران.


مقارنة مع أن آن الثقيلة و سفم الاشياء، أن & # 8217؛ ق خوارزمية بسيطة لطيفة مع خاصية فريدة من نوعها: فإنه لا يحتاج إلى التدريب. وبالتالي فإن العينات هي النموذج. هل يمكن استخدام هذه الخوارزمية لنظام التداول الذي يتعلم بشكل دائم عن طريق إضافة المزيد والمزيد من العينات ببساطة. وتحسب خوارزمية الجوار الأقرب المسافات في حيز الميزة من قيم الخصائص الحالية إلى العينات الأقرب k. وتحسب المسافة في الفضاء n الأبعاد من مجموعتين من السمات (x 1 .. x n) و (y 1 .. y n) كما هو الحال في بعدين:


وتتوقع الخوارزمية ببساطة الهدف من متوسط ​​المتغيرات المستهدفة k لأقرب العينات، المرجحة بمسافاتها العكسية. ويمكن استخدامه للتصنيف وكذلك الانحدار. يمكن للحيل البرمجيات اقترضت من الرسومات الكمبيوتر، مثل شجرة ثنائية التكيف (عبت)، جعل أقرب جار البحث بسرعة كبيرة. في حياتي الماضية كمبرمج لعبة كمبيوتر، استخدمنا هذه الأساليب في ألعاب لمهام مثل التعلم الذاتي الذكاء العدو. يمكنك استدعاء وظيفة كن في R للتنبؤ أقرب الجار & # 8211؛ أو كتابة وظيفة بسيطة في C لهذا الغرض.


هذه خوارزمية تقريبية للتصنيف غير الخاضع للرقابة. لديها بعض التشابه، وليس فقط اسمها، إلى k - أقرب الجار. لتصنيف العينات، تضع الخوارزمية أولا نقاط عشوائية k في مساحة العنصر. ثم يعين إلى أي من تلك النقاط جميع العينات مع أصغر مسافات إليها. ثم يتم نقل النقطة إلى متوسط ​​هذه العينات الأقرب. وهذا سيولد تخصيص عينات جديدة، لأن بعض العينات هي الآن أقرب إلى نقطة أخرى. وتكرر العملية إلى أن لا يتغير التخصيص بعد الآن بتحريك النقاط، أي أن كل نقطة تكمن بالضبط في متوسط ​​عيناتها الأقرب. لدينا الآن K فئات من العينات، كل في حي واحد من النقاط k.


هذه الخوارزمية بسيطة يمكن أن تنتج نتائج جيدة بشكل مدهش. في R، وظيفة كمينز لا خدعة. مثال على خوارزمية k-مينز لتصنيف أنماط الشموع يمكن العثور عليها هنا: تصنيف الشموع غير الخاضعة للمراقبة من أجل المتعة والربح.


10. نايف بايس.


تستخدم هذه الخوارزمية بايز & # 8217؛ نظرية لتصنيف عينات من الميزات غير الرقمية (أي الأحداث)، مثل أنماط شمعة المذكورة أعلاه. لنفرض أن الحدث X (على سبيل المثال، أن فتح الشريط السابق أقل من فتح الشريط الحالي) يظهر في 80٪ من جميع العينات الفائزة. ما هو احتمالية فوز العينة عندما تحتوي على الحدث X؟ إنه ليس 0.8 كما قد تعتقد. يمكن حساب الاحتمال مع بايز & # 8217؛ نظرية:


P (Y | X) هو احتمال حدوث الحدث Y (f. i الفوز) في جميع العينات التي تحتوي على الحدث X (في مثالنا، أوبين (1) & لوت؛ أوبين (0)). وفقا للصيغة، فإنه يساوي احتمال X يحدث في جميع العينات الفائزة (هنا، 0.8)، مضروبا في احتمال Y في جميع العينات (حوالي 0.5 عندما كنت اتبع نصيحتي أعلاه من عينات متوازنة) وقسمت على احتمال X في جميع العينات.


إذا كنا ساذجة ونفترض أن جميع الأحداث X مستقلة عن بعضها البعض، يمكننا حساب الاحتمال العام أن العينة هو الفوز ببساطة عن طريق ضرب الاحتمالات P (X | الفوز) لكل حدث X. وبهذه الطريقة ننتهي بهذه الصيغة:


مع عامل التحجيم s. لصيغة للعمل، يجب اختيار الميزات بطريقة أنها مستقلة قدر الإمكان، مما يفرض عقبة لاستخدام نايف بايس في التداول. على سبيل المثال، الحدثين إغلاق (1) & لوت؛ كلوز (0) أند أوبين (1) & لوت؛ فتح (0) هي على الأرجح ليست مستقلة عن بعضها البعض. يمكن تحويل التنبؤات العددية إلى الأحداث عن طريق قسمة الرقم إلى نطاقات منفصلة.


خوارزمية نايف بايس هو متاح في حزمة E1071 R في كل مكان.


11 - أشجار القرار والانحدار.


وتتوقع تلك الأشجار نتيجة أو قيمة رقمية استنادا إلى سلسلة من القرارات نعم / لا، في هيكل مثل فروع شجرة. أي قرار هو إما وجود حدث أم لا (في حالة السمات غير العددية) أو مقارنة قيمة ميزة بعتبة ثابتة. تبدو وظيفة شجرة نموذجية، تم إنشاؤها بواسطة أداة إنشاء شجرة زورو & # 8217، كما يلي:


كيف تنتج مثل هذه الشجرة من مجموعة من العينات؟ هناك عدة طرق. يستخدم زورو شانون أنا إنفورماتيون إنتروبي، الذي كان بالفعل ظهور على هذه المدونة في المادة سلخ فروة الرأس. في البداية فإنه يتحقق من واحدة من الميزات، والسماح & # 8217؛ ق يقول × 1. فإنه يضع مفرط مع صيغة الطائرة × 1 = t في مساحة الميزة. تفصل هذه المجموعة الزائدة العينات مع x 1 & غ؛ t من العينات مع x 1 & لوت؛ t. يتم تحديد عتبة تقسيم t بحيث كسب المعلومات & # 8211؛ والفرق من المعلومات الكون من الفضاء كله، لمجموع الكون المعلومات من قسمين المساحات الفرعية & # 8211؛ هو الحد الأقصى. وهذا هو الحال عندما تكون العينات في السطوح الفرعية أكثر تشابها مع بعضها البعض من العينات الموجودة في الحيز كله.


ثم يتم تكرار هذه العملية مع الميزة التالية × 2 واثنين من هيبيربلانس تقسيم اثنين من سوبسباسس. ويعادل كل مقطع مقارنة لمميزة ذات عتبة. عن طريق التقسيم المتكرر، ونحن قريبا الحصول على شجرة ضخمة مع الآلاف من مقارنات العتبة. ثم يتم تشغيل العملية إلى الوراء عن طريق تقليم الشجرة وإزالة جميع القرارات التي لا تؤدي إلى مكاسب كبيرة من المعلومات. وأخيرا نحن في نهاية المطاف مع شجرة صغيرة نسبيا كما هو الحال في التعليمات البرمجية أعلاه.


أشجار القرار لديها مجموعة واسعة من التطبيقات. ويمكن أن تنتج توقعات ممتازة متفوقة على تلك التي من الشبكات العصبية أو آلات ناقلات الدعم. لكنها ليست حل واحد يناسب الجميع، لأن الطائرات تقسيمها هي دائما موازية لمحاور الفضاء ميزة. وهذا يحد من توقعاتهم إلى حد ما. ويمكن استخدامها ليس فقط للتصنيف، ولكن أيضا للتراجع، على سبيل المثال عن طريق إعادة النسبة المئوية للعينات المساهمة في فرع معين من الشجرة. شجرة زورو & # 8217؛ s شجرة الانحدار. خوارزمية شجرة التصنيف الأكثر شهرة هي C5.0، وهي متوفرة في حزمة C50 ل R.


ولتحسين التنبؤ أو تجاوز الحدود الموازية للمحور، يمكن استخدام مجموعة من الأشجار تسمى غابة عشوائية. ثم يتم إنشاء التنبؤ عن طريق المتوسط ​​أو التصويت التنبؤات من الأشجار واحدة. تتوفر الغابات العشوائية في حزم R راندومفوريست، الحارس و ربوريست.


استنتاج.


هناك العديد من البيانات المختلفة وأساليب التعلم الآلي تحت تصرفكم. السؤال الحاسم: ما هو أفضل، على أساس نموذج أو استراتيجية التعلم الآلي؟ ليس هناك شك في أن تعلم الآلة لديها الكثير من المزايا. لا تحتاج إلى الاهتمام بالبنية المجهرية للسوق، أو الاقتصاد، أو علم النفس التاجر، أو الأشياء اللينة المشابهة. يمكنك التركيز على الرياضيات البحتة. التعلم الآلي هو أكثر أناقة، وأكثر جاذبية طريقة لتوليد أنظمة التجارة. لديها كل المزايا على جانبها ولكن واحد. على الرغم من كل المواضيع المتحمسة على المنتديات التاجر، فإنه يميل إلى فشل غامض في التداول المباشر.


كل أسبوع الثاني يتم نشر ورقة جديدة حول التداول مع أساليب التعلم الآلي (ويمكن الاطلاع على عدد قليل أدناه). يرجى أخذ جميع هذه المنشورات مع حبة الملح. ووفقا لبعض الأوراق، حققت معدلات فوز رائعة في حدود 70٪، 80٪، أو حتى 85٪. على الرغم من أن معدل الفوز ليس المعيار الوحيد المناسب & # 8211؛ يمكنك أن تفقد حتى مع ارتفاع معدل الفوز & # 8211؛ 85٪ دقة في التنبؤ الحرف عادة ما يعادل عامل الربح فوق 5. مع مثل هذا النظام العلماء المعنيين يجب أن يكون الملياردير في الوقت نفسه. لسوء الحظ لم أتمكن من إعادة إنتاج معدلات الفوز بهذه الطريقة الموصوفة، ولم تقترب حتى. لذلك ربما الكثير من التحيز الاختيار ذهب إلى النتائج. أو ربما أنا & # 8217؛ م غبي جدا.


وبالمقارنة مع الاستراتيجيات القائمة على نموذج، وأنا & # 8217؛ رأى ليس العديد من أنظمة التعلم الآلي الناجحة حتى الآن. ومن ما يسمعه المرء عن الأساليب الحسابية من خلال صناديق التحوط الناجحة، يبدو أن تعلم الآلة نادرا ما يتم استخدامه. ولكن ربما هذا سوف يتغير في المستقبل مع توافر المزيد من قوة المعالجة والقادم من خوارزميات جديدة للتعلم العميق.


تصنيف باستخدام الشبكات العصبية العميقة: Dixon. et. al.2018 التنبؤ اتجاه السعر باستخدام آن & أمب؛ سفم: Kara. et. al.2018 المقارنة التجريبية لخوارزميات التعلم: Caruana. et. al.2006 التعدين سوق الأوراق المالية ميل باستخدام غا & أمب؛ سفم: Yu. Wang. Lai.2005.


ويتناول الجزء التالي من هذه السلسلة التطوير العملي لاستراتيجية التعلم الآلي.


30 أفكار حول & لدكو؛ بناء استراتيجيات أفضل! الجزء 4: آلة التعلم & رديقو؛


مشاركة لطيفة. هناك الكثير من الإمكانيات في هذه المقاربة نحو السوق.


راجع للشغل هل تستخدم محرر التعليمات البرمجية التي تأتي مع زورو؟ كيف يمكن الحصول على مثل هذا التكوين اللون؟


يتم إنتاج النصي الملونة من قبل وورد. يمكنك تغيير الألوان في محرر زورو، ولكن يمكنك استبدالها مع برامج تحرير أخرى تدعم الألوان الفردية، على سبيل المثال نوتيباد ++.


هل من الممكن بعد ذلك أن المفكرة بالكشف عن المتغيرات زورو في البرامج النصية؟ أعني أن باربيريود هو لاحظ كما هو الحال مع محرر زورو؟


نظريا نعم، ولكن لهذا كان لديك لتكوين تسليط الضوء على بناء المفكرة ++، وأدخل جميع المتغيرات في القائمة. بقدر ما أعرف نوتيباد ++ يمكن أيضا أن لا يتم تكوين لعرض وصف وظيفة في نافذة، كما يفعل محرر زورو. هناك & # 8217؛ s لا أداة مثالية & # 8230؛


توافق على الفقرة الأخيرة. لقد حاولت العديد من تقنيات التعلم الآلي بعد قراءة مختلف & # 8216؛ استعراض الأقران & # 8217؛ أوراق. ولكن إعادة إنتاج نتائجها لا يزال بعيد المنال. عندما أعيش اختبار مع مل يمكنني & # 8217؛ ر يبدو أن يتفوق الإدخال العشوائي.


فشل مل في العيش؟ ربما يجب أن يتم تدريب مل مع بيانات الأسعار التي تشمل أيضا تاريخ الانتشار، لفة، القراد وهلم جرا؟


وأعتقد أن السبب # 1 لفشل الحية هو التحيز استخراج البيانات، والناجمة عن اختيار منحازة المدخلات والمعلمات إلى ألغو.


بفضل المؤلف لسلسلة كبيرة من المقالات.


ومع ذلك، تجدر الإشارة إلى أننا لا نحتاج إلى تضييق وجهة نظرنا مع توقع فقط الخطوة السعر التالية. قد يحدث أن الخطوة التالية تتعارض مع تجارتنا في 70٪ من الحالات ولكن لا يزال يستحق صنع التجارة. يحدث هذا عندما يذهب السعر أخيرا إلى الاتجاه الصحيح ولكن قبل ذلك قد يجعل بعض الخطوات ضدنا. إذا قمنا بتأخير الصفقة بخطوة واحدة فإننا لن نقوم بإدخال 30٪ من الصفقات المذكورة، ولكن لذلك سنزيد من نتيجة بقاء 70٪ خطوة واحدة. لذا فإن المعايير هي القيمة الأعلى: N * average_result أو 0.7 * N * (avergae_result + price_step).


مشاركة لطيفة. إذا كنت ترغب فقط في اللعب حولها مع بعض التعلم الآلي، وأنا نفذت أداة مل بسيطة جدا في الثعبان وأضاف واجهة المستخدم الرسومية. لقد تم تنفيذها للتنبؤ بسلاسل زمنية.


شكرا جسل لقد وجدت مثيرة جدا للاهتمام مقالك. أود أن أسألك من خبرتك في التداول، أين يمكننا تحميل بيانات الفوركس التاريخية الموثوقة؟ وأرى أنه من المهم جدا بسبب حقيقة أن سوق الفوركس هو اللامركزية.


شكرا مقدما!


لا توجد بيانات فوركس موثوق بها حقا، لأن كل وسيط الفوركس يخلق البيانات الخاصة بهم. وتختلف جميعها اعتمادا طفيفا على مقدمي السيولة الذين يستخدمونها. فكسم لديها M1 جيدة نسبيا والبيانات القراد مع عدد قليل من الثغرات. يمكنك تحميل البرنامج مع زورو.


شكرا لكتابة مثل هذه المقالة سلسلة كبيرة جسل & # 8230؛ قراءة ممتعة تماما!


لا بد لي من أن أقول على الرغم من أنني لا & # 8217؛ ر عرض نموذج القائم على واستراتيجيات التعلم الآلي باعتبارها استبعد بعضها بعضا؛ لقد كان بعض النجاح أوس باستخدام مزيج من العناصر التي تصفها.


ولكي تكون أكثر دقة، أبدأ عملية إنشاء النظام من خلال تطوير & # 8216؛ التقليدية & # 8217؛ mathematical model, but then use a set of online machine learning algorithms to predict the next terms of the various different time series (not the price itself) that are used within the model. The actual trading rules are then derived from the interactions between these time series. So in essence I am not just blindly throwing recent market data into an ML model in an effort to predict price action direction, but instead develop a framework based upon sound investment principles in order to point the models in the right direction. I then data mine the parameters and measure the level of data-mining bias as you’ve described also.


It’s worth mentioning however that I’ve never had much success with Forex.


Anyway, best of luck with your trading and keep up the great articles!


Thanks for posting this great mini series JCL.


I recently studied a few latest papers about ML trading, deep learning especially. Yet I found that most of them valuated the results without risk-adjusted index, i. e., they usually used ROC curve, PNL to support their experiment instead of Sharpe Ratio, for example.


Also, they seldom mentioned about the trading frequency in their experiment results, making it hard to valuate the potential profitability of those methods. لماذا هذا؟ Do you have any good suggestions to deal with those issues?


ML papers normally aim for high accuracy. Equity curve variance is of no interest. This is sort of justified because the ML prediction quality determines accuracy, not variance.


Of course, if you want to really trade such a system, variance and drawdown are important factors. A system with lower accuracy and worse prediction can in fact be preferable when it’s less dependent on market condictions.


“In fact the most popular – and surprisingly profitable – data mining method works without any fancy neural networks or support vector machines.”


Would you please name those most popular & surprisingly profitable ones. So I could directly use them.


I was referring to the Indicator Soup strategies. For obvious reasons I can’t disclose details of such a strategy, and have never developed such systems myself. We’re merely coding them. But I can tell that coming up with a profitable Indicator Soup requires a lot of work and time.


Well, i am just starting a project which use simple EMAs to predict price, it just select the correct EMAs based on past performance and algorithm selection that make some rustic degree of intelligence.


Jonathan. orrego@gmail offers services as MT4 EA programmer.


شكرا على writeup جيد. It in reality used to be a leisure account it.


Look complicated to more delivered agreeable from you!


By the way, how could we be in contact?


There are following issues with ML and with trading systems in general which are based on historical data analysis:


1) Historical data doesn’t encode information about future price movements.


Future price movement is independent and not related to the price history. There is absolutely no reliable pattern which can be used to systematically extract profits from the market. Applying ML methods in this domain is simply pointless and doomed to failure and is not going to work if you search for a profitable system. Of course you can curve fit any past period and come up with a profitable system for it.


The only thing which determines price movement is demand and supply and these are often the result of external factors which cannot be predicted. For example: a war breaks out somewhere or other major disaster strikes or someone just needs to buy a large amount of a foreign currency for some business/investment purpose. These sort of events will cause significant shifts in the demand supply structure of the FX market . As a consequence, prices begin to move but nobody really cares about price history just about the execution of the incoming orders. An automated trading system can only be profitable if it monitors a significant portion of the market and takes the supply and demand into account for making a trading decision. But this is not the case with any of the systems being discussed here.


2) Race to the bottom.


Even if (1) wouldn’t be true and there would be valuable information encoded in historical price data, you would still face following problem: there are thousands of gold diggers out there, all of them using similar methods and even the same tools to search for profitable systems and analyze the same historical price data. As a result, many of them will discover the same or very similar “profitable” trading systems and when they begin actually trading those systems, they will become less and less profitable due to the nature of the market.


The only sure winners in this scenario will be the technology and tool vendors.


I will be still keeping an eye on your posts as I like your approach and the scientific vigor you apply. Your blog is the best of its kind – keep the good work!


One hint: there are profitable automated systems, but they are not based on historical price data but on proprietary knowledge about the market structure and operations of the major institutions which control these markets. Let’s say there are many inefficiencies in the current system but you absolutely have no chance to find the information about those by analyzing historical price data. Instead you have to know when and how the institutions will execute market moving orders and front run them.


Thanks for the extensive comment. I often hear these arguments and they sound indeed intuitive, only problem is that they are easily proven wrong. The scientific way is experiment, not intuition. Simple tests show that past and future prices are often correlated – otherwise every second experiment on this blog had a very different outcome. Many successful funds, for instance Jim Simon’s Renaissance fund, are mainly based on algorithmic prediction.


One more thing: in my comment I have been implicitly referring to the buy side (hedge funds, traders etc) not to the sell side (market makers, banks). The second one has always the edge because they sell at the ask and buy at the bid, pocketing the spread as an additional profit to any strategy they might be running. Regarding Jim Simon’s Renaissance: I am not so sure if they have not transitioned over the time to the sell side in order to stay profitable. There is absolutely no information available about the nature of their business besides the vague statement that they are using solely quantitative algorithmic trading models…


Thanks for the informative post!


Regarding the use of some of these algorithms, a common complaint which is cited is that financial data is non-stationary…Do you find this to be a problem? Couldn’t one just use returns data instead which is (I think) stationary?


Yes, this is a problem for sure. If financial data were stationary, we’d all be rich. I’m afraid we have to live with what it is. Returns are not any more stationary than other financial data.


Hello sir, I developed some set of rules for my trading which identifies supply demand zones than volume and all other criteria. Can you help me to make it into automated system ?? If i am gonna do that myself then it can take too much time. Please contact me at svadukia@gmail if you are interested.


Sure, please contact my employer at info@opgroup. de. They’ll help.


I have noticed you don’t monetize your page, don’t waste your traffic,


you can earn extra bucks every month because you’ve got high quality content.


If you want to know how to make extra $$$, search for: Mrdalekjd methods for $$$


Technical analysis has always been rejected and looked down upon by quants, academics, or anyone who has been trained by traditional finance theories. I have worked for proprietary trading desk of a first tier bank for a good part of my career, and surrounded by those ivy-league elites with background in finance, math, or financial engineering. I must admit none of those guys knew how to trade directions. They were good at market making, product structures, index arb, but almost none can making money trading directions. لماذا ا؟ Because none of these guys believed in technical analysis. Then again, if you are already making your millions why bother taking the risk of trading direction with your own money. For me luckily my years of training in technical analysis allowed me to really retire after laying off from the great recession. I look only at EMA, slow stochastics, and MACD; and I have made money every year since started in 2009. Technical analysis works, you just have to know how to use it!!


KDnuggets.


نقدم قائمة ب 50 واجهة برمجة تطبيقات تم اختيارها من مجالات مثل تعلم الآلة والتنبؤ وتحليلات النص & # 038؛ تصنيف، التعرف على الوجه، ترجمة اللغة الخ بدء أبيس تستهلك!


كما الذكاء الاصطناعي & أمب؛ Machine learning based applications evolve, we see numerous mash ups of APIs to experiment with. ابدأ مع هذه القائمة من واجهات برمجة التطبيقات المحددة لاستكشاف قدراتها & أمب؛ ميزات في تعلم الآلة، والتنبؤ، التعرف على الوجه، ومعالجة الصور، والتعرف على الكلام الخ تحقق من أين يتم وضع هذه واجهات برمجة التطبيقات في الاستخدام!


تعلم الآلة للتجارة.


عرضت في جورجيا تيش كما كس 7646.


برنامج نانوديجري.


مهندس تعلم الآلة.


جعل نماذج التنبؤ.


تسريع حياتك المهنية مع الاعتماد الذي يسير لك النجاح في العمل.


حول هذه الدورة.


يقدم هذا المساق للطلاب تحديات العالم الحقيقي لتنفيذ استراتيجيات التعلم القائم على التعلم الآلي بما في ذلك الخطوات الحسابية من جمع المعلومات لأوامر السوق. وينصب التركيز على كيفية تطبيق نهج التعلم الآلي الاحتمالية لقرارات التداول. ونحن نعتبر النهج الإحصائية مثل الانحدار الخطي، كن والأشجار الانحدار وكيفية تطبيقها على حالات تداول الأسهم الفعلية.


تكلفة الدورة.


تقريبا. 4 اشهر.


مستوى المهارة.


وشملت في الدورة.


محتوى التعلم الغني.


تدرس من قبل الايجابيات الصناعة.


دعم الطلاب المجتمع.


الانضمام إلى الطريق إلى العظمة.


هذه الدورة المجانية هي الخطوة الأولى نحو مهنة جديدة مع مهندس تعلم آلة نانوديجري البرنامج.


دورة مجانية.


تعلم الآلة للتجارة.


تعزيز المهارات الخاصة بك مجموعة وتعزيز هيرابيليتي الخاص بك من خلال التعلم المستقل والمستقل.


برنامج نانوديجري.


مهندس تعلم الآلة.


تسريع حياتك المهنية مع الاعتماد الذي يسير لك النجاح في العمل.


يؤدي الدورات.


تاكر بالش.


أربان تشاكرابورتي.


ما سوف تتعلم.


وتتكون هذه الدورة من ثلاث دورات مصغرة:


ميني-كورس 1: التعامل مع البيانات المالية في بيثون ميني-كورس 2: الحسابية الاستثمار ميني-كورس 3: خوارزميات التعلم الآلي للتداول.


كل دورة مصغرة تتكون من حوالي 7-10 دروس قصيرة. التعاقدات والمشاريع متشابكة.


خريف 2018 طلاب أومز: سيكون هناك اختبارين - واحد نصفي بعد مصغرة بالطبع 2، وامتحان نهائي واحد.


المتطلبات والمتطلبات.


يجب أن يكون لدى الطلاب مهارات تشفير قوية وبعض الإلمام بأسواق الأسهم. لا يفترض أي تمويل أو تجربة التعلم الآلي.


لاحظ أن هذه الدورة تخدم الطلاب مع التركيز على علوم الكمبيوتر، وكذلك الطلاب في التخصصات الأخرى مثل هندسة النظم الصناعية، والإدارة، أو الرياضيات الذين لديهم تجارب مختلفة. جميع أنواع الطلاب هي موضع ترحيب!


قد تكون موضوعات مل & كوت؛ مراجعة & كوت؛ لطلاب كس، في حين أن أجزاء التمويل سيتم استعراض للطلاب المالية. ومع ذلك، حتى لو كان لديك خبرة في هذه الموضوعات، وسوف تجد أن نعتبرها بطريقة مختلفة مما كنت قد رأيت من قبل، وخاصة مع النظر نحو تنفيذ للتداول.


سوف تكون البرمجة في المقام الأول في بيثون. We will make heavy use of numerical computing libraries like NumPy and Pandas.


لماذا تأخذ هذه الدورة.


في نهاية هذا المقرر، يجب أن تكون قادرا على:


فهم هياكل البيانات المستخدمة في التداول الخوارزمي. معرفة كيفية بناء البرمجيات للوصول إلى بيانات الأسهم الحية، وتقييمه، واتخاذ قرارات التداول. فهم 3 خوارزميات التعلم الآلي شعبية وكيفية تطبيقها على مشاكل التداول. فهم كيفية تقييم أداء خوارزمية تعلم الآلة في بيانات سلاسل زمنية (بيانات سعر السهم). معرفة كيف ولماذا استخراج البيانات (التعلم الآلي) تقنيات تفشل. إنشاء نظام تداول الأوراق المالية التي تستخدم البيانات اليومية الحالية.


بعض القيود / القيود:


نحن نستخدم البيانات اليومية. هذه ليست دورة هفت، ولكن العديد من المفاهيم هنا ذات الصلة. نحن لا نتفاعل (التجارة) مباشرة مع السوق، ولكننا سوف تولد تخصيصات الأسهم التي يمكن أن التجارة إذا كنت ترغب في ذلك.


على ماذا أحصل؟


أشرطة الفيديو المعلم تعلم عن طريق القيام تمارين تدرس من قبل المتخصصين في هذا القطاع.


الدورات ذات الصلة.


تعلم الآلة: التعلم دون إشراف.


منظمة العفو الدولية القائمة على المعرفة: الأنظمة المعرفية.


المعلوماتية الصحية في الغيمة.


تحليلات البيانات الكبيرة في الرعاية الصحية.


نشر مجموعة هادوب.


Segmentation and Clustering.


دورات شعبية.


Artificial Intelligence - Deep Learning.


Display Advertising.


VR Software Development.


البرامج المميزة.


فقط في أوداسيتي.


البرامج.


اعمال.


"نانوديجري" هي علامة تجارية مسجلة ل أوداسيتي. &نسخ؛ 2018–2018 Udacity, Inc.


أوداسيتي ليست جامعة معتمدة ونحن لا تمنح درجة.


روبوت الثروة.


Posted on March 4, 2018 by Kris Longmore.


Update 2 : Responding to another suggestion, I’ve added some equity curves of a simple trading system using the knowledge gained from this analysis.


Update 3 : In response to a comment from Alon, I’ve added some Lite-C code that generates the training data used in this post and outputs it to a. csv file. You can have some serious fun with this and it enables you to greatly extend the research presented here. استمتع!


Update 4 : 30 March 2017: The analysis was extended the analysis to include data up to the end of 2018. Of course, I updated the post to reflect the changes.


The code for performing the analysis and generating the data I used in this post, as well the data file itself and another for a different instrument that you can experiment with, are all available for free download by joining our mailing list.


One of the first books I read when I began studying the markets a few years ago was David Aronson’s Evidence Based Technical Analysis . The engineer in me was attracted to the ‘Evidence Based’ part of the title. This was soon after I had digested a trading book that claimed a basis in chaos theory, the link to which actually turned out to be non-existent. Apparently using complex-sounding terms in the title of a trading book lends some measure of credibility. Anyway, Evidence Based Technical Analysis is largely a justification of a scientific approach to trading, including a method for rigorous assessment of the presence of data mining bias in backtest results. There is also a compelling discussion based in cognitive psychology of the reasons that some traders turn away from objective methods and embrace subjective beliefs. I find this area fascinating.


Readers of this blog will know that I am very interested in using machine learning to profit from the markets. Imagine my delight when I discovered that David Aronson had co-authored a new book with Timothy Masters titled Statistically Sound Machine Learning for Algorithmic Trading of Financial Instruments – which I will herein refer to as SSML. I quickly devoured the book and have used it as a handy reference ever since. While it is intended as a companion to Aronson’s (free) software platform for strategy development, it contains numerous practical tips for any machine learning practitioner and I’ve implemented most of his ideas in R.


I used SSML to guide my early forays into machine learning for trading, and this series describes some of those early experiments. While a detailed review of everything I learned from SSML and all the research it inspired is a bit voluminous to relate in detail, what follows is an account of what I found to be some of the more significant and practical learnings that I encountered along the way.


This post will focus on feature engineering and also introduce the data mining approach. The next post will focus on algorithm selection and ensemble methods for combining the predictions of numerous learners.


The data mining approach.


Data mining is just one approach to extracting profits from the markets and is different to a model-based approach. Rather than constructing a mathematical representation of price, returns or volatility from first principles, data mining involves searching for patterns first and then fitting a model to those patterns after the fact. Both model-based and data mining approaches have pros and cons, and I contend that using both approaches can lead to a valuable source of portfolio diversity.


The Financial Hacker summed up the advantages and disadvantages of the data mining approach nicely:


The advantage of data mining is that you do not need to care about market hypotheses. The disadvantage: those methods usually find a vast amount of random patterns and thus generate a vast amount of worthless strategies. Since mere data mining is a blind approach, distinguishing real patterns – caused by real market inefficiencies – from random patterns is a challenging task. Even sophisticated reality checks can normally not eliminate all data mining bias. Not many successful trading systems generated by data mining methods are known today.


David Aronson himself cautions against putting blind faith in data mining methods:


Though data mining is a promising approach for finding predictive patterns in data produced by largely random complex processes such as financial markets, its findings are upwardly biased. This is the data mining bias. Thus, the profitability of methods discovered by data mining must be evaluated with specialized statistical tests designed to cope with the data mining bias.


I would add that the implicit assumption behind the data mining approach is that the patterns identified will continue to repeat in the future. Of course, the validity of this assumption is unlikely to ever be certain.


Data mining is a term that can mean different things to different people depending on the context. When I refer to a data mining approach to trading systems development, I am referring to the use of statistical learning algorithms to uncover relationships between feature variables and a target variable (in the regression context, these would be referred to as the independent and dependent variables, respectively). The feature variables are observations that are assumed to have some relationship to the target variable and could include, for example, historical returns, historical volatility, various transformations or derivatives of a price series, economic indicators, and sentiment barometers. The target variable is the object to be predicted from the feature variables and could be the future return (next day return, next month return etc), the sign of the next day’s return, or the actual price level (although the latter is not really recommended, for reasons that will be explained below).


Although I differentiate between the data mining approach and the model-based approach, the data mining approach can also be considered an exercise in predictive modelling. Interestingly, the model-based approaches that I have written about previously (for example ARIMA, GARCH, Random Walk etc) assume linear relationships between variables. Modelling non-linear relationships using these approaches is (apparently) complex and time consuming. On the other hand, some statistical learning algorithms can be considered ‘universal approximators’ in that they have the ability to model any linear or non-linear relationship. It was not my intention to get into a philosophical discussion about the differences between a model-based approach and a data mining approach, but clearly there is some overlap between the two. In the near future I am going to write about my efforts to create a hybrid approach that attempts a synergistic combination of classical linear time series modelling and non-linear statistical learning – trust me, it is actually much more interesting than it sounds. انظر لهذه المساحة.


Variables and feature engineering.


The prediction target.


The first and most obvious decision to be made is the choice of target variable. In other words, what are we trying to predict? For one-day ahead forecasting systems, profit is the usual target. I used the next day’s return normalized to the recent average true range, the implication being that in live trading, position sizes would be inversely proportionate to the recent volatility. In addition, by normalizing the target variable in this way, we may be able to train the model on multiple markets, as the target will be on the same scale for each.


Choosing predictive variables.


In SSML, Aronson states that the golden rule of feature selection is that the predictive power should come primarily from the features and not from the model itself. My research corroborated this statement, with many (but not all) algorithm types returning correlated predictions for the same feature set. I found that the choice of features had a far greater impact on performance than choice of model. The implication is that spending considerable effort on feature selection and feature engineering is well and truly justified. I believe it is critical to achieving decent model performance.


Many variables will have little or no relationship with the target variable and including these will lead to overfitting or other forms of poor performance. Aronson recommends using chi-square tests and Cramer’s V to quantify the relationship between variables and the target. I actually didn’t use this approach, so I can’t comment on it. I used a number of other approaches, including ranking a list of candidate features according to their Maximal Information Coefficient (MIC) and selecting the highest ranked features, Recursive Feature Elimination (RFE) via the caret package in R, an exhaustive search of all linear models, and Principal Components Analysis (PCA). ويناقش كل منها أدناه.


Some candidate features.


Following is the list of features that I investigated as part of this research. Most were derived from SSML. This list is by no means exhaustive and only consists of derivatives and transformations of the price series. I haven’t yet tested exogenous variables, such as economic indicators, the price histories of other instruments and the like, but I think these are deserving of attention too. The following list is by no means exhaustive, but provides a decent starting point:


1-day log return Trend deviation: the logarithm of the closing price divided by the lowpass filtered price Momentum: the price today relative to the price x days ago, normalized by the standard deviation of daily price changes. ATR: the average true range of the price series Velocity: a one-step ahead linear regression forecast on closing prices Linear forecast deviation: the difference between the most recent closing price and the closing price predicted by a linear regression line Price variance ratio: the ratio of the variance of the log of closing prices over a short time period to that over a long time period. Delta price variance ratio: the difference between the current value of the price variance ratio and its value x periods ago. The Market Meanness Index: A measure of the likelihood of the market being in a state of mean reversion, created by the Financial Hacker. MMI deviation: The difference between the current value of the Market Meanness Index and its value x periods ago. The Hurst exponenet ATR ratio: the ratio of an ATR of a short (recent) price history to an ATR of a longer period. Delta ATR ratio: the difference between the current value of the ATR ratio and the value x bars ago. Bollinger width: the log ratio of the standard deviation of closing prices to the mean of closing prices, that is a moving standard deviation of closing prices relative to the moving average of closing prices. Delta bollinger width: the difference between the current value of the bollinger width and its value x bars ago. Absolute price change oscillator: the difference between a short and long lookback mean log price divided by a 100-period ATR of the log price.


Thus far I have only considered the most recent value of each variable. I suspect that the recent history of each variable would provide another useful dimension of data to mine. I left this out of the feature selection stage since it makes more sense to firstly identify features whose current values contain predictive information about the target variable before considering their recent histories. Incorporating this from the beginning of the feature selection stage would increase the complexity of the process by several orders of magnitude and would be unlikely to provide much additional value. I base that statement on a number of my own assumptions, not to mention the practicalities of the data mining approach, rather than any hard evidence.


Transforming the candidate features.


In my experiments, the variables listed above were used with various cutoff periods (that is, the number of periods used in their calculation). Typically, I used values between 3 and 20 since Aronson states in SSML that lookback periods greater than about 20 will generally not contain information useful to the one period ahead forecast. Some variables (like the Market Meanness Index) benefit from a longer lookback. For these, I experimented with 50, 100, and 150 bars.


Additionally, it is important to enforce a degree of stationarity on the variables. Davind Aronson again:


Using stationary variables can have an enormous positive impact on a machine learning model. There are numerous adjustments that can be made in order to enforce stationarity such as centering, scaling, and normalization. So long as the historical lookback period of the adjustment is long relative to the frequency of trade signals, important information is almost never lost and the improvements to model performance are vast.


Scaling: divide the indicator by the interquartile range (note, not by the standard deviation, since the interquartile range is not as sensitive to extremely large or small values). Centering: subtract the historical median from the current value. Normalization: both of the above. Roughly equivalent to traditional z-score standardization, but uses the median and interquartile range rather than the mean and standard deviation in order to reduce the impact of outliers. Regular normalization: standardizes the data to the range -1 to +1 over the lookback period (x-min)/(max-min) and re-centered to the desired range.


In my experiments, I generally adopted regular normalization using the most recent 50 values of the features.


Data Pre-Processing.


If you’re following along with the code and data provided (see note in bold above), I used the data for the GBP/USD exchange rate (sampled daily at midnight UTC, for the period 2009-2018), but I also provided data for EUR/USD (same sampling regime) for further experimentation.


Removing highly correlated variables.


It makes sense to remove variables that are highly correlated with other variables since they are unlikely to provide additional information that isn’t already contained elsewhere in the feature space. Keeping these variables will also add unnecessary computation time, increase the risk of overfitting and bias the final model towards the correlated variables.


Running caret ‘s function for examining pairwise correlations between variables – caret :: findCorrelation ( ) – with a cutoff of 0.3, these are the remaining variables and their pairwise correlations:


Feature selection via Maximal Information.


The maximal information coefficient (MIC) is a non-parametric measure of two-variable dependence designed specifically for rapid exploration of many-dimensional data sets. While MIC is limited to univariate relationships (that is, it does not consider variable interactions), it does pick up non-linear relationships between dependent and independent variables. Read more about MIC here. I used the minerva package in R to rank my variables according to their MIC with the target variable (next day’s return normalized to the 100-period ATR). Here’s the code output:


These results show that none of the features have a particularly high MIC with respect to the target variable, which is what I would expect from noisy data such as daily exchange rates sampled at an arbitrary time. However, certain variables have a higher MIC than others. In particular, the long-term ATR and the 20-period Hurst exponent and the 3-period Bollinger width outperform the rest of the variables.


Recursive feature elimination.


I also used recursive feature elimination (RFE) via the caret package in R to isolate the most predictive features from my list of candidates. RFE is an iterative process that involves constructing a model from the entire set of features, retaining the best performing features, and then repeating the process until all the features are eliminated. The model with the best performance is identified and the feature set from that model declared the most useful.


I performed cross-validated RFE using a random forest model. في ما يلي النتائج:


In this case, the RFE process has emphasized variables that describe volatility and trend, but has decided that the best performance is obtained by incorporating 14 of 15 variables into the model. Here’s a plot of the cross validated performance of the best feature set for various numbers of features (noting that k - fold cross validation may not be the ideal cross-validation method for financial time series):


I am tempted to take the results of the RFE with a grain of salt. My reasons are:


The RFE algorithm does not fully account for interactions between variables. For example, assume that two variables individually have no effect on model performance, but due to some relationship between them they improve performance when both are included in the feature set. RFE is likely to miss this predictive relationship. The performance of RFE is directly related to the ability of the specific algorithm (in this case random forest) to uncover relationships between the variables and the target. At this stage of the process, we have absolutely no evidence that the random forest model is applicable in this sense to our particular data set. Finally, the implementation of RFE that I used was the ‘out of the box’ caret version. This implementation uses root mean squared error (RMSE) as the objective function, however I don’t believe that RMSE is the best objective function for this data due to the significant influence of extreme values on model performance. It is possible to have a low RMSE but poor overall performance if the model is accurate across the middle regions of the target space (corresponding to small wins and losses), but inaccurate in the tails (corresponding to big wins and losses)


In order to address (3) above, I implemented a custom summary function so that the RFE was performed such that the cross-validated absolute return was maximized. I also applied the additional criterion that only predictions with an absolute value of greater than 5 would be considered under the assumption that in live trading we wouldn’t enter positions unless the prediction exceeded this value. النتائج كما يلي:


The results are a little different to those obtained using RMSE as the objective function. The focus is still on the volatility and trend indicators, but in this case the best cross validated performance occurred when selecting only 2 out of the 15 candidate variables. Here’s a plot of the cross validated performance of the best feature set for various numbers of features:


The model clearly performs better in terms of absolute return for a smaller number of predictors. This is consistent with Aronson’s assertion that with this approach we should stick with at most 3-4 variables otherwise overfitting is almost unavoidable.


The performance profile of the model tuned on absolute return is very different to that of the model tuned on RMSE, which displays a consistent improvement as the number of predictors is increased. Using RMSE as the objective function (which seems to be the default in many applications I’ve come across) would result in a very sub-optimal final model in this case. This highlights the importance of ensuring that the objective function is a good proxy for the performance being sought in practice.


In the RFE example above, I used 5-fold cross validation, but I haven’t held out a test set of data or estimated performance with an inner cross validation loop. Note also that k - fold cross validation may not be ideal for financial time series thanks to the autocorrelations present.


Models with in-built feature selection.


A number of machine learning algorithms have feature selection in-built. Max Kuhn’s website for the caret package contains a list of such models that are accessible through the caret package. I’ll apply several and compare the features selected to those selected with other methods. For this experiment, I used a diverse range of algorithms that include various ensemble methods and both linear and non-linear interactions:


Bagged multi-adaptive regressive splines (MARS) Boosted generalized additive model (bGAM) Lasso Spike and slab regression (SSR) Regression tree Stochastic gradient boosting (SGB)


For each model, I did only very basic (if any) hyperparameter tuning within caret using time series cross validation with a train window length of 200 days and a test window length of 20 days. Maximization of absolute return was used as the objective function. Following cross-validation, caret actually trains a model on the full data set with the best cross-validated hyperparameters – but this is not what we want if we are to mimic actual trading behaviour (we are more interested in the aggregated performance across each test window, which caret very neatly allows us to access – details on this below when we investigate a trading system).


The table below shows the top 5 variables for each algorithm:


We can see that 10-day momentum is included in the top 5 predictors for every algorithm I investigated except one, and was the top feature every time it was selected. The change in the ratio of the ATR lookbacks featured 7 times in total. A responsive absolute price change oscillator was selected 4 times, and in one form or another (10- and 20-day variables once each and 100-day variable thrice). The 5-day change in the price variance ratio was a notable mention, being included in the top variables 3 times. The table below summarizes the frequency with which each variable was selected:


9 of the 15 variables that passed the correlation filter were selected in the top 5 by at least one algorithm.


Model selection using glmulti.


The glmulti package fits all possible unique generalized linear models from the variables and returns the ‘best’ models as determined by an information criterion (Aikake in this case). The package is essentially a wrapper for the glm (generalized linear model) function that allows selection of the ‘best’ model or models, providing insight into the most predictive variables. By default, glmulti builds models from the main interactions, but there is an option to also include pairwise interactions between variables. This increases the computation time considerably, and I found that the resulting ‘best’ models were orders of magnitude more complex than those obtained using main interactions only, and results were on par.


1 + trend + atrRatSlow"


We retain the models whose AICs are less than two units from the ‘best’ نموذج. Two units is a rule of thumb for models that, for all intents and purposes, are likely to be on par in terms of their performance:


1 + trend + atrRatSlow 22669.87 0.03235620.


1 + apc5 + trend + atrRatSlow 22670.72 0.02111157.


1 + MMIFaster + trend + atrRatSlow 22670.73 0.02104022.


1 + bWdith3 + trend + atrRatSlow 22670.87 0.01961736.


1 + trend + atrRatSlow + bWidthSlow 22670.96 0.01878187.


1 + deltaMMIFastest10 + trend + atrRatSlow 22671.04 0.01799825.


1 + trend + atrRatSlow + ATRSlow 22671.20 0.01667710.


1 + atrRatSlow 22671.23 0.01644049.


1 + apc5 + MMIFaster + trend + atrRatSlow 22671.40 0.01504698.


1 + deltaPVR5 + trend + atrRatSlow 22671.44 0.01474030.


1 + MMIFaster + trend + atrRatSlow + bWidthSlow 22671.49 0.01439135.


1 + HurstFast + trend + atrRatSlow 22671.55 0.01396476.


1 + HurstMod + trend + atrRatSlow 22671.61 0.01357259.


1 + mom10 + trend + atrRatSlow 22671.64 0.01337186.


1 + apc5 + bWdith3 + trend + atrRatSlow 22671.65 0.01329943.


1 + MMIFaster + deltaMMIFastest10 + trend + atrRatSlow 22671.66 0.01325762.


1 + deltaATRrat3 + trend + atrRatSlow 22671.68 0.01309016.


1 + deltaATRrat10 + trend + atrRatSlow 22671.69 0.01303342.


1 + HurstFaster + trend + atrRatSlow 22671.70 0.01294480.


1 + bWdith3 + MMIFaster + trend + atrRatSlow 22671.72 0.01283320.


1 + apc5 + trend + atrRatSlow + bWidthSlow 22671.74 0.01268352.


1 + apc5 + deltaMMIFastest10 + trend + atrRatSlow 22671.83 0.01216110.


1 + bWdith3 + trend + atrRatSlow + bWidthSlow 22671.85 0.01205142.


Notice any patterns here? many of the top models selected the ratio of the 20- day to 100-day ATRs, as well as the difference between a short-term and long-term trend indicator. Perhaps surprisingly sparse are the momentum variables. This is confirmed with this plot of the model averaged variable importance (averaged over the best 1,000 models):


Note that these models only considered the main, linear interactions between each variable and the target. Of course, there is no guarantee that any relationship is linear, if it exists at all. Further, there is the implicit assumption of stationary relationships amongst the variables which is unlikely to hold. Still, this method provides some useful insight.


One of the great things about glmulti is that it facilitates model-averaged predictions – more on this when I delve into ensembles in part 2 of this series.


Generalized linear model with stepwise feature selection.


Finally, I used a generalized linear model with stepwise feature selection:


The final model selected 2 of the 15 variables: the ratio of the 20- to 100-day ATR, difference between a short-term and long-term trend indicator.


Boruta: all relevant feature selection.


Boruta finds relevant features by comparing the importance of the original features with the importance of random variables. Random variables are obtained by permuting the order of values of the original features. Boruta finds a minimum, mean and maximum value of the importance of these permuted variables, and then compares these to the original features. Any original feature that is found to be more relevant than the maximum random permutation is retained.


Boruta does not measure the absolute importance of individual features, rather it compares each feature to random permutations of the original variables and determines the relative importance. This theory very much resonates with me and I intuit that it will find application in weeding out uninformative features from noisy financial data. The idea of adding randomness to the sample and then comparing performance is analogous to the approach I use to benchmark my systems against a random trader with a similar trade distribution.


The box plots in the figure below show the results obtained when I ran the Boruta algorithm for the 15 filtered variables for 1,000 iterations. The blue box plots show the permuted variables of minimum, mean and maximum importance, the green box plots indicate the original features that ranked higher than the maximum importance of the random permuted variables, and the variables represented by the red box plots are discarded.


These results are largely consistent with the results obtained through other methods, perhaps with the exception of the inclusion of the MMI and Hurst variables. Surprisingly, the long-term ATR was the clear winner.


Side note: The developers state that “Boruta” means “Slavic spirit of the forest.” As something of a slavophile myself, I did some googling and discovered that this description is quite a euphemism. Check out some of the items that pop up in a Google image search!


Discussion of feature selection methods.


It is important to note that any feature selection process naturally invites a degree of selection bias. For example, from a large set of uninformative variables, a small number may randomly correlate with the target variable. The selection algorithm would then rank these variables highly. The error would only be (potentially) uncovered through cross validation of the selection algorithm or by using an unseen test or validation set. Feature selection is difficult and can often make predictive performance worse, since it is easy to over-fit the feature selection criterion. It is all to easy to end up with a subset of attributes that works really well on one particular sample of data, but not necessarily on any other. There is a fantastic discussion of this at the Statistics Stack Exchange community that I have linked here because it is just so useful.


It is critical to take steps to minimize selection bias at every opportunity. The results of any feature selection process should be cross validated or tested on an unseen hold out set. If the hold out set selects a vastly different set of predictors, something has obviously gone wrong – or the features are worthless. The approach I took in this post was to cross validate the results of each test that I performed, with the exception of the Maximal Information Criterion and glmulti approaches. I’ve also selected features based on data for one market only. If the selected features are not robust, this will show up with poor performance when I attempt to build predictive models for other markets using these features.


I think that it is useful to apply a wide range of methods for feature selection, and then look for patterns and consistencies across these methods. This approach seems to intuitively be far more likely to yield useful information than drawing absolute conclusions from a single feature selection process. Applying this logic to the approach described above, we can conclude that the 10-day momentum, the ratio of the 10- to 20-day ATR, the trend deviation indicator, and the absolute price change oscillator are probably the most likely to yield useful information since they continually show up in most of the feature selection methods that I investigated. Other variables that may be worth considering include the long-term ATR and the change in a responsive MMI.


In part 2 of this article, I’ll describe how I built and combined various models based on these variables.


Principal Components Analysis.


An alternative to feature selection is Principal Components Analysis (PCA), which attempts to reduce the dimensionality of the data while retaining the majority of the information. PCA is a linear technique: it transforms the data by linearly projecting it onto a lower dimension space while preserving as much of its variation as possible. Another way of saying this is that PCA attempts to transform the data so as to express it as a sum of uncorrelated components.


Again, note that PCA is limited to a linear transformation of the data, however there is no guarantee that non-linear transformations won’t be better suited. Another significant assumption when using PCA is that the principal components of future data will look those of the training data. It’s also possible that the smallest component, describing the least variance, is also the only one carrying information about the target variable, and would likely be lost when the major variance contributors are selected.


To investigate the effects of PCA on model performance, I cross validated 2 random forest models, the first using the principal components of the 15 variables, and the other using all 15 variables in their raw form. I chose the random forest model since it includes feature selection and thus may reveal some insights about how PCA stacks up in relation to other feature selection methods. For both models, I performed time series cross validation on a training window of 200 days and a testing window of 20 days.


In order to infer the difference in model performance, I collected the results from each resampling iteration of both final models and compared their distributions via a pair of box and whisker plots:


The model built on the raw data outperforms the model built on the data’s principal components in this case. The mean profit is higher and the distribution is shifted in the positive direction. Sadly however, both distributions look only sightly better than random and have wide distributions.


A simple trading system.


I will go into more detail about building a practical trading system using machine learning in the next post, but the following demonstrates a simple trading system based on some of the information gained from the analysis presented above. The system is based on three of the indicators that the feature selection analysis identified as being predictive of the target variable. The features used were long-term ATR, the change in the responsive MMI, and the trend deviance indicator. I trained a generalized boosted regression model using the gbm package in R using these indicators as the independent variables predicting the next day return normalized to the recent ATR. The model was trained on a sliding window of 200 days and tested on the adjacent 20 days over the length of the entire data set. I also subtracted transaction costs of 2 pips per round turn lot traded.


The code that was used to perform these simulations is part of an exceptionally useful research environment that enables rapid experimentation with different variables, hyperparameter tuning, and various training-testing window setups. It even enables the user to swap out the GBM algorithm for dozens of others, like neural networks, support vector machines and decision trees, with a single line of code. If you would like to make use of this code, download it for free here.


Robot Wealth members have access to the full research environment as well as other exclusive content, development tools, the members’ forum and our fundamental and advanced algo trading courses. Join the Robot Wealth community today and take your trading to the next level – sign up here.


The returns series of most financial instruments consists of a relatively large number of small positive and small negative values and a smaller number of large positive and large negative values. I hypothesize that the values whose magnitude is smaller are more random in nature than the values whose magnitude is large. On any given day, all things being equal, a small negative return could turn out to be a small positive return by the time the close rolls around, or vice versa, as a result of any number of random occurrences related to the fundamentals of the exchange rate. These same random occurrences are less likely to push a large positive return into negative territory and vice versa, purely on account of the size of the price swings involved. Following this logic, I hypothesize that my model is likely to be more accurate in its extreme predictions than in its ‘normal’ نطاق. We can test this hypothesis on the simple trading strategy described above by entering positions only when the model predicts a return that is large in magnitude.


Here are the results, along with the buy and hold return from the testing data set:


While the strategy may look enticing, it is actually not overly robust to changing the random initialization or the hyperparameters of the GBM algorithm – more work is needed to turn this into a viable strategy. We can see that increasing the prediction threshold for entering a trade resulted in smoother equity curves, but a much reduced final equity. The model significantly outperformed the buy and hold strategy. The prediction threshold can be adjusted depending on the trader’s appetite for high returns (threshold = 0) as opposed to minimal drawdown (threshold = 100).


الاستنتاجات.


The MIC analysis and the Boruta algorithm agreed that the long-term ATR was the most important feature. They were also the only approaches that included the Hurst exponent in their most important features. The RFE analysis indicated that it may be prudent to focus on variables that measure long-term volatility or recent changes in volatility relative to the longer term. An exhaustive search of all possible generalized linear models that considered main interactions using glmulti implied that the 20- to 100-day ATR ratio and the trend deviance variables are most predictive. Stepwise feature selection using a generalized linear model returned similar results. Boruta identified 8 useful variables, with the long-term ATR the clear winner. Transforming the variables using PCA reduced the performance of a random forest model relative to using the raw variables.


The same features seem to be selected over and over again using the different methods. Is this just a fluke, or has this long and exhaustive data mining exercise revealed something of practical use to a trader? In part 2 of this series, I will investigate the performance of various machine learning algorithms based on this feature selection exercise. I’ll compare different algorithms and then investigate combining their predictions using ensemble methods with the objective of creating a useful trading system.


المراجع.


Aronson, D. 2006, Evidence-Based Technical Analysis: Applying the Scientific Method and Statistical Inference to Trading Signals .


Aronson, D. and Masters, T. 2017-, Statistically Sound Machine Learning for Algorithmic Trading of Financial Instruments: Developing Predictive-Model-Based Trading Systems Using TSSB.


ملصق ممتاز! I’ll be sure to follow the next parts of the series. I’m just starting in the world of algo trading and based on what you wrote SSML looks like a good starting point. Would you recommend any other book?


كريس لونغمور.


شكر! سعيد لأنك أحببته.


My reading list for starting out with algo trading includes both of Ernie Chan’s books and Aronson’s first book, ‘Evidence Based Technical Analysis’. Jaekle and Tomasini is a handy reference too. If you don’t already have the background, an introductory statistics/probability text (sorry, can’t recommend one off the top of my head). If you want to delve into time series analysis, Ruey Tsay’s book on the topic is heavy going, but worth persisting with. In terms of machine learning, Lantz’s ‘Machine Learning with R’ will get you started. Depending on your stats background, Tibrishani et. الله. released two works – ‘The Elements of Statistical Learning’ (more advanced) and ‘Introduction to Statistical Learning’ & # 8211؛ these are the logical next steps for machine learning. Finally, I find the caret package in R to be immensely useful, and the author of the package also wrote a book called ‘Applied Predictive Modelling’ & # 8211؛ definitely worth a read if you are interested in the machine learning side of things.


Jacques Joubert.


Brilliant post Kris, Thank you.


This has really helped me to get started in the area of using ML in trading. Was even part of the recommended reading I was given.


Will email you about adding your recommended books here to the Quantocracy book list.


I am really looking forward to the follow up post.


كريس لونغمور.


Thanks for that feedback, Jaques. I am really glad you found it useful.


I love Aronson’s books also. Did you implement a version of the MCPT ?


كريس لونغمور.


شكرا نيك! I haven’t yet implemented MCPT in R, but I think the ‘coin’ package could be used. Do you know of any others? MCPT would be a good inclusion as an update to this post, or perhaps in the next.


I’m not familiar with ‘coin’ but thanks for mentioning that … I’ve implemented my own version of the MCPT.


BTW, you mention that you use Zorro. Have you used their R bridge for strategy development or live trading ?


كريس لونغمور.


Yes I’ve used Zorro’s R bridge extensively for strategy development and am using it for live trading right now. Its an integral part of my workflow and I am much more efficient during the development stage compared with using either Zorro or R separately. Its a very useful piece of kit to have in your toolbox.


I ‘ll do a post in the near future on exactly how this works and why it is efficient.


Very interesting work. You might also be interested in the “Boruta” all relevant feature selection method, which can be found at m2.icm. edu. pl/boruta/


I look forward to your next few posts.


كريس لونغمور.


Thanks for pointing me to Boruta, Dekalog. I’ll update the post to include this method. I see that it is implemented as an R package – how convenient!


كريس لونغمور.


I’ve updated the post with a paragraph on Boruta. Thanks for pointing me to this package – very easy to use and wonderfully intuitive logic behind it.


Hi and thanks for sharing your work. One suggestion and request I would make would be to plot equity curves of some of the more promising candidates against say a simple Buy and Hold model. For example, if your in sample training set found ATR and BB (with some parameter set) useful and you created a model built around those features, you could plot both the in and out of sample resulting equity curves of the results (you also need to determine how you want to translate those predictions to actions. e. g. Buy/Sell/Flat). I’ve found the equity curve can reveal a lot about the results that may not be evident from looking at standalone metrics. One test may show promising results around a certain set of variables, but depending on how the individual results are finally aggregated, a different set of features may have performed much better.


كريس لونغمور.


Hi IT, thanks for that comment. I take your point – equity curves certainly reveal a lot more useful information than the result of a feature selection test. And after all, this is a blog about trading. I had originally intended to leave all of the strategy development stuff until the next post where I will write about how I transform a model output into actionable intelligence, combining predictions from multiple learners and all that. But you’re right – an illustrative trading strategy and equity curve would fit nicely here. I’ll update the post accordingly.


Thanks again for your feedback – always much appreciated.


Deshawn Janas.


\nThat will be the common answer you will come across for every machine learning and knowledge discovery problem you face. There is no best learning system, classification system, or statistical method. You need to know your data-set well enough to realize where one approach might be better than others.


كريس لونغمور.


Couldn’t agree more, Deshawn. There is an important place for subject matter knowledge in nearly any machine learning task.


Hello and thank you for the great post. I discovered TSSB thanks to it and now I’m playing with the application. I see you also use ATR normalized return. I tried to compute it in R and compare the values to TSSB outputs but they differ. For example on D1 GBP/USD data from 2009-11-11 to 2018-03-01 mean value of my computed ATR 250 normalized return is -0.01237755 while TSSB values give mean of -0.01529271. Do you experience the same (which would probably mean that the implementations differ)? Or did I make a mistake?


كريس لونغمور.


Hello and thanks for commenting. Are you sampling your data at the same time in both applications? Since foreign exchange doesn’t have an official closing time, make sure that the one you use is consistent across both applications. Also, I believe TSSB calculates this variable using open prices, which in theory shouldn’t differ from the previous day’s closing price. Unless of course there is a price gap between one day’s close and the next’s open, which can happen due to weekends and holidays. Can those ideas account for the differences you are seeing?


I have not actually run anything in TSSB myself. I like using R too much!


Hey and sorry for the late reply, I was without my laptop for a while.


I completely understand, it’s easy to fall in love with R!:) I also wanted to rewrite the stuff into R but after reading the whole book I decided to give TSSB a go because I saw how much work had already been put into it.


Or maybe I will combine the approaches somehow. I noticed there is an automation framework for TSSB written in Python which could be modified to handle both: R and TSSB (unfortunately it’s Windows only solution).


About the problem – it turned out it was only because at the end of TSSB returns vector there was bunch of NA values while my computed one had all of them. I should have checked the end of the data frame more carefully, stupid mistake.


Where is “here is an automation framework for TSSB “? هل أفتقد شيئا؟


Hi Robot Master, great post! I was wondering if you thought about potential implication of using ATR normalized returns in your target, especially for feature selection. What I mean with that is; by normalizing with ATR you are introducing a strong recent volatility component in your target variable. And as any quant would appreciate volatility clusters heavily and therefore recent volatility measures popping-up in your best features across the board. (Maybe not only the time you redefined your target metric as profit where you only observed 2 variables.) And of course you can estimate volatility pretty decently utilizing some recent vola information but when it come to making a directional bet you won’t have much of an edge. ما رأيك؟ I just had a quick read of the post, so apologies if I am missing something. ثابر على العمل الجيد.


كريس لونغمور.


شكرا على التعليق. You raise a very good point – by normalizing the target variable to the current ATR, a strong volatility component is introduced. This was actually a recommendation that Aronson makes in the book on which the post is based, but may not be the best solution, particularly in relation to feature selection. I’ve done some recent work using the raw first difference of the time series and found that the feature selection algorithms tend towards slightly different features under this scenario.


This suggests to me that there may be merit in using a differenced time series as the target variable during the feature selection phase, and then during the model building phase normalizing the target variable to the ATR so as to ensure volatility is included at some level in the trading model.


Thanks for commenting, great suggestion!


Mike Scirocco.


Thank you for a very thorough writeup of your very interesting work. I’m looking forward to the next installment. The recommended reading list is appreciated as well. (I hope you will consider making a separate blog entry of Recommended Reading so the books are easy to find in one entry.)


كريس لونغمور.


شكرا على التعليق. Great idea regarding the recommended reading list! I will make that my next post.


Really Thanks for posting these machine learning contents!


I’m trying to follow up and apply your posting using R.


but now, I get in trouble with making data table using variables in “Some candidate features”. I can see Zorro code in second post to make selected variables.


Since I’ve never learned the Zorro, I don’t understand how you make the variables in.


“Some candidate features” .


Could you explain how did you make variables in “Some candidate features” using R?


I know this is time-consuming but I really appreciate if you explain about making variables…


كريس لونغمور.


I created those variables using Zorro and then exported them for use in R. You can reproduce them using the descriptions in the section that you are referring to, whether that be in R, C, or some other language. If you get really stuck, shoot me an email using the contact form and I’ll send you an R implementation.


I’m wondering what kind of data, lev, model(input) should be put in to operate the absretSummary function?


absretSummary <- function (data, lev = NULL, model = NULL)


Great post however…


1) cross validation.


its not allowed to use cross validation for time series as simple it introduces future leak and bias. See Rob Hydman page robjhyndman/hyndsight/crossvalidation/


2) From my experience every subset of financial data will give you different features. The method which I use to find the best features is based on bootstraping and its called Neyman – Pearson method. Different features will be selected for BUY and different for SELL side so perhaps its good to split the selection.


3) I read the paper about Boruta method. I’m using filter methods based on correlation (FCBF) and mutal information (MRMR, JMI etc). Than I bootstrap those selection by Neyman-Person method. Wrapper methods (like Boruta) take too much time to compute so you can’t bootstrap them specially if you use big and many datasets.


كريس لونغمور.


Thanks for reading my blog. Regarding your points:


1) I wouldn’t say its not allowed. But I agree regular cross-validation (k-fold, bootstrap, leave-one-out etc) is not suitable for financial data. I now use and recommend the time series cross-validation approach that is mentioned at the bottom of the link you provided. See my post on selecting optimal data windows for more information.


2) Thanks for the heads up re the Neyman-Pearson method. I haven’t used this, but I will look into it. I agree that different models for long and short sides may be a good idea.


3) I find Boruta to be quite useful for my applications. I also like the intuition behind the algorithm. Its only one of many possible feature selection algoirthms though and I’m sure your methods are great too.


Thanks again for reading.


ad 3) None of the methods is great or the best, just combining with Nyman-Person give you better chance that you will not end up not relevant at all feature after selection. But its just better chance…All this analysis of financial data is very slippery, after more than 5 years of applying ML algos to it my only conclusion is than only very extensive backtest on multiple data sets from different instruments can give the answer if something works better or not. You can just try to repeat your steps on series from different instrument or the same instrument but from different period and I guess you will get different results. (e. g. different features are relevant or different technique is better)


hello, i am tom. can you tell me how to use the function absretSummary in rfeControl and rfe? شكرا لكم. absretSummary <- function (data, lev = NULL, model = NULL)


positions 5, sign(data[, “pred”]), 0)


كريس لونغمور.


This is just a custom Summary function for use with the caret train() function. The Summary function is simply the objective function for the training process; this one trains the learning algorithm towards maximizing the profit at the end of the training period. You can easily write your own for maximizing the Sharpe ratio or any other performance metric of interest.


Max Kuhn (the author of the caret package) explains the use of the summary function here. In particular, scroll down to read about the trainControl() function and alternative performance metrics.


امل ان يساعد.


مادة كبيرة! really good research in all aspects.


is it possible to post the code showing how you make the training file (gu_data)?


كريس لونغمور.


شكرا للقراءة! I’ve added the code showing how I created the training file as an appendix. I created this code a while ago and have since added to it, so there are a bunch of other indicators and transforms that will be output to a csv file. You can pick out the ones that I’ve used in this post, or experiment with the others, as you like. The output file is called “variables. csv” and this is what I read into my training data object “gu_data” in this post.


Also, you will need to manually exclude some rows from the output file where indicator values are unable to be calculated due to an insufficient lookback period.


This code is written in Lite-C and is compatible with the Zorro platform, which is an awesome tool for doing this sort of analysis. Some exciting things you can do to extend my research by tweaking this code include:


1. Try other bar periods (I used daily)


2. If using daily bars, try sampling at a more sensible time (ie not midnight, as I have done here)


3. Obtain the same data for any market for which you have data by changing the asset() call towards the start of the script.


4. Use Zorro’s recently added pre-processing tools for better scaling/compressing/normalizing of the data than I have used here (these tools were added to the platform after I wrote this post)


5. Add other indicators or data that you are interested in.


6. Experiment with longer prediction horizons. By default, I used a one-day prediction horizon. Could predicting further into the future give better results?


7. Try using a classification approach by changing the target variable from a return (a numerical value) to a market direction (a binary value).


8. Plenty more that I haven’t even thought of…


Hope this is useful for you.


عمل عظيم! Very good tutorial for beginner like me!


A small question thought, why did you times 100 to the price change of the target?


كريس لونغمور.


No reason other than aesthetics. I just find it nicer to look at figures on the left of the decimal point. You’ll get the same results if you don’t multiply by 100.


شكرا على الرد.


Another small question bothers me while reading your post.


In “Removing highly correlated variables” step, we remained variables having correlation less than 0.5 with others. Then, why did some high correlation pairs still remain and show on the map? (f. i. velocity10 v. s. atrRat10 ; atrRat10 v. s. atrRat10_20)


Is there something possibly wrong?


كريس لونغمور.


You can answer your own question very easily by looking into the documentation of the relevant function, caret::findCorrelation() . I’ll do the leg-work for you so that we have a reference here on Robot Wealth. From the documentation:


The absolute values of pair-wise correlations are considered. If two variables have a high correlation, the function looks at the mean absolute correlation of each variable and removes the variable with the largest mean absolute correlation.


The key point is that the function considers mean absolute correlations of each variable when the pair-wise correlation between them is higher than the threshold. The function will then remove the variable that has the highest mean absolute correlation with all remaining variables. This is not the same as simply removing any variable that has a pair-wise correlation with another variable greater than the cutoff value.


امل ان يساعد.


I think the point is whenever two variables have a high correlation, one of them will be removed. The mean absolute correlations is just a way to decide which one would be cut out.


So, your correlation map shouldn’t have the pair like velocity10 to atrRat10 with large circle/high correlation. Otherwise, what’s the point for using the findCorrelation() and setting the cutoff ?


كريس لونغمور.


The point is that the pair-wise correlations reveal useful information about the data. As do the results of the findCorrelation() function. Further, if there were many variables from which to select, the function is an efficient first step in processing them. Its also interesting to see which variables the function identifies for removal in relation to their pair-wise correlations with the remaining variables.


I don’t see any basis to your statement ‘your correlation map shouldn’t have the pair like velocity10 to atrRat10 with large circle/high correlation.’ لما لا؟ Does it not reveal useful information? Have I misrepresented the pair-wise correlations? I think you might be confusing the roles of the correlation map and the findCorrelation() function by assuming they represent the same thing, or perhaps you see them as being somehow contradictory rather than complimentary. I’m struggling to see where you’re coming from here.


I don’t think I’m confused with the function and the map, but still thanks for the reply. I’ll think it through again and check my code.


Vincenzo Somma.


I’m an R beginner and trying to reproduce the results.


I don’t understand where the “gu_data_filt” variable is filled with data in the first small code block of the article.


أي مساعدة موضع تقدير.


كريس لونغمور.


Vincenzo, you found an error – nicely spotted. There was a missing line of code which has been added.


I suggest adding “highCor <- highCor+1;" before "gu_data_filt <- gu_data[, - highCor];", for your reference.


كريس لونغمور.


Can you explain that suggestion? Why do you need to increment the values in the highCor object?


It’s because we use cor(gu_data[, -1]), making highCor contained the wrong column numbers(all are 1 smaller) of removed feature. Adding 1 back so that we can get the correct result.


كريس لونغمور.


Nicely spotted! You are absolutely correct. I’ve updated the code accordingly. Note that this would alter the features which get passed through to the next feature selection stage.


Vincenzo Somma.


If you have time can you update the article with the correct resulting features ?


Just to compare my results with yours.


كريس لونغمور.


You mean the features that fall out of the correlation analysis? Or the entire post? Sure, I’ll update the figures and results, when I can find the time.


Note however that there aren’t any ‘correct’ features – a better way to approach the problem is to think in terms of which features or combination of features are most useful for the problem at hand.


Vincenzo Somma.


I mean in your reply to David pasted below, the resulting features are incorrect because of the code issue he outlined. Would be nice if you could update the article feature selection results after this fix.


Thanks for setting up a great interesting web site.


“Note that this would alter the features which get passed through to the next feature selection stage”


كريس لونغمور.


Understood. Yes, updating the post is on my radar. Might take me a week or two to find the time, but I’ll make sure it happens.


شكرا على الكلمات الرقيقة.


كريس لونغمور.


In case you are following this thread via email, I’ve updated the post following David’s observations about the correlation filter.


Glad it helped. Looking forward to the updated result. شكرا على العمل الجيد.


كريس لونغمور.


In case you are following this thread via email, I’ve updated the post following your observations about the correlation filter.


corburt erilio.


ملصق ممتاز. I am facing a couple of these problems.


Hi Kris, thanks for releasing all the R code unified (including the GBM model), it’s very helpful and adds a lot of insight to the whole experimentation process.


كريس لونغمور.


My pleasure! Glad to hear it is helpful.


Hi, thanks for the great article, but where is the link to download the scripts? In two places you say the scripts are available for download, but I can’t find any links.


كريس لونغمور.


أنت & # 8217؛ أكثر ترحيبا. There’s a link at the top of the article, under Update 4. But you have to give me your email address in return. I promise not to spam you.


Predicting a single bar is bound to be problematic because of the aliasing noise. John Ehlers often points out that if you sample the data at one bar per day then the simple fact of sampling introduces noise that is significant for signal wavelengths less than 10 bars long.


I find the use of the normalize and zscore functions to be philosophically problematic for some sorts of data. As an example, lets take a value for the trend. Obviously if this value is positive, we have an up-trend. The problem is that normalize and zscore recenter the values around their mean, so a positive value might be transformed into a negative value. I’d be interested to see any studies on whether non-shifted values give better results.


كريس لونغمور.


Its only bound to be problematic if you accept that Ehlers’ digital signal processing paradigm is applicable to financial time series. My personal opinion is that it can be, at times and under certain conditions. I’ve taken parts of Ehlers’ approach and used it in my own work, but I’d be careful of treating it as dogma. After all, many of the frequency decomposition techniques referenced in his work were intended for stationary, repeating signals, not the type of data we typically deal with. Of course they can be adapted to the markets, but a flexible and open minded approach is required.


Regarding the scaling and normalizing question: but the fact that such data, in its raw form, is of a certain sign is only applicable to our understanding and perception of what that means. A machine doesn’t care about the sign in the sense that we associate it with an ‘up’ الاتجاه. It cares about what that data point means in relation to the other variables, in particular the target. But still, experimentation is the best way to explore such questions, and it wouldn’t be difficult to come up with a way to scale your data while preserving the sign. I’d love to hear what you find out.

No comments:

Post a Comment