Monday 1 January 2018

Quantstrat - الفوركس تداول


التداول مع البولنجر باند (R) و بولينجر باند ريج سوف قوس العمل السعر. في أوقات التقلبات العالية، فإنها تتسع، بينما في أوقات التقلب المنخفض، فإنها تقترب معا. لذلك أساسا، فإنها تتكيف مع حركة وتقلبات السوق. هذا الفلتر الزائد هو القيمة الحقيقية لهذه الأداة. هناك نوعان من الشروط التي نبحث عنها في فرصة التداول. نحن نريد شراء تراجع إلى الدعم عندما يكون السوق في اتجاه صاعد أو بيع مسيرة حتى المقاومة عندما يكون السوق في اتجاه هبوطي. البولنجر باندز عادة ما تقدم مقاومة جيدة ودعم الإعداد التجاري لدينا، لذلك علينا فقط للتأكد من أننا نتابع أزواج تتجه قوية. ليترسكوس ننظر إلى مثال على هذا الرسم البياني اليومي أوسشف. كريتد بي فكسم ماركيتسكوب الرسوم البيانية 2.0 هذا الاتجاه صاعد كما نرى سلسلة من أعلى مستوياته وأعلى مستوياته المنخفضة، مما يعني البحث عن تراجع لأسفل لدعم (النطاق السفلي) للحصول على فرصة شراء. ولدي مثالان لوحظا على هذا الحدث الأول الذي عقد في أيار / مايو والثاني في حزيران / يونيه من هذا العام. وتداول السوق إلى أسفل بولينجر باند في كل من الحالات المذكورة في الصناديق. ومع ذلك، هذا ليس بالضرورة شراء نفسها ولكن بدلا من مجرد إشارة للبدء في البحث عن شراء على عكس. سوف يستخدم التجار مجموعة متنوعة من الطرق لتحديد الدخول، بدءا من استخدام المؤشر المفضل لديهم لشراء فقط مع تحرك السوق حتى من خلال ارتفاع السابقة. أحد المقاربات الشائعة هو شراء على الشمعة الأولى التي تغلق فوق المتوسط ​​المتحرك لمدة 20 يوما المتوسط ​​المتحرك البسيط. وهذا بمثابة مزيد من التأكيد على انعكاس ويزيد فرصتنا للنجاح في التجارة. (على الرسم البياني أعلاه، يتم تحديد كاندليردكو لدوبوي من قبل السهم الأخضر.) يمكن للمتداولين ثم وضع وقف وقائي تحت أدنى الفتيل في المربع والبحث عن ضعف هذا الخطر في الربح لمخاطر 1: 2: نسبة المكافأة. أود أن أشير إلى أن حركة السعر على الدولار مقابل الفرنك السويسري هبطت وتطرقت إلى بولينجر باند السفلي أربع مرات خلال الأيام القليلة الماضية. وهذا يعني أننا يجب أن يكون على اطلاع على فرصة شراء أخرى. ولكن بدلا من مجرد شراء الآن، وهذا هو الوقت المناسب لاستخدام النهج الخاص بك لتحديد أن دخول شراء لزيادة فرصتك للنجاح في التجارة. وارتفع السعر منذ أن تم اختبار النطاق السفلي الأسبوع الماضي. من خلال ممارسة الصبر والانضباط وانتظار إغلاق أول فوق المتوسط ​​المتحرك البسيط لمدة 20 يوما سيكون وسيلة لدخول هذه التجارة باستخدام استراتيجية بولينجر باند التي تعلمتها للتو. جديد في سوق الفوركس توفير ساعات في معرفة ما تداول الفوركس هو كل شيء. خذ هذا مجانا لدكوانو 20 دقيقة لدورة فكسردكو التي تقدمها ديليفكس التعليم. في هذه الدورة، سوف تتعلم عن أساسيات الصفقة الفوركس، ما هي الرافعة المالية، وكيفية تحديد كمية مناسبة من الرافعة المالية للتداول الخاص بك. ريجيست r هنا لبدء تداول فوريكس الخاص بك الآن ديليفكس يوفر الفوركس الأخبار والتحليل الفني على الاتجاهات التي تؤثر على أسواق العملات العالمية. أصناف المحفوظات: تجارة هذا المنصب سيكون حول محاولة استخدام حزمة ديبيكس للتنبؤ الدولة على الانترنت. في حين أن حزمة ديبيكس يؤدي بشكل مثير للإعجاب عندما يتعلق الأمر وصف ولايات الماضي، عندما تستخدم للتنبؤ خطوة واحدة إلى الأمام، تحت افتراض أن غدا 8217s الدولة سوف تكون متطابقة اليوم 8217s، عملية نموذج ماركوف خفية وجدت داخل الحزمة لا أداء للتوقعات. لذلك، لتبدأ، وكان هذا المنصب بدافع من مايكل هالز مور، الذي نشر مؤخرا بعض رمز R حول استخدام مكتبة depmixS4 لاستخدام نماذج ماركوف خفية. عموما، أنا غضب لخلق المشاركات على المواضيع I don8217t أشعر أن لدي على الاطلاق فهم من الأمام إلى الخلف، ولكن I8217m القيام بذلك على أمل التعلم من الآخرين على كيفية القيام على نحو مناسب التنبؤ على الانترنت الدولة الفضاء، أو 8220 تبديل الوقت 8221 الكشف، كما يمكن أن يطلق عليه في لغة أكثر المالي. في حين رأى I8217ve النظرية المعتادة لنماذج ماركوف المخفية (وهذا هو، يمكن أن المطر أو يمكن أن يكون مشمس، ولكن يمكنك استنتاج فقط من الحكم على الطقس من قبل الملابس ترى الناس يرتدي خارج نافذتك عندما تستيقظ)، وعملت مع أمثلة لعبة في موكس (Udacity8217s ذاتية القيادة بالطبع سيارة يتعامل معهم، وإذا كنت أذكر بشكل صحيح 8211or ربما كان بالطبع أي)، في نهاية اليوم، والنظرية ليست سوى جيدة مثل مدى حسن التنفيذ يمكن أن تعمل على البيانات الحقيقية . لهذه التجربة، قررت أن تأخذ البيانات سبي منذ التأسيس، والقيام الكامل في عينة 8220 باكتيست 8221 على البيانات. وهذا يعني أنه بالنظر إلى أن خوارزمية هم من ديبميكس ترى التاريخ الكامل للعودة، مع هذا 8220god8217s العين 8221 عرض البيانات، هل الخوارزمية تصنيف صحيح الأنظمة، إذا كانت النتائج باكتست هي أي مؤشر هنا 8217s رمز للقيام بذلك، مستوحاة من هالز-مور 8217s. في الأساس، في حين قمت بتحديد ثلاث ولايات، لاحظت أن أي شيء مع اعتراض فوق الصفر هو دولة الثور، وتحت الصفر هو حالة الدب، وذلك أساسا، فإنه يقلل من حالتين. مع النتيجة: لذلك، لا رهيبة بشكل خاص. الخوارزمية تعمل، نوع من، نوع من، حسنا حسنا، let8217s محاولة التنبؤ على الانترنت الآن. حتى ما فعلت هنا كان أخذت نافذة توسيع، بدءا من 500 يوما منذ بدء SPY8217s، وأبقى زيادة ذلك، من يوم واحد في وقت واحد. توقعي كان، بما فيه الكفاية بما فيه الكفاية، في اليوم الأخير، وذلك باستخدام 1 لدولة الثور، و -1 لدولة الدب. ركضت هذه العملية بالتوازي (على كتلة لينكس، لأن مكتبة Windows8217s دو باراليل يبدو أنها لا تعرف حتى أن يتم تحميل حزم معينة، و it8217s أكثر فوضوي)، وأول قضية كبيرة هي أن هذه العملية استغرق حوالي ثلاث ساعات على سبعة النوى ل حوالي 23 عاما من البيانات. ليس مشجعا تماما، ولكن الحوسبة الوقت isn8217t مكلفة هذه الأيام. لذلك نرى LE8217s إذا كانت هذه العملية تعمل فعلا. أولا، دعونا اختبار 8217s إذا خوارزمية يفعل ما فعله 8217s في الواقع من المفترض القيام به واستخدام يوم واحد من نظرة التحيز إلى الأمام (وهذا هو، خوارزمية تقول لنا الدولة في نهاية اليوم 8211 كيف هو الصحيح حتى ذلك اليوم). ونتيجة لذلك: لذلك، يزعم، يبدو أن الخوارزمية تفعل ما كان مصمم للقيام به، وهو لتصنيف دولة لمجموعة بيانات معينة. الآن، السؤال الأكثر صلة بالموضوع: مدى نجاح هذه التنبؤات حتى قبل يوم واحد You8217d أعتقد أن التنبؤات الفضائية الدولة ستكون شاذة من يوم لآخر، نظرا للتاريخ الطويل، الصحيح مع النتيجة: وهذا هو، من دون التحيز ليبكهيد، خوارزمية التنبؤ الفضاء الدولة هو فظيعة. لماذا هذا حسنا، هنا 8217s مؤامرة الدول: باختصار، خوارزمية هم على الانترنت في حزمة ديبيكس يبدو أن تغيير عقلها بسهولة جدا، مع آثار واضحة (سلبية) لاستراتيجيات التداول الفعلي. لذلك، أن يلفها لهذا المنصب. في الأساس، فإن الرسالة الرئيسية هنا هي: هناك 8217s فرقا كبيرا بين التحميل القيام التحليل الوصفي (أكا 8220 أين كنت، لماذا فعلت الأشياء 8221) مقابل التحليل التنبئي (وهذا هو، 8220if أنا التنبؤ بشكل صحيح في المستقبل، وأنا الحصول على مكافأة إيجابية 8221 ). في رأيي، في حين أن الإحصاءات الوصفية لها الغرض من حيث شرح لماذا الاستراتيجية قد أدرت كيف فعلت، في نهاية المطاف، we8217re تبحث دائما عن أدوات التنبؤ أفضل. في هذه الحالة، ديبيكس، على الأقل في هذا 8220out-ذي-بوكس 8221 مظاهرة لا يبدو أن يكون أداة لذلك. إذا كان أي شخص قد نجح مع استخدام ديبيكس (أو غيرها من خوارزمية تبديل النظام في R) للتنبؤ، وأود أن أرى أن العمل الذي تفاصيل الإجراء المتخذة، كما it8217s منطقة I8217m تبحث لتوسيع بلدي أدوات في، ولكن don8217t لديها أي خاص يؤدي جيدة. أساسا، I8217d أحب أن أفكر في هذا المنصب كما وصف لي تجارب بلدي مع الحزمة. شكرا للقراءة. ملاحظة: في 5 أكتوبر، وسوف أكون في مدينة نيويورك. في 6 أكتوبر، وسوف أقدم في المعرض التجاري على لوحة حروب البرمجة. ملاحظة: عقد تحليلات الحالي هو للمراجعة في نهاية العام، لذلك أنا أبحث رسميا عن عروض أخرى كذلك. إذا كان لديك دور بدوام كامل والتي قد تستفيد من المهارات التي تراها على بلدي بلوق، يرجى الحصول على اتصال معي. يمكن العثور على الملف الشخصي لينكدين هنا. هذا المنصب سوف تظهر كيفية أن تأخذ في الاعتبار دوران عند التعامل مع البيانات المستندة إلى العائدات باستخدام بيرفورمانساناليتيكش وظيفة العائد. حافظة في R. وسوف تثبت هذا على استراتيجية أساسية على سبدرس القطاع تسعة. لذلك، أولا، وهذا هو ردا على سؤال طرحه روبرت الأجور على القائمة البريدية R-سيغ المالية. في حين أن هناك العديد من الأفراد هناك مع مجموعة كبيرة من الأسئلة (وكثير منها يمكن العثور على أن تظهر على هذه بلوق بالفعل)، وأحيانا، سيكون هناك المخضرم الصناعة، طالب إحصاءات الدكتوراه من ستانفورد، أو فرد ذكي جدا أن سوف تسأل سؤالا حول الموضوع الذي أنا haven8217t بعد لمست على هذه بلوق، الأمر الذي سيدفع وظيفة لإثبات الجانب التقني آخر وجدت في R. هذا هو واحد من تلك الأوقات. لذلك، سوف تكون هذه المظاهرة حول حوسبة دوران في مساحة العوائد باستخدام حزمة بيرفورمانساناليتيكش. ببساطة، خارج حزمة بورتفولياناليتيكش، بيرفورمانساناليتيكش مع وظيفة عودة. Portfolio هي الذهاب إلى R حزمة لمحاكاة إدارة المحافظ، لأنها يمكن أن تأخذ مجموعة من الأوزان، ومجموعة من العوائد، وتوليد مجموعة من عوائد محفظة للتحليل مع بقية وظائف الأداءAnalytics8217s. ومرة أخرى، فإن الاستراتيجية هي ما يلي: أخذ 9 سبدرس القطاع من ثلاثة أحرف (لأن هناك إتفس أربعة أحرف الآن)، وفي نهاية كل شهر، إذا كان السعر المعدل فوق المتوسط ​​المتحرك 200 يوم، والاستثمار فيها . تطبيع في جميع القطاعات المستثمرة (أي 19 إذا استثمرت في كل 9، 100 في 1 إذا استثمرت 1 فقط في، 100 النقدية، يدل على ناقلات العودة صفر، إذا لم يتم استثمار أي قطاعات في). It8217s بسيطة، لعبة استراتيجية، كما isn8217t استراتيجية نقطة المظاهرة. here8217s التعليمات البرمجية الإعداد الأساسية: لذلك، والحصول على سبدرس، ووضعها معا، حساب عوائدها، وتوليد إشارة، وخلق ناقلات الصفر، منذ العائد. محفظة يعامل الأوزان أقل من 1 كسحب، والأوزان أعلاه 1 كما إضافة من المزيد من رأس المال (كبيرة لمعلوماتك هنا). الآن، هنا 8217s كيفية حساب دوران: لذلك، خدعة هو هذا: عند استدعاء Return. portfolio، استخدم الخيار ترو مطول. هذا يخلق العديد من الكائنات، من بينها العودة، بوب. الوزن، و يوب. الوزن. هذه الوقوف لبداية الفترة الوزن، ونهاية الفترة الوزن. والطريقة التي يتم بها حساب دوران هو ببساطة الفرق بين كيفية العودة اليوم 8217s يتحرك المحفظة المخصصة من نقطة النهاية السابقة إلى حيث أن محفظة تقف فعلا في بداية الفترة المقبلة. وهذا هو، نهاية فترة الوزن هو بداية الانجراف الفترة بعد الأخذ بعين الاعتبار day8217s دريفترتورن لهذا الأصل. بداية جديدة من وزن الفترة هو نهاية فترة الوزن بالإضافة إلى أي المعاملات التي كان يمكن القيام به. وهكذا، من أجل العثور على المعاملات الفعلية (أو دوران)، واحد يطرح نهاية السابقة من وزن الفترة من بداية وزن الفترة. هذا هو ما تبدو عليه هذه المعاملات لهذه الاستراتيجية. شيء يمكننا القيام به مع هذه البيانات هو اتخاذ دوران سنة واحدة المتداول، إنجازها مع التعليمات البرمجية التالية: يبدو هذا: وهذا يعني أساسا أن قيمة سنة واحدة 8217s من اتجاهين دوران (وهذا هو، إذا بيع محفظة استثمرت تماما هو 100 دوران، وشراء مجموعة جديدة تماما من الأصول هو 100 آخر، ثم اتجاهين دوران هو 200) حوالي 800 في الحد الأقصى. قد تكون عالية جدا بالنسبة لبعض الناس. الآن، هنا 8217s التطبيق عند معاقبة تكاليف المعاملات في 20 نقطة أساس لكل نقطة مئوية المتداولة (وهذا هو، يكلف 20 سنتا لمعاملة 100). لذلك، في 20 نقطة أساس على تكاليف المعاملات، التي تأخذ حوالي واحد في المئة في العائدات سنويا من هذه (اعترف، رهيب) استراتيجية. هذا أبعد ما يكون عن ال تذكر. لذلك، هذا هو كيف كنت في الواقع حساب دوران وتكاليف المعاملات. في هذه الحالة، كان نموذج تكلفة المعاملة بسيط جدا. ومع ذلك، وبالنظر إلى أن العائد. المحفظة يعود المعاملات على مستوى الأصول الفردية، يمكن للمرء أن الحصول على معقدة كما يودون مع النمذجة تكاليف المعاملات. شكرا للقراءة. ملاحظة: سأكون إعطاء الحديث البرق في التمويل، وذلك لأولئك الذين يحضرون، you8217ll تكون قادرة على العثور لي هناك. هذا المنصب سوف يحدد خطأ سهلة لجعل الكتابة فيكتوريزد backtests8211 ناملي في استخدام إشارة تم الحصول عليها في نهاية فترة لدخول (أو الخروج) موقف في نفس الفترة. الفرق في النتائج واحد يحصل ضخمة. اليوم، رأيت وظيفتين منفصلتين من ألفا أرتشيتكت ومايك هاريس على حد سواء إشارة إلى ورقة من قبل فاليري زاكامولين على حقيقة أن بعض البحوث السابقة الاتجاه من قبل غلابادانيديس تم القيام به مع نتائج غير المطابقة للمواصفات، وأن النتائج Glabadanidis8217s كانت استنساخه فقط من خلال تأسيس انحياز لوكاهيد. توضح التعليمات البرمجية التالية كيفية إعادة إنتاج هذا التحيز ليباهيد. أولا، سيوفر إعداد استراتيجية متوسط ​​متحرك أساسي على مؤشر سامب 500 من البيانات السابقة ل ياهو. وهنا هو كيفية إنشاء التحيز لوكهيد. هذه هي 8220results8221: بالطبع، هذا منحنى الأسهم لا فائدة، لذلك هنا 8217s واحدة في مقياس السجل. كما يمكن أن يرى، انحياز لوكاهيد يجعل فرقا كبيرا. وفيما يلي النتائج العددية: مرة أخرى، مثير للسخرية على الاطلاق. لاحظ أنه عند استخدام Return. Portfolio (الدالة في بيرفورمانساناليتيكش)، فإن هذه الحزمة سوف تعطيك تلقائيا الفترة التالية 8217s العودة، بدلا من الحالي واحد، للأوزان الخاصة بك. ومع ذلك، بالنسبة لأولئك الذين يكتبون 8220simple8221 باكتيستس التي يمكن القيام به بسرعة باستخدام عمليات متجه، خطأ واحد تلو الآخر يمكن أن تجعل كل الفرق بين باكتست في مجال معقول، ونقية هراء. ومع ذلك، ينبغي للمرء أن ترغب في اختبار هراء قال عندما تواجه نتائج المستحيل لتكرارها، والميكانيكا أظهرت أعلاه هي وسيلة للقيام بذلك. الآن، على أخبار أخرى: I8217d أود أن أشكر جيرالد M للبقاء على رأس واحد من استراتيجيات الاستثمار المنطقي 8211 ناميا، بسيطة استراتيجية دوران السوق العالمية المبينة في مقال من آخر بلوق وظيفة. وحتى شهر آذار (مارس) 2018 (تاريخ مشاركة المدونة)، كانت الاستراتيجية قد أدت أداء جيدا. ومع ذلك، بعد التاريخ المذكور لقد كانت كارثة كاملة، والتي، في وقت متأخر، كان واضحا عندما مررت من خلال عملية إطار التنمية التي يحركها الفرضية التي كتبت عنها في وقت سابق. لذلك، في حين كان هناك الكثير من المكتوبة حول ليس مجرد رمي استراتيجية بسبب القصور في الأداء على المدى القصير، وأن الشذوذ مثل الزخم والقيمة موجودة بسبب المخاطر المهنية بسبب ضعف الأداء على المدى القصير، فإنه 8217s أبدا شيء جيد عندما تخلق استراتيجية خسائر كبيرة تاريخيا، وخاصة بعد نشرها في هذه الزاوية المتواضعة من العالم المالي الكمي. في أي حال، كان هذا وظيفة تظهر بعض الميكانيكا، وتحديثا عن استراتيجية أنا المدونات حول منذ وقت ليس ببعيد. شكرا للقراءة. ملاحظة: أنا دائما مهتمة في سماع عن الفرص الجديدة التي قد تستفيد من خبرتي، وأنا دائما سعداء للتواصل. يمكنك العثور على ملف ينكدين الخاص بي هنا. سنة جديدة سعيدة. وستكون هذه المشاركة سريعة تغطي العلاقة بين المتوسط ​​المتحرك البسيط والزخم الزمني. والنتيجة المترتبة على ذلك هي أنه يمكن للمرء أن يستمد مؤشرات الزخم لسلسلة زمنية أفضل من المؤشرات الكلاسيكية المطبقة في العديد من الأوراق. حسنا، وبالتالي فإن الفكرة الرئيسية لهذا المنصب هو بسيط جدا: I8217m متأكد we8217re كل دراية الزخم الكلاسيكي. وهذا هو، السعر الآن مقارنة بالسعر ولكن منذ فترة طويلة (3 أشهر، 10 شهرا، 12 شهرا، وما إلى ذلك). E. G. P (الآن) 8211 P (10) و I8217m متأكد من الجميع على دراية مؤشر مؤشر متحرك بسيط، كذلك. E. G. SMA (10). حسنا، كما اتضح، هذه الكميات اثنين ترتبط في الواقع. وتبين أنه، بدلا من التعبير عن الزخم كالفرق بين رقمين، يتم التعبير عنه على أنه مجموع العائدات، ويمكن كتابته (لمدة 10 شهر الزخم) على النحو التالي: MOM10 عودة هذا الشهر عودة الشهر الماضي عودة 2 قبل أشهر 8230 عودة من 9 أشهر، أي ما مجموعه 10 شهرا في مثالنا الصغير. يمكن كتابة ذلك على أنه MM10 (P (0) 8211 P (1)) (P (1) 8211 P (2)) 8230 (P (9) 8211 P (10)). (كل فرق بين الأقواس يدل على قيمة شهر واحد بقيمة 8217 ثانية). ويمكن بعد ذلك إعادة كتابة الحساب الحسابي كما يلي: P (0) P (1) 8230 P (9)) 8211 (P (1) P (2) 8230 P (10)). وبعبارة أخرى، الزخم 8212 ويعرف أيضا باسم الفرق بين اثنين من الأسعار، ويمكن إعادة كتابة والفرق بين اثنين من المبالغ التراكمية من الأسعار. وما هو المتوسط ​​المتحرك البسيط ببساطة مجموع تراكمي من الأسعار مقسوما على ولكن العديد من الأسعار لخص أكثر. Here8217s بعض رمز R للتدليل. مع عدد من المرات الناتجة هذه الإشارات اثنين متساوية: باختصار، في كل مرة. الآن، ما هو بالضبط بونكلين من هذا المثال قليلا Here8217s بونكلين: المتوسط ​​المتحرك بسيط هو 8230fairly التبسيط بقدر المرشحات تذهب. وهو يعمل كمثال تربوي، ولكن لديه بعض نقاط الضعف المعروفة بشأن تأخر، والآثار النافذة، وهلم جرا. هنا 8217s مثال لعبة كيف يمكن للمرء الحصول على إشارة الزخم مختلفة عن طريق تغيير فلتر. مع النتائج التالية: في حين أن الفرق من EMA10 استراتيجية didn8217t تفعل أفضل من الفرق SMA10 (ويعرف أيضا باسم الزخم القياسي 10 شهرا)، أن 8217s ليست هذه النقطة. والنقطة هي أن إشارة الزخم مستمدة من مرشاح متوسط ​​متحرك بسيط، وأنه باستعمال مرشح مختلف، لا يزال باستطاعة المرء استخدام نوع من الزخم للاستراتيجية. أو، بشكل مختلف، فإن الوجبات الجاهزة مينينغرال هنا هي أن الزخم هو منحدر مرشح، ويمكن للمرء أن يحسب الزخم في عدد لا حصر له من الطرق اعتمادا على مرشح المستخدمة، ويمكن أن تأتي مع عدد لا يحصى من استراتيجيات الزخم المختلفة. شكرا للقراءة. ملاحظة: أنا حاليا التعاقد في شيكاغو، وأنا دائما مفتوحة على الشبكات. اتصل بي في البريد الإلكتروني في ilya. kipnisgmail أو تجد لي على لينكيدين هنا. هذه الوظيفة سوف تحدد أول محاولة فاشلة في تطبيق منهجية مرشح مجموعة لمحاولة الخروج مع عملية الترجيح على سبي الذي ينبغي نظريا أن تكون عملية تدريجية للتحول من القناعة بين السوق الثور، وسوق الدب، وفي أي مكان بينهما. هذه رسالة متابعة إلى مشاركة المدونة هذه. لذلك، فكرتي ذهبت مثل هذا: في سوق الثور، كما يتحول واحد من الاستجابة لنعومة، والمرشحات استجابة يجب أن تكون أعلى من المرشحات على نحو سلس، والعكس بالعكس، كما أن هناك 8217s عموما المفاضلة بين الاثنين. في الواقع، في صياغتي الخاصة، فإن كمية الجذر التربيعي لل إما من عوائد التربيع يعاقب أي انحراف عن خط مسطح تماما (على الرغم من مستوحاة من قياس بازل 8217s من التقلبات، وهو الجذر التربيعي ل إما 18 يوما من مربع العوائد)، في حين أن كمية الاستجابة يعاقب أي انحراف عن السلاسل الزمنية من الأسعار المحققة. ما إذا كانت هذه هي أفضل التدابير اثنين من نعومة والاستجابة هو موضوع I8217d نقدر بالتأكيد ردود الفعل على. على أية حال، كانت الفكرة التي كان لدي على رأس رأسي هي أنه بالإضافة إلى وجود طريقة لوزن المرشحات المتعددة من خلال استجابتها (الانحراف عن حركة السعر) والنعومة (الانحراف عن خط مستو)، من خلال أخذ المبالغ من علامة الفرق بين مرشح واحد وجاره على الاستجابة لسلاسة الطيف، وفرت ما يكفي من المرشحات الفرقة (مثلا، 101، لذلك هناك 100 الاختلافات)، واحد يمكن الحصول على وسيلة للانتقال من القناعة الكاملة للسوق الثور، إلى سوق الدب، إلى أي شيء بينهما، ويكون هذا عملية سلسة أن don8217t لديها تقلبات الفصام من القناعة. هنا 8217s رمز للقيام بذلك على سبي من البداية إلى 2003: وهنا 8217s نتيجة ساحقة جدا: في الأساس، بينما كنت أتوقع أن نرى تغييرات في الإدانة ربما 20 على الأكثر، بدلا من ذلك، بلدي مؤشر مجموع الاختلافات علامة فعلت تماما كما كان كان يأمل في أن يكون 8217t، وهو أن يكون نوع ثنائي جدا من ميكانيكي. كان حدسي هو أنه بين سوق الثور 8220bvious8221 وسوق 8220bvious الدب 8221 أن بعض الاختلافات ستكون إيجابية، وبعض سلبية، وأنهم 8217d صافي بعضها البعض خارج، والإدانة ستكون صفرا. وعلاوة على ذلك، في حين أن أي كروس الفردي هو ثنائي، فإن جميع مائة علامات إما إيجابية أو سلبية ستكون عملية أكثر تدريجية. على ما يبدو، لم يكن هذا هو الحال. لمواصلة هذا القطار من التفكير في وقت لاحق، شيء واحد في محاولة سيكون كل أزواج علامة الفرق. بالتأكيد، أنا don8217t يشعر مثل التخلي عن هذه الفكرة في هذه المرحلة، وكما جرت العادة، ردود الفعل سيكون موضع تقدير دائما. شكرا للقراءة. ملاحظة: أنا حاليا التشاور في قدرة تحليلات في وسط مدينة شيكاغو. ومع ذلك، أنا أيضا أبحث عن المتعاونين الذين يرغبون في متابعة الأفكار التجارية مثيرة للاهتمام. إذا كنت تشعر مهاراتي قد تكون مفيدة لك، let8217s الحديث. يمكنك البريد الالكتروني لي في ilya. kipnisgmail، أو تجد لي على لينكيدين هنا. هذا الاستعراض سيكون حول نظام إينوفانس Tech8217s ترايد. ذلك هو تطبيق موجهة نحو السماح للمستثمرين التجزئة تطبيق الملكية خوارزميات التعلم الآلي لمساعدتهم في خلق استراتيجيات التداول المنهجي. حاليا، بلدي استعراض سطر واحد هو أنه في حين آمل أن مؤسسي الشركة يعني جيدا، وتطبيق لا يزال في مرحلة مبكرة، وهكذا، يجب أن يتم التحقق من قبل الرأسماليين المستخدمين المحتملين كشيء مع دليل على إمكانات، بدلا من المنتج النهائي جاهزة للسوق الشامل. في حين أن هذا بمثابة استعراض، it8217s أيضا أفكاري حول كيفية إينوفانس تك يمكن تحسين منتجاتها. قليلا من الخلفية: لقد تحدثت عدة مرات لبعض مؤسسي الشركة 8217s، الذين يبدو وكأنه الأفراد في حوالي مستوى عمري (لذلك، زملائه الألفية). في نهاية المطاف، ونقطة بيع هو هذا: التداول المنهجي هو بارد. تعلم الآلة هو بارد. لذلك، تطبيق التعلم الآلي على التداول المنهجي هو رائع (و طريقة مؤكدة لتحقيق الأرباح، كما أظهرت النهضة تكنولوجيز.) في حين أن هذا قد يبدو قليلا سناركي، it8217s أيضا، في بعض النواحي، صحيح. أصبح التعلم الآلي الحديث عن المدينة، من IBM8217s واتسون (رينتيك نفسها استأجرت مجموعة من خبراء التعرف على الكلام من عب بضعة عقود إلى الوراء)، لستانفورد 8217s سيارة ذاتية القيادة (اخترعها سيباستيان ثرون، الذي يرأس الآن أوداسيتي)، إلى جائزة نيتفليكس، إلى الله يعرف ما يفعل أندرو نغ مع التعلم العميق في بايدو. النظر في كيفية تعلم الآلة جيدا قد فعلت في مهام أكثر تعقيدا بكثير من 8220 إنشاء نصف لائق لائق خوارزمية التداول المنظم 8221، فإنه ينبغي أن يكون 8217t الكثير من أن نسأل هذا الحقل القوي عند تقاطع علوم الكمبيوتر والإحصاءات لمساعدة المستثمر التجزئة لصقها لمشاهدة الرسوم البيانية توليد الكثير من العائدات على استثماراته أو أكثر من خلال تقدير الرسم البياني التقديري والضوضاء التداول. إلى فهماتي من المحادثات مع مؤسسي إينوفانس Tech8217s، وهذا هو صراحة مهمتهم. ومع ذلك، أنا لست متأكدا من أن Inovance8217s تطبيق تريد فعلا ينجز هذه المهمة في حالتها الحالية. Here8217s كيف يعمل: المستخدمين اختيار الأصول واحد في وقت واحد، وحدد نطاق التاريخ (البيانات تعود إلى 31 ديسمبر 2009). تقتصر الأصول حاليا على أزواج العملات عالية السيولة، ويمكن أن تتخذ الإعدادات التالية: ساعة واحدة أو ساعتين أو 4 ساعات أو 6 ساعات أو أيام زمنية يومية. ثم يقوم المستخدمون باختيار مجموعة متنوعة من المؤشرات، بدءا من المتوسطات الفنية (المتوسطات المتحركة، ومؤشرات التذبذب، وحسابات الحجم، وما إلى ذلك. في الغالب مجموعة متنوعة من مؤشرات القرن العشرين، على الرغم من أن المتوسط ​​المتحرك التكيفي العرضي قد تمكن من التسلل في 8211 ناميلي KAMA8211 انظر حزمة ديسترادينغ الخاصة بي و MAMA8211aka ميسا المتوسط ​​المتحرك التكيفي، من جون إهلرز) إلى أكثر منها مقصور على فئة معينة مثل بعض مؤشرات المشاعر. هنا 8217s حيث تبدأ الأمور في التوجه جنوبا بالنسبة لي، ولكن. أي أنه في حين أنه من السهل إضافة 8217s العديد من المؤشرات كما يود المستخدم، لا يوجد أساسا أي وثائق على أي منهم، مع عدم وجود وصلات إلى مرجع، وما إلى ذلك حتى المستخدمين سوف تضطر إلى تحمل عبء فهم فعلا ما كل ومن المؤشرات التي يختارونها بالفعل، وما إذا كانت هذه المؤشرات مفيدة أم لا. ويجعل تطبيق ترايد جهدا صغيرا حتى الآن لإطلاع المستخدمين على الغرض من هذه المؤشرات، وما هو هدفهم النظري (قياس الإدانة في اتجاه، والكشف عن اتجاه، ومؤشر نوع المذبذب، وما إلى ذلك). وعلاوة على ذلك، فيما يتعلق بتحديدات المؤشرات ، يحدد المستخدمون أيضا إعداد معلمة واحدة لكل مؤشر لكل إستراتيجية. E. G. إذا كان لدي عبور إما، I8217d لديها لوضع استراتيجية جديدة ل كروس أوفر 20180، كروس أوفر 21100، بدلا من تحديد شيء من هذا القبيل: قصيرة إما: 20-60 طويلة إما: 80-200 كوانتسترات نفسها لديها هذه الوظيفة، وبينما I don8217t أذكر تغطي المعلمة متانة تشيكوبتيميزاتيون (وبعبارة أخرى، واختبار مجموعات المعلمة متعددة 8211whether واحد يستخدم لهم لتحسين أو متانة هو ما يصل الى المستخدم، وليس وظيفة) في كوانسترات على هذه بلوق على وجه التحديد، وهذه المعلومات موجودة كثيرا في ما أرى 8220the كوانسترات دليل الرسمية 8221، وجدت هنا. في رأيي، خيار تغطية مجموعة من القيم هو إلزامي وذلك لإثبات أن أي إعداد المعلمة معين ليس حظ عشوائي. خارج كوانسترات، لقد أثبتت هذه المنهجية في بلدي الفرضيات التنمية مدفوعة التنمية، وفي الخروج لاختيار المعلمة للتداول التقلب. حيث أن ترايد قد تفعل شيئا مثيرا للاهتمام، ومع ذلك، هو أنه بعد يحدد المستخدم مؤشراته ومعلماته، 8220 خوارزميات التعلم الآلي آلة 8221 (تحذير: مربع أسود تماما) تحديد ما مجموعة من القيم من المؤشرات المعنية ولدت أفضل النتائج ضمن باكتست ، وتعيين لهم درجات الصعود والهبوط. وبعبارة أخرى، 8220 تبحث إلى الوراء، كانت هذه قيم المؤشر التي حققت أفضل على مدار العينة 8221. في حين أن هناك قيمة محددة لاستكشاف العلاقات بين المؤشرات والعائدات المستقبلية، وأعتقد أن تريد تحتاج إلى بذل المزيد من الجهد في هذا المجال، مثل الإبلاغ P - القيم، والإدانة، وهلم جرا. على سبيل المثال، إذا قمت بجمع مؤشرات كافية، فإن 8220rule8221 هو أمر السوق الذي 8217s ببساطة تقاطع جميع نطاقات المؤشرات الخاصة بك. على سبيل المثال، قد تخبر شركة ترايد المستخدم بأن أقوى إشارة صاعدة عندما يكون الفرق بين المتوسطات المتحركة بين 1 و 2، فإن أدكس يتراوح بين 20 و 25، و أتر ما بين 0.5 و 1، وهكذا. كل إعداد يحدد المستخدم يضييق مزيد من عدد الصفقات التي يجعل المحاكاة. في رأيي، هناك المزيد من الطرق لاستكشاف التفاعل بين المؤشرات من مجرد بيان عملاق واحد، مثل بيان 8220OR8221، من نوع ما. (E. G. حدد جميع القيم، وضعت على التجارة عندما 3 من أصل 5 مؤشرات تقع في النطاق الصعودي المحدد من أجل وضع المزيد من الصفقات). في حين أنه قد يكون من الحكمة تصفية الصفقات إلى حالات نادرة جدا إذا تداول كمية هائلة من الأدوات، مثل عدة آلاف من الأدوات الممكنة، يتم تداول عدة فقط في أي وقت معين، مع ترايد، مستخدم يختار فئة واحدة فقط من الأصول (حاليا ، زوج عملة واحدة) في وقت واحد، لذلك I8217m على أمل أن نرى ترايد خلق المزيد من الوظائف من حيث ما يشكل قاعدة التداول. بعد أن يختار المستخدم كل من قاعدة طويلة وقصيرة (ببساطة عن طريق تصفية على نطاقات مؤشر أن خوارزميات تعلم الجهاز TRAIDE8217s قد قال جيدة)، تريد يتحول ذلك إلى باكتست مع منحنى الأسهم طويلة، منحنى الأسهم قصيرة، إجمالي منحنى الأسهم، و إحصاءات التجارة للتداولات الإجمالية والطويلة والقصيرة. على سبيل المثال، في الكميات، واحد فقط يتلقى إحصاءات التجارة الإجمالية. سواء كانت طويلة أو قصيرة، كل ما يهم إلى كوانسترات هو ما إذا كانت التجارة أو جعلت المال المفقود. للمستخدمين المتطورة، it8217s تافهة بما فيه الكفاية لتحويل مجموعة واحدة من قواعد أو إيقاف تشغيله، ولكن ترايد يفعل أكثر لعقد يد المستخدم 8217s في هذا الصدد. وأخيرا، تريد ثم يولد رمز MetaTrader4 للمستخدم لتحميل. و أن 8217s العملية. في رأيي، في حين أن ما إينوفانس تك وضعت للقيام مع ترايد مثيرة للاهتمام، وأنا willn8217t يوصي بها في حالتها الحالية. بالنسبة إلى الأفراد المتطورين الذين يعرفون كيف يمرون بعملية بحث مناسبة، فإن تريد صارم جدا من حيث إعدادات المعلمات (واحدة في كل مرة)، ومؤشرات مسبقة الترميز (يمكن أن يكون الجمهور المستهدف جيدا البرنامج 8217t جيدا جدا)، وفئات الأصول (مرة أخرى ، بالدور). ومع ذلك، بالنسبة للمستثمرين الأفراد، مشكلتي مع ترايد هو: هناك مجموعة كاملة من المؤشرات غير الموثقة، والتي تنتقل بعد ذلك إلى خوارزميات التعلم آلة مربع أسود. والنتيجة هي أن المستخدم لديه فهم ضئيل جدا لما تفعله الخوارزميات الأساسية في الواقع، ولماذا المنطق الذي هو أو هي قدمت مع الإخراج. في حين أن ترايد يجعل من السهل على الإطلاق توليد أي نظام تداول معين، كما ذكر العديد من الأفراد بطرق مختلفة قليلا قبل، كتابة استراتيجية هو الجزء السهل. إن القيام بالعمل لفهم ما إذا كانت هذه الاستراتيجية لها بالفعل ميزة أصعب بكثير. بالتحديد، التحقق من متانة، وقوتها التنبؤية، وحساسيتها لمختلف الأنظمة، وهلم جرا. وبالنظر إلى تاريخ بيانات TRAIDE8217 بدلا من ذلك القصير (2018 فصاعدا)، والاقتران مع أوباكينيس أن يعمل المستخدم تحت، فإن تشبيه بلدي سيكون هذا: It8217s مثل إعطاء سائق عديم الخبرة مفاتيح لسيارة رياضية في الضباب الكثيف على طريق متعرج. لا أحد ينازع أن سيارة رياضية رهيبة. ومع ذلك، فإن العبء الحقيقي للعمل يكمن في التأكد من أن المستخدم doesn8217t يختتم تحطيم في شجرة. عموما، أنا أحب مهمة تريد التطبيق 8217s، وأعتقد أنه قد يكون من المحتمل أن يكون شيئا للمستثمرين التجزئة التي don8217t تنوي تعلم من الداخل والخارج من ترميز نظام التداول في R (على الرغم من لي تظهر عدة مرات حول كيفية وضع مثل هذه النظم معا). أنا فقط أعتقد أن هناك حاجة إلى مزيد من العمل وضعت للتأكد من أن النتائج يرى المستخدم هي دلالة على حافة، بدلا من فتح إمكانية خوارزميات التعلم آلة مرنة للغاية مطاردة أشباح في واحدة من مجموعات البيانات نويزيست وأكثر ديناميكية يمكن للمرء أن تجد. توصياتي هي: 1) فئات الأصول المتعددة 2) السماح نطاقات المعلمة، وغطاء عدد من التجارب في أي نقطة معينة (مؤشرات GG4 مع عشرة إعدادات كل 10،000 أنظمة التداول الممكنة تفجير الملقمات). لتضييق عدد من التجارب التجريبية، واستخدام تقنيات من التصميم التجريبي للوصول إلى تركيبات لائقة. (أتمنى تذكرت بلدي تقنيات الاستجابة سطح المنهج من بلدي درجة الماجستير 8217s حول الآن) 3) السماح تعديلات النظام التحجيم (E. G. تقلب استهداف، وقف الخسائر)، مثل كتبت عن في بلدي التنمية يحركها فرضيات الوظائف. 4) تقديم نوع من الوثائق للمؤشرات، حتى لو كان 8217s بسيطة مثل وصلة إلى إنفستوبيديا (ويفضل أن يكون أكثر من ذلك بكثير). 5) أكثر بكثير الانتاج ضروري، وخاصة بالنسبة للمستخدمين الذين don8217t البرنامج. وتحديدا ما إذا كان هناك حافة شرعية أم لا، أو إذا كانت هناك ملاحظات قليلة جدا لرفض الفرضية الصفرية للضوضاء العشوائية. 6) أطول بكثير البيانات التاريخ. 2018 فصاعدا يبدو مجرد قصيرة جدا من الإطار الزمني للتأكد من فعالية استراتيجية 8217s، على الأقل على البيانات اليومية (قد لا يكون صحيحا لساعة). 7) عامل في تكاليف المعاملات. التداول على الإطار الزمني لكل ساعة سيعني أقل بكثير من حجم التداول لكل من التداول عن القرار اليومي. إذا MT4 يتقاضى سعر تذكرة ثابتة، يحتاج المستخدمون لمعرفة كيفية هذه العوامل في استراتيجيتها. 8) وأخيرا، دوجفودينغ. عندما تحدثت في المرة الأخيرة مع مؤسسي إينوفانس Tech8217s، زعموا أنهم كانوا يستخدمون خوارزميات خاصة بهم لخلق استراتيجية الفوركس، الذي كان جيدا في التداول المباشر. بحلول الوقت المزيد من هذه الاقتراحات يتم تنفيذها، فإنه 8217d تكون مثيرة للاهتمام لمعرفة ما إذا كان لديهم سجل حافل كصندوق، بالإضافة إلى كمزود البرمجيات. إذا تم احتساب جميع هذه الأشياء وأتمتة، والمنتج نأمل أن تنجز مهمتها في جلب التداول المنهجي والتعلم الآلي لعدد أكبر من الناس. وأعتقد أن تريد لديه إمكانات، و I8217m على أمل أن موظفيها سوف يدركون هذه الإمكانات. شكرا للقراءة. ملاحظة: أنا حاليا التعاقد في وسط مدينة شيكاغو، وأنا مهتم دائما في التواصل مع المهنيين في التجارة المنهجية والمنهجية إدارة الأصول المساحات. البحث عن لينكيدين هنا. إديت: اليوم في بريدي الإلكتروني (3 ديسمبر 2018)، تلقيت إشعارا بأن إينوفانس كان جعل ترايد خالية تماما. ربما كانوا يريدون مجموعة المزيد من ردود الفعل على ذلك هذا المنصب سوف تثبت طريقة لإنشاء مرشح الفرقة على أساس المبادلة بين نعومة والاستجابة، بحثت اثنين من الخصائص في مرشح. ومن شأن المرشح المثالي أن يكون متجاوبا مع حركة السعر حتى لا يشغل مواقف غير صحيحة، في حين يكون أيضا سلسا، حتى لا يتكبد إشارات خاطئة وتكاليف المعاملات غير الضرورية. لذلك، من أي وقت مضى منذ بلدي استراتيجية التداول التقلب، وذلك باستخدام ثلاثة مرشحات ساذجة جدا (جميع سما) غاب تماما 27 شهرا في الرابع عشر. قررت I8217ve لمحاولة تحسين طرق لخلق مؤشرات أفضل في الاتجاه التالي. الآن، تحت إدراك أنه يمكن أن يكون هناك أطنان من المرشحات المعقدة في الوجود، قررت بدلا من ذلك التركيز على طريقة لإنشاء مرشحات الفرقة، وذلك باستخدام القياس من التعلم ستاتيستيكشماشين. في تحليل البيانات الثابتة، لمهمة الانحدار أو التصنيف، هناك مفاضلة بين التحيز والتباين. وباختصار، فإن التباين سيئ نظرا لإمكانية الإفراط في تركيب عدد قليل من الملاحظات غير المنتظمة، والتحيز سيئ نظرا لاحتمال إبطال البيانات المشروعة. وبالمثل، مع السلاسل الزمنية الترشيح، وهناك مخاوف مماثلة، باستثناء التحيز يسمى تأخر، ويمكن اعتبار التباين كمؤشر 8220whipsawing8221. في الأساس، فإن مؤشر مثالي يتحرك بسرعة مع البيانات، في حين في الوقت نفسه، لا تملك عدد لا يحصى من المطبات الصغيرة، وعكس على طول الطريق، والتي قد ترسل إشارات كاذبة لاستراتيجية التداول. So, here8217s how my simple algorithm works: The inputs to the function are the following: A) The time series of the data you8217re trying to filter B) A collection of candidate filters C) A period over which to measure smoothness and responsiveness, defined as the square root of the n-day EMA (2(n1) convention) of the following: a) Responsiveness: the squared quantity of pricefilter 8211 1 b) Smoothness: the squared quantity of filter(t)filter(t-1) 8211 1 (aka R8217s return. calculate) function D) A conviction factor, to which power the errors will be raised. This should probably be between .5 and 3 E) A vector that defines the emphasis on smoothness (vs. emphasis on responsiveness), which should range from 0 to 1. Here8217s the code: This gets SPY data, and creates two utility functions8211xtsApply, which is simply a column-based apply that replaces the original index that using a column-wise apply discards, and sumIsNa, which I use later for counting the numbers of NAs in a given row. It also creates my candidate filters, which, to keep things simple, are just SMAs 2-250. Here8217s the actual code of the function, with comments in the code itself to better explain the process from a technical level (for those still unfamiliar with R, look for the hashtags): The vast majority of the computational time takes place in the two xtsApply calls. On 249 different simple moving averages, the process takes about 30 seconds. Here8217s the output, using a conviction factor of 2: And here is an example, looking at SPY from 2007 through 2018. In this case, I chose to go from blue to green, orange, brown, maroon, purple, and finally red for smoothness emphasis of 0, 5, 25, 50, 75, 95, and 1, respectively. Notice that the blue line is very wiggly, while the red line sometimes barely moves, such as during the 2018 drop-off. One thing that I noticed in the course of putting this process together is something that eluded me earlier8211namely, that naive trend-following strategies which are either fully long or fully short based on a crossover signal can lose money quickly in sideways markets. However, theoretically, by finely varying the jumps between 0 to 100 emphasis on smoothness, whether in steps of 1 or finer, one can have a sort of 8220continuous8221 conviction, by simply adding up the signs of differences between various ensemble filters. In an 8220uptrend8221, the difference as one moves from the most responsive to most smooth filter should constantly be positive, and vice versa. In the interest of brevity, this post doesn8217t even have a trading strategy attached to it. However, an implied trading strategy can be to be long or short the SPY depending on the sum of signs of the differences in filters as you move from responsiveness to smoothness. Of course, as the candidate filters are all SMAs, it probably wouldn8217t be particularly spectacular. However, for those out there who use more complex filters, this may be a way to create ensembles out of various candidate filters, and create even better filters. Furthermore, I hope that given enough candidate filters and an objective way of selecting them, it would be possible to reduce the chances of creating an overfit trading system. However, anything with parameters can potentially be overfit, so that may be wishful thinking. All in all, this is still a new idea for me. For instance, the filter to compute the error terms can probably be improved. The inspiration for an EMA 20 essentially came from how Basel computes volatility (if I recall, correctly, it uses the square root of an 18 day EMA of squared returns), and the very fact that I use an EMA can itself be improved upon (why an EMA instead of some other, more complex filter). In fact, I8217m always open to how I can improve this concept (and others) from readers. شكرا للقراءة. NOTE: I am currently contracting in Chicago in an analytics capacity. If anyone would like to meet up, let me know. You can email me at ilya. kipnisgmail, or contact me through my LinkedIn here. This post will deal with a quick, finger in the air way of seeing how well a strategy scales8211namely, how sensitive it is to latency between signal and execution, using a simple volatility trading strategy as an example. The signal will be the VIXVXV ratio trading VXX and XIV, an idea I got from Volatility Made Simple8217s amazing blog. particularly this post. The three signals compared will be the 8220magical thinking8221 signal (observe the close, buy the close, named from the ruleOrderProc setting in quantstrat), buy on next-day open, and buy on next-day close. Let8217s get started. So here8217s the run-through. In addition to the magical thinking strategy (observe the close, buy that same close), I tested three other variants8211a variant which transacts the next open, a variant which transacts the next close, and the average of those two. Effectively, I feel these three could give a sense of a strategy8217s performance under more realistic conditions8211that is, how well does the strategy perform if transacted throughout the day, assuming you8217re managing a sum of money too large to just plow into the market in the closing minutes (and if you hope to get rich off of trading, you will have a larger sum of money than the amount you can apply magical thinking to). Ideally, I8217d use VWAP pricing, but as that8217s not available for free anywhere I know of, that means that readers can8217t replicate it even if I had such data. In any case, here are the results. Log scale (for Mr. Tony Cooper and others): My reaction The execute on next day8217s close performance being vastly lower than the other configurations (and that deterioration occurring in the most recent years) essentially means that the fills will have to come pretty quickly at the beginning of the day. While the strategy seems somewhat scalable through the lens of this finger-in-the-air technique, in my opinion, if the first full day of possible execution after signal reception will tank a strategy from a 1.44 Calmar to a .92, that8217s a massive drop-off, after holding everything else constant. In my opinion, I think this is quite a valid question to ask anyone who simply sells signals, as opposed to manages assets. Namely, how sensitive are the signals to execution on the next day After all, unless those signals come at 3:55 PM, one is most likely going to be getting filled the next day. Now, while this strategy is a bit of a tomato can in terms of how good volatility trading strategies can get (they can get a lot better in my opinion), I think it made for a simple little demonstration of this technique. Again, a huge thank you to Mr. Helmuth Vollmeier for so kindly keeping up his dropbox all this time for the volatility data Thanks for reading. NOTE: I am currently contracting in a data science capacity in Chicago. You can email me at ilya. kipnisgmail, or find me on my LinkedIn here. I8217m always open to beers after work if you8217re in the Chicago area. NOTE 2: Today, on October 21, 2018, if you8217re in Chicago, there8217s a Chicago R Users Group conference at Jaks Tap at 6:00 PM. Free pizza, networking, and R, hosted by Paul Teetor, who8217s a finance guy. Hope to see you there. This post deals with an impossible-to-implement statistical arbitrage strategy using VXX and XIV. The strategy is simple: if the average daily return of VXX and XIV was positive, short both of them at the close. This strategy makes two assumptions of varying dubiousness: that one can 8220observe the close and act on the close8221, and that one can short VXX and XIV. So, recently, I decided to play around with everyone8217s two favorite instruments on this blog8211VXX and XIV, with the idea that 8220hey, these two instruments are diametrically opposed, so shouldn8217t there be a stat-arb trade here8221 So, in order to do a lick-finger-in-the-air visualization, I implemented Mike Harris8217s momersion indicator . And then I ran the spread through it. In other words, this spread is certainly mean-reverting at just about all times. And here is the code for the results from 2018 onward, from when the XIV and VXX actually started trading. Here are the equity curves: With the following statistics: In other words, the short side is absolutely amazing as a trade8211except for the one small fact of having it be impossible to actually execute, or at least as far as I8217m aware. Anyhow, this was simply a for-fun post, but hopefully it served some purpose. شكرا للقراءة. NOTE: I am currently contracting and am looking to network in the Chicago area. You can find my LinkedIn here. This post will evaluate signals based on the rank regression hypotheses covered in the last post. The last time around, we saw that rank regression had a very statistically significant result. Therefore, the next step would be to evaluate the basic signals 8212 whether or not there is statistical significance in the actual evaluation of the signal8211namely, since the strategy from SeekingAlpha simply selects the top-ranked ETF every month, this is a very easy signal to evaluate. Simply, using the 1-24 month formation periods for cumulative sum of monthly returns, select the highest-ranked ETF and hold it for one month. Here8217s the code to evaluate the signal (continued from the last post), given the returns, a month parameter, and an EW portfolio to compare with the signal. Okay, so what8217s going on here is that I compare the signal against the equal weight portfolio, and take means and z scores of both the signal values in general, and against the equal weight portfolio. I plot these values, along with boxplots of the distributions of both the signal process, and the difference between the signal process and the equal weight portfolio. Here are the results: To note, the percents are already multiplied by 100, so in the best cases, the rank strategy outperforms the equal weight strategy by about 30 basis points per month. However, these results are8230not even in the same parking lot as statistical significance, let alone in the same ballpark. Now, at this point, in case some people haven8217t yet read Brian Peterson8217s paper on strategy development. the point of hypothesis-driven development is to reject hypothetical strategies ASAP before looking at any sort of equity curve and trying to do away with periods of underperformance. So, at this point, I would like to reject this entire strategy because there8217s no statistical evidence to actually continue. Furthermore, because August 2018 was a rather interesting month, especially in terms of volatility dispersion, I want to return to volatility trading strategies, now backed by hypothesis-driven development. If anyone wants to see me continue to rule testing with this process, let me know. If not, I have more ideas on the way. شكرا للقراءة. NOTE: while I am currently consulting, I am always open to networking, meeting up (Philadelphia and New York City both work), consulting arrangements, and job discussions. Contact me through my email at ilya. kipnisgmail, or through my LinkedIn, found here. Post navigation CategoriesThis post will be an in-depth review of Alpha Architect8217s Quantitative Momentum book. Overall, in my opinion, the book is terrific for those that are practitioners in fund management in the individual equity space, and still contains ideas worth thinking about outside of that space. However, the system detailed in the book benefits from nested ranking (rank along axis X, take the top decile, rank along axis Y within the top decile in X, and take the top decile along axis Y, essentially restricting selection to 1 of the universe). Furthermore, the book does not do much to touch upon volatility controls, which may have enhanced the system outlined greatly. Before I get into the brunt of this post, I8217d like to let my readers know that I formalized my nuts and bolts of quantstrat series of posts as a formal datacamp course. Datacamp is a very cheap way to learn a bunch of R, and financial applications are among those topics. My course covers the basics of quantstrat, and if those who complete the course like it, I may very well create more advanced quantstrat modules on datacamp. I8217m hoping that the finance courses are well-received, since there are financial topics in R I8217d like to learn myself that a 45 minute lecture doesn8217t really suffice for (such as Dr. David Matteson8217s change points magic, PortfolioAnalytics, and so on). In any case, here8217s the link. So, let8217s start with a summary of the book: Part 1 is several chapters that are the giant expose - of why momentum works (or at least, has worked for at least 20 years since 1993)8230namely that human biases and irrational behaviors act in certain ways to make the anomaly work. Then there8217s also the career risk (AKA it8217s a risk factor, and so, if your benchmark is SPY and you run across a 3 year period of underperformance, you have severe career risk), and essentially, a whole litany of why a professional asset manager would get fired but if you just stick with the anomaly over many many years and ride out multi-year stretches of relative underperformance, you8217ll come out ahead in the very long run. Generally, I feel like there8217s work to be done if this is the best that can be done, but okay, I8217ll accept it. Essentially, part 1 is for the uninitiated. For those that have been around the momentum block a couple of times, they can skip right past this. Unfortunately, it8217s half the book, so that leaves a little bit of a sour taste in the mouth. Next, part two is where, in my opinion, the real meat and potatoes of the book8211the 8220how8221. Essentially, the algorithm can be boiled down into the following: Taking the universe of large and mid-cap stocks, do the following: 1) Sort the stocks into deciles by 2-12 momentum8211that is, at the end of every month, calculate momentum by last month8217s closing price minus the closing price 12 months ago. Essentially, research states that there8217s a reversion effect on the 1-month momentum. However, this effect doesn8217t carry over into the ETF universe in my experience. 2) Here8217s the interesting part which makes the book worth picking up on its own (in my opinion): after sorting into deciles, rank the top decile by the following metric: multiply the sign of the 2-12 momentum by the following equation: ( negative returns 8211 positive). Essentially, the idea here is to determine smoothness of momentum. That is, in the most extreme situation, imagine a stock that did absolutely nothing for 230 days, and then had one massive day that gave it its entire price appreciation (think Google when it had a 10 jump off of better-than-expected numbers reports), and in the other extreme, a stock that simply had each and every single day be a small positive price appreciation. Obviously, you8217d want the second type of stock. That8217s this idea. Again, sort into deciles, and take the top decile. Therefore, taking the top decile of the top decile leaves you with 1 of the universe. Essentially, this makes the idea very difficult to replicate8211since you8217d need to track down a massive universe of stocks. That stated, I think the expression is actually a pretty good idea as a stand-in for volatility. That is, regardless of how volatile an asset is8211whether it8217s as volatile as a commodity like DBC, or as non-volatile as a fixed-income product like SHY, this expression is an interesting way of stating 8220this path is choppy8221 vs. 8220this path is smooth8221. I might investigate this expression on my blog further in the future. 3) Lastly, if the portfolio is turning over quarterly instead of monthly, the best months to turn it over are the months preceding end-of-quarter month (that is, February, May, August, November) because a bunch of amateur asset managers like to 8220window dress8221 their portfolios. That is, they had a crummy quarter, so at the last month before they have to send out quarterly statements, they load up on some recent winners so that their clients don8217t think they8217re as amateur as they really let on, and there8217s a bump for this. Similarly, January has some selling anomalies due to tax-loss harvesting. As far as practical implementations go, I think this is a very nice touch. Conceding the fact that turning over every month may be a bit too expensive, I like that Wes and Jack say 8220sure, you want to turn it over once every three months, but on which months8221. It8217s a very good question to ask if it means you get an additional percentage point or 150 bps a year from that, as it just might cover the transaction costs and then some. All in all, it8217s a fairly simple to understand strategy. However, the part that sort of gates off the book to a perfect replication is the difficulty in obtaining the CRSP data. However, I do commend Alpha Architect for disclosing the entire algorithm from start to finish. Furthermore, if the basic 2-12 momentum is not enough, there8217s an appendix detailing other types of momentum ideas (earnings momentum, ranking by distance to 52-week highs, absolute historical momentum, and so on). None of these strategies are really that much better than the basic price momentum strategy, so they8217re there for those interested, but it seems there8217s nothing really ground-breaking there. That is, if you8217re trading once a month, there8217s only so many ways of saying 8220hey, I think this thing is going up8221 I also like that Wes and Jack touched on the fact that trend-following, while it doesn8217t improve overall CAGR or Sharpe, does a massive amount to improve on max drawdown. That is, if faced with the prospect of losing 70-80 of everything, and losing only 30, that8217s an easy choice to make. Trend-following is good, even a simplistic version. All in all, I think the book accomplishes what it sets out to do, which is to present a well-researched algorithm. Ultimately, the punchline is on Alpha Architect8217s site (I believe they have some sort of monthly stock filter). Furthermore, the book states that there are better risk-adjusted returns when combined with the algorithm outlined in the 8220quantitative value8221 book. In my experience, I8217ve never had value algorithms impress me in the backtests I8217ve done, but I can chalk that up to me being inexperienced with all the various valuation metrics. My criticism of the book, however, is this: The momentum algorithm in the book misses what I feel is one key component: volatility targeting control. Simply, the paper 8220momentum has its moments8221 (which I covered in my hypothesis-driven development series of posts) essentially states that the usual Fama-French momentum strategy does far better from a risk-reward strategy by deleveraging during times of excessive volatility, and avoiding momentum crashes. I8217m not sure why Wes and Jack didn8217t touch upon this paper, since the implementation is very simple (targetrealized volatility leverage factor). Ideally, I8217d love if Wes or Jack could send me the stream of returns for this strategy (preferably daily, but monthly also works). Essentially, I think this book is very comprehensive. However, I think it also has a somewhat 8220don8217t try this at home8221 feel to it due to the data requirement to replicate it. Certainly, if your broker charges you 8 a transaction, it8217s not a feasible strategy to drop several thousand bucks a year on transaction costs that8217ll just give your returns to your broker. However, I do wonder if the QMOM ETF (from Alpha Architect, of course) is, in fact, a better version of this strategy, outside of the management fee. In any case, my final opinion is this: while this book leaves a little bit of knowledge on the table, on a whole, it accomplishes what it sets out to do, is clear with its procedures, and provides several worthwhile ideas. For the price of a non-technical textbook (aka those 60 books on amazon), this book is a steal. شكرا للقراءة. NOTE: While I am currently employed in a successful analytics capacity, I am interested in hearing about full-time positions more closely related to the topics on this blog. If you have a full-time position which can benefit from my current skills, please let me know. My Linkedin can be found here. This post will be about attempting to use the Depmix package for online state prediction. While the depmix package performs admirably when it comes to describing the states of the past, when used for one-step-ahead prediction, under the assumption that tomorrow8217s state will be identical to today8217s, the hidden markov model process found within the package does not perform to expectations. So, to start off, this post was motivated by Michael Halls-Moore, who recently posted some R code about using the depmixS4 library to use hidden markov models. Generally, I am loath to create posts on topics I don8217t feel I have an absolutely front-to-back understanding of, but I8217m doing this in the hope of learning from others on how to appropriately do online state-space prediction, or 8220regime switching8221 detection, as it may be called in more financial parlance. While I8217ve seen the usual theory of hidden markov models (that is, it can rain or it can be sunny, but you can only infer the weather judging by the clothes you see people wearing outside your window when you wake up), and have worked with toy examples in MOOCs (Udacity8217s self-driving car course deals with them, if I recall correctly8211or maybe it was the AI course), at the end of the day, theory is only as good as how well an implementation can work on real data. For this experiment, I decided to take SPY data since inception, and do a full in-sample 8220backtest8221 on the data. That is, given that the HMM algorithm from depmix sees the whole history of returns, with this 8220god8217s eye8221 view of the data, does the algorithm correctly classify the regimes, if the backtest results are any indication Here8217s the code to do so, inspired by Dr. Halls-Moore8217s. Essentially, while I did select three states, I noted that anything with an intercept above zero is a bull state, and below zero is a bear state, so essentially, it reduces to two states. With the result: So, not particularly terrible. The algorithm works, kind of, sort of, right Well, let8217s try online prediction now. So what I did here was I took an expanding window, starting from 500 days since SPY8217s inception, and kept increasing it, by one day at a time. My prediction, was, trivially enough, the most recent day, using a 1 for a bull state, and a -1 for a bear state. I ran this process in parallel (on a linux cluster, because windows8217s doParallel library seems to not even know that certain packages are loaded, and it8217s more messy), and the first big issue is that this process took about three hours on seven cores for about 23 years of data. Not exactly encouraging, but computing time isn8217t expensive these days. So let8217s see if this process actually works. First, let8217s test if the algorithm does what it8217s actually supposed to do and use one day of look-ahead bias (that is, the algorithm tells us the state at the end of the day8211how correct is it even for that day). With the result: So, allegedly, the algorithm seems to do what it was designed to do, which is to classify a state for a given data set. Now, the most pertinent question: how well do these predictions do even one day ahead You8217d think that state space predictions would be parsimonious from day to day, given the long history, correct With the result: That is, without the lookahead bias, the state space prediction algorithm is atrocious. Why is that Well, here8217s the plot of the states: In short, the online hmm algorithm in the depmix package seems to change its mind very easily, with obvious (negative) implications for actual trading strategies. So, that wraps it up for this post. Essentially, the main message here is this: there8217s a vast difference between loading doing descriptive analysis (AKA 8220where have you been, why did things happen8221) vs. predictive analysis (that is, 8220if I correctly predict the future, I get a positive payoff8221). In my opinion, while descriptive statistics have their purpose in terms of explaining why a strategy may have performed how it did, ultimately, we8217re always looking for better prediction tools. In this case, depmix, at least in this 8220out-of-the-box8221 demonstration does not seem to be the tool for that. If anyone has had success with using depmix (or other regime-switching algorithm in R) for prediction, I would love to see work that details the procedure taken, as it8217s an area I8217m looking to expand my toolbox into, but don8217t have any particular good leads. Essentially, I8217d like to think of this post as me describing my own experiences with the package. شكرا للقراءة. NOTE: On Oct. 5th, I will be in New York City. On Oct. 6th, I will be presenting at The Trading Show on the Programming Wars panel. NOTE: My current analytics contract is up for review at the end of the year, so I am officially looking for other offers as well. If you have a full-time role which may benefit from the skills you see on my blog, please get in touch with me. My linkedin profile can be found here. This post will introduce component conditional value at risk mechanics found in PerformanceAnalytics from a paper written by Brian Peterson, Kris Boudt, and Peter Carl. This is a mechanism that is an easy-to-call mechanism for computing component expected shortfall in asset returns as they apply to a portfolio. While the exact mechanics are fairly complex, the upside is that the running time is nearly instantaneous, and this method is a solid tool for including in asset allocation analysis. For those interested in an in-depth analysis of the intuition of component conditional value at risk, I refer them to the paper written by Brian Peterson, Peter Carl, and Kris Boudt. Essentially, here8217s the idea: all assets in a given portfolio have a marginal contribution to its total conditional value at risk (also known as expected shortfall)8211that is, the expected loss when the loss surpasses a certain threshold. For instance, if you want to know your 5 expected shortfall, then it8217s the average of the worst 5 returns per 100 days, and so on. For returns using daily resolution, the idea of expected shortfall may sound as though there will never be enough data in a sufficiently fast time frame (on one year or less), the formula for expected shortfall in the PerformanceAnalytics defaults to an approximation calculation using a Cornish-Fisher expansion, which delivers very good results so long as the p-value isn8217t too extreme (that is, it works for relatively sane p values such as the 1-10 range). Component Conditional Value at Risk has two uses: first off, given no input weights, it uses an equal weight default, which allows it to provide a risk estimate for each individual asset without burdening the researcher to create his or her own correlationcovariance heuristics. Secondly, when provided with a set of weights, the output changes to reflect the contribution of various assets in proportion to those weights. This means that this methodology works very nicely with strategies that exclude assets based on momentum, but need a weighting scheme for the remaining assets. Furthermore, using this methodology also allows an ex-post analysis of risk contribution to see which instrument contributed what to risk. First, a demonstration of how the mechanism works using the edhec data set. There is no strategy here, just a demonstration of syntax. This will assume an equal-weight contribution from all of the funds in the edhec data set. So tmp is the contribution to expected shortfall from each of the various edhec managers over the entire time period. Here8217s the output: The salient part of this is the percent contribution (the last output). Notice that it can be negative, meaning that certain funds gain when others lose. At least, this was the case over the current data set. These assets diversify a portfolio and actually lower expected shortfall. In this case, I equally weighted the first ten managers in the edhec data set, and put zero weight in the last three. Furthermore, we can see what happens when the weights are not equal. This time, notice that as the weight increased in the convertible arb manager, so too did his contribution to maximum expected shortfall. For a future backtest, I would like to make some data requests. I would like to use the universe found in Faber8217s Global Asset Allocation book. That said, the simulations in that book go back to 1972, and I was wondering if anyone out there has daily returns for those assetsindices. While some ETFs go back into the early 2000s, there are some that start rather late such as DBC (commodities, early 2006), GLD (gold, early 2004), BWX (foreign bonds, late 2007), and FTY (NAREIT, early 2007). As an eight-year backtest would be a bit short, I was wondering if anyone had data with more history. One other thing, I will in New York for the trading show. and speaking on the 8220programming wars8221 panel on October 6th. شكرا للقراءة. NOTE: While I am currently contracting, I am also looking for a permanent position which can benefit from my skills for when my current contract ends. If you have or are aware of such an opening, I will be happy to speak with you. This post will cover a function to simplify creating Harry Long type rebalancing strategies from SeekingAlpha for interested readers. As Harry Long has stated, most, if not all of his strategies are more for demonstrative purposes rather than actual recommended investments. So, since Harry Long has been posting some more articles on Seeknig Alpha, I8217ve had a reader or two ask me to analyze his strategies (again). Instead of doing that, however, I8217ll simply put this tool here, which is a wrapper that automates the acquisition of data and simulates portfolio rebalancing with one line of code. Here8217s the tool. It fetches the data for you (usually from Yahoo, but a big thank you to Mr. Helumth Vollmeier in the case of ZIV and VXX), and has the option of either simply displaying an equity curve and some statistics (CAGR, annualized standard dev, Sharpe, max Drawdown, Calmar), or giving you the return stream as an output if you wish to do more analysis in R. Here8217s an example of simply getting the statistics, with an 80 XLPSPLV (they8217re more or less interchangeable) and 20 TMF (aka 60 TLT, so an 8060 portfolio), from one of Harry Long8217s articles . Nothing out of the ordinary of what we might expect from a balanced equitybonds portfolio. Generally does well, has its largest drawdown in the financial crisis, and some other bumps in the road, but overall, I8217d think a fairly vanilla 8220set it and forget it8221 sort of thing. And here would be the way to get the stream of individual daily returns, assuming you wanted to rebalance these two instruments weekly, instead of yearly (as is the default). And now let8217s get some statistics. Turns out, moving the rebalancing from annually to weekly didn8217t have much of an effect here (besides give a bunch of money to your broker, if you factored in transaction costs, which this doesn8217t). So, that8217s how this tool works. The results, of course, begin from the latest instrument8217s inception. The trick, in my opinion, is to try and find proxy substitutes with longer histories for newer ETFs that are simply leveraged ETFs, such as using a 60 weight in TLT with an 80 weight in XLP instead of a 20 weight in TMF with 80 allocation in SPLV. For instance, here are some proxies: SPXL XLP SPXLUPRO SPY 3 TMF TLT 3 That said, I8217ve worked with Harry Long before, and he develops more sophisticated strategies behind the scenes, so I8217d recommend that SeekingAlpha readers take his publicly released strategies as concept demonstrations, as opposed to fully-fledged investment ideas, and contact Mr. Long himself about more customized, private solutions for investment institutions if you are so interested. شكرا للقراءة. NOTE: I am currently in the northeast. While I am currently contracting, I am interested in networking with individuals or firms with regards to potential collaboration opportunities. This post will demonstrate how to take into account turnover when dealing with returns-based data using PerformanceAnalytics and the Return. Portfolio function in R. It will demonstrate this on a basic strategy on the nine sector SPDRs. So, first off, this is in response to a question posed by one Robert Wages on the R-SIG-Finance mailing list. While there are many individuals out there with a plethora of questions (many of which can be found to be demonstrated on this blog already), occasionally, there will be an industry veteran, a PhD statistics student from Stanford, or other very intelligent individual that will ask a question on a topic that I haven8217t yet touched on this blog, which will prompt a post to demonstrate another technical aspect found in R. This is one of those times. So, this demonstration will be about computing turnover in returns space using the PerformanceAnalytics package. Simply, outside of the PortfolioAnalytics package, PerformanceAnalytics with its Return. Portfolio function is the go-to R package for portfolio management simulations, as it can take a set of weights, a set of returns, and generate a set of portfolio returns for analysis with the rest of PerformanceAnalytics8217s functions. Again, the strategy is this: take the 9 three-letter sector SPDRs (since there are four-letter ETFs now), and at the end of every month, if the adjusted price is above its 200-day moving average, invest into it. Normalize across all invested sectors (that is, 19th if invested into all 9, 100 into 1 if only 1 invested into, 100 cash, denoted with a zero return vector, if no sectors are invested into). It8217s a simple, toy strategy, as the strategy isn8217t the point of the demonstration. Here8217s the basic setup code: So, get the SPDRs, put them together, compute their returns, generate the signal, and create the zero vector, since Return. Portfolio treats weights less than 1 as a withdrawal, and weights above 1 as the addition of more capital (big FYI here). Now, here8217s how to compute turnover: So, the trick is this: when you call Return. portfolio, use the verbose TRUE option. This creates several objects, among them returns, BOP. Weight, and EOP. Weight. These stand for Beginning Of Period Weight, and End Of Period Weight. The way that turnover is computed is simply the difference between how the day8217s return moves the allocated portfolio from its previous ending point to where that portfolio actually stands at the beginning of next period. That is, the end of period weight is the beginning of period drift after taking into account the day8217s driftreturn for that asset. The new beginning of period weight is the end of period weight plus any transacting that would have been done. Thus, in order to find the actual transactions (or turnover), one subtracts the previous end of period weight from the beginning of period weight. This is what such transactions look like for this strategy. Something we can do with such data is take a one-year rolling turnover, accomplished with the following code: It looks like this: This essentially means that one year8217s worth of two-way turnover (that is, if selling an entirely invested portfolio is 100 turnover, and buying an entirely new set of assets is another 100, then two-way turnover is 200) is around 800 at maximum. That may be pretty high for some people. Now, here8217s the application when you penalize transaction costs at 20 basis points per percentage point traded (that is, it costs 20 cents to transact 100). So, at 20 basis points on transaction costs, that takes about one percent in returns per year out of this (admittedly, terrible) strategy. This is far from negligible. So, that is how you actually compute turnover and transaction costs. In this case, the transaction cost model was very simple. However, given that Return. portfolio returns transactions at the individual asset level, one could get as complex as they would like with modeling the transaction costs. شكرا للقراءة. NOTE: I will be giving a lightning talk at RFinance, so for those attending, you8217ll be able to find me there. This post will outline an easy-to-make mistake in writing vectorized backtests8211namely in using a signal obtained at the end of a period to enter (or exit) a position in that same period. The difference in results one obtains is massive. Today, I saw two separate posts from Alpha Architect and Mike Harris both referencing a paper by Valeriy Zakamulin on the fact that some previous trend-following research by Glabadanidis was done with shoddy results, and that Glabadanidis8217s results were only reproducible through instituting lookahead bias. The following code shows how to reproduce this lookahead bias. First, the setup of a basic moving average strategy on the SampP 500 index from as far back as Yahoo data will provide. And here is how to institute the lookahead bias. These are the 8220results8221: Of course, this equity curve is of no use, so here8217s one in log scale. As can be seen, lookahead bias makes a massive difference. Here are the numerical results: Again, absolutely ridiculous. Note that when using Return. Portfolio (the function in PerformanceAnalytics), that package will automatically give you the next period8217s return, instead of the current one, for your weights. However, for those writing 8220simple8221 backtests that can be quickly done using vectorized operations, an off-by-one error can make all the difference between a backtest in the realm of reasonable, and pure nonsense. However, should one wish to test for said nonsense when faced with impossible-to-replicate results, the mechanics demonstrated above are the way to do it. Now, onto other news: I8217d like to thank Gerald M for staying on top of one of the Logical Invest strategies8211namely, their simple global market rotation strategy outlined in an article from an earlier blog post. Up until March 2018 (the date of the blog post), the strategy had performed well. However, after said date It has been a complete disaster, which, in hindsight, was evident when I passed it through the hypothesis-driven development framework process I wrote about earlier. So, while there has been a great deal written about not simply throwing away a strategy because of short-term underperformance, and that anomalies such as momentum and value exist because of career risk due to said short-term underperformance, it8217s never a good thing when a strategy creates historically large losses, particularly after being published in such a humble corner of the quantitative financial world. In any case, this was a post demonstrating some mechanics, and an update on a strategy I blogged about not too long ago. شكرا للقراءة. NOTE: I am always interested in hearing about new opportunities which may benefit from my expertise, and am always happy to network. You can find my LinkedIn profile here . This post will shed light on the values of R2s behind two rather simplistic strategies 8212 the simple 10 month SMA, and its relative, the 10 month momentum (which is simply a difference of SMAs, as Alpha Architect showed in their book DIY Financial Advisor . Not too long ago, a friend of mine named Josh asked me a question regarding R2s in finance. He8217s finishing up his PhD in statistics at Stanford, so when people like that ask me questions, I8217d like to answer them. His assertion is that in some instances, models that have less than perfect predictive power (EG R2s of .4, for instance), can still deliver very promising predictions, and that if someone were to have a financial model that was able to explain 40 of the variance of returns, they could happily retire with that model making them very wealthy. Indeed. 4 is a very optimistic outlook (to put it lightly), as this post will show. In order to illustrate this example, I took two 8220staple8221 strategies 8212 buy SPY when i ts closing monthly price is above its ten month simple moving average, and when its ten month momentum (basically the difference of a ten month moving average and its lag) is positive. While these models are simplistic, they are ubiquitously talked about, and many momentum strategies are an improvement upon these baseline, 8220out-of-the-box8221 strategies. Here8217s the code to do that: And here are the results: In short, the SMA10 and the 10-month momentum (aka ROC 10 aka MOM10) both handily outperform the buy and hold, not only in absolute returns, but especially in risk-adjusted returns (Sharpe and Calmar ratios). Again, simplistic analysis, and many models get much more sophisticated than this, but once again, simple, illustrative example using two strategies that outperform a benchmark (over the long term, anyway). Now, the question is, what was the R2 of these models To answer this, I took a rolling five-year window that essentially asked: how well did these quantities (the ratio between the closing price and the moving average 8211 1, or the ten month momentum) predict the next month8217s returns That is, what proportion of the variance is explained through the monthly returns regressed against the previous month8217s signals in numerical form (perhaps not the best framing, as the signal is binary as opposed to continuous which is what is being regressed, but let8217s set that aside, again, for the sake of illustration). Here8217s the code to generate the answer. And the answer, in pictorial form: In short, even in the best case scenarios, namely, crises which provide momentumtrend-followingcall it what you will its raison d8217etre, that is, its risk management appeal, the proportion of variance explained by the actual signal quantities was very small. In the best of times, around 20. But then again, think about what the R2 value actually is8211it8217s the percentage of variance explained by a predictor. If a small set of signals (let alone one) was able to explain the majority of the change in the returns of the SampP 500, or even a not-insignificant portion, such a person would stand to become very wealthy. More to the point, given that two strategies that handily outperform the market have R2s that are exceptionally low for extended periods of time, it goes to show that holding the R2 up as some form of statistical holy grail certainly is incorrect in the general sense, and anyone who does so either is painting with too broad a brush, is creating disingenuous arguments, or should simply attempt to understand another field which may not work the way their intuition tells them. شكرا للقراءة. This review will review the 8220Adaptive Asset Allocation: Dynamic Global Portfolios to Profit in Good Times 8211 and Bad8221 book by the people at ReSolve Asset Management. Overall, this book is a definite must-read for those who have never been exposed to the ideas within it. However, when it comes to a solution that can be fully replicated, this book is lacking. Okay, it8217s been a while since I reviewed my last book, DIY Financial Advisor. from the awesome people at Alpha Architect. This book in my opinion, is set up in a similar sort of format. This is the structure of the book, and my reviews along with it: Part 1: Why in the heck you actually need to have a diversified portfolio, and why a diversified portfolio is a good thing. In a world in which there is so much emphasis put on single-security performance, this is certainly something that absolutely must be stated for those not familiar with portfolio theory. It highlights the example of two people8211one from Abbott Labs, and one from Enron, who had so much of their savings concentrated in their company8217s stock. Mr. Abbott got hit hard and changed his outlook on how to save for retirement, and Mr. Enron was never heard from again. Long story short: a diversified portfolio is good, and a properly diversified portfolio can offset one asset8217s zigs with another asset8217s zags. This is the key to establishing a stream of returns that will help meet financial goals. Basically, this is your common sense story (humans love being told stories) so as to motivate you to read the rest of the book. It does its job, though for someone like me, it8217s more akin to a big 8220wait for it, wait for it8230and there8217s the reason why we should read on, as expected8221. Part 2: Something not often brought up in many corners of the quant world (because it8217s real life boring stuff) is the importance not only of average returns, but when those returns are achieved. Namely, imagine your everyday saver. At the beginning of their careers, they8217re taking home less salary and have less money in their retirement portfolio (or speculation portfolio, but the book uses retirement portfolio). As they get into middle age and closer to retirement, they have a lot more money in said retirement portfolio. Thus, strong returns are most vital when there is more cash available to the portfolio, and the difference between mediocre returns at the beginning and strong returns at the end of one8217s working life as opposed to vice versa is astronomical and cannot be understated. Furthermore, once in retirement, strong returns in the early years matter far more than returns in the later years once money has been withdrawn out of the portfolio (though I8217d hope that a portfolio8217s returns can be so strong that one can simply 8220live off the interest8221). Or, put more intuitively: when you have 10,000 in your portfolio, a 20 drawdown doesn8217t exactly hurt because you can make more money and put more into your retirement account. But when you8217re 62 and have 500,000 and suddenly lose 30 of everything, well, that8217s massive. How much an investor wants to avoid such a scenario cannot be understated. Warren Buffett once said that if you can8217t bear to lose 50 of everything, you shouldn8217t be in stocks. I really like this part of the book because it shows just how dangerous the ideas of 8220a 50 drawdown is unavoidable8221 and other 8220stay invested for the long haul8221 refrains are. Essentially, this part of the book makes a resounding statement that any financial adviser keeping his or her clients invested in equities when they8217re near retirement age is doing something not very advisable, to put it lightly. In my opinion, those who advise pension funds should especially keep this section of the book in mind, since for some people, the long-term may be coming to an end, and what matters is not only steady returns, but to make sure the strategy doesn8217t fall off a cliff and destroy decades of hard-earned savings. Part 3: This part is also one that is a very important read. First off, it lays out in clear terms that the long-term forward-looking valuations for equities are at rock bottom. That is, the expected forward 15-year returns are very low, using approximately 75 years of evidence. Currently, according to the book, equity valuations imply a negative 15-year forward return. However, one thing I will take issue with is that while forward-looking long-term returns for equities may be very low, if one believed this chart and only invested in the stock market when forecast 15-year returns were above the long term average, one would have missed out on both the 2003-2007 bull runs, and the one since 2009 that8217s just about over. So, while the book makes a strong case for caution, readers should also take the chart with a grain of salt in my opinion. However, another aspect of portfolio construction that this book covers is how to construct a robust (assets for any economic environment) and coherent (asset classes balanced in number) universe for implementation with any asset allocation algorithm. I think this bears repeating: universe selection is an extremely important topic in the discussion of asset allocation, yet there is very little discussion about it. Most researchtopics simply take some 8220conventional universe8221, such as 8220all stocks on the NYSE8221, or 8220all the stocks in the SampP 5008221, or 8220the entire set of the 50-60 most liquid futures8221 without consideration for robustness and coherence. This book is the first source I8217ve seen that actually puts this topic under a magnifying glass besides 8220finger in the air pick and choose8221. Part 4: and here8217s where I level my main criticism at this book. For those that have read 8220Adaptive Asset Allocation: A Primer8221. this section of the book is basically one giant copy and paste. It8217s all one large buildup to 8220momentum rank min-variance optimization8221. All well and good, until there8217s very little detail beyond the basics as to how the minimum variance portfolio was constructed. Namely, what exactly is the minimum variance algorithm in use Is it one of the poor variants susceptible to numerical instability inherent in inverting sample covariance matrices Or is it a heuristic like David Varadi8217s minimum variance and minimum correlation algorithm The one feeling I absolutely could not shake was that this book had a perfect opportunity to present a robust approach to minimum variance, and instead, it8217s long on concept, short on details. While the theory of 8220maximize return for unit risk8221 is all well and good, the actual algorithm to implement that theory into practice is not trivial, with the solutions taught to undergrads and master8217s students having some well-known weaknesses. On top of this, one thing that got hammered into my head in the past was that ranking also had a weakness at the inclusionexclusion point. E. G. if, out of ten assets, the fifth asset had a momentum of say, 10.9, and the sixth asset had a momentum of 10.8, how are we so sure the fifth is so much better And while I realize that this book was ultimately meant to be a primer, in my opinion, it would have been a no-objections five-star if there were an appendix that actually went into some detail on how to go from the simple concepts and included a small numerical example of some algorithms that may address the well-known weaknesses. This doesn8217t mean Greekmathematical jargon. Just an appendix that acknowledged that not every reader is someone only picking up his first or second book about systematic investing, and that some of us are familiar with the 8220whys8221 and are more interested in the 8220hows8221. Furthermore, I8217d really love to know where the authors of this book got their data to back-date some of these ETFs into the 90s. Part 5: some more formal research on topics already covered in the rest of the book8211namely a section about how many independent bets one can take as the number of assets grow, if I remember it correctly. Long story short You easily get the most bang for your buck among disparate asset classes, such as treasuries of various duration, commodities, developed vs. emerging equities, and so on, as opposed to trying to pick among stocks in the same asset class (though there8217s some potential for alpha there8230just8230a lot less than you imagine). So in case the idea of asset class selection, not stock selection wasn8217t beaten into the reader8217s head before this point, this part should do the trick. The other research paper is something I briefly skimmed over which went into more depth about volatility and retirement portfolios, though I felt that the book covered this topic earlier on to a sufficient degree by building up the intuition using very understandable scenarios. So that8217s the review of the book. Overall, it8217s a very solid piece of writing, and as far as establishing the why, it does an absolutely superb job. For those that aren8217t familiar with the concepts in this book, this is definitely a must-read, and ASAP. However, for those familiar with most of the concepts and looking for a detailed 8220how8221 procedure, this book does not deliver as much as I would have liked. And I realize that while it8217s a bad idea to publish secret sauce, I bought this book in the hope of being exposed to a new algorithm presented in the understandable and intuitive language that the rest of the book was written in, and was left wanting. Still, that by no means diminishes the impact of the rest of the book. For those who are more likely to be its target audience, it8217s a 55. For those that wanted some specifics, it still has its gem on universe construction. Overall, I rate it a 45. Thanks for reading. سنة جديدة سعيدة. This post will be a quick one covering the relationship between the simple moving average and time series momentum. The implication is that one can potentially derive better time series momentum indicators than the classical one applied in so many papers. Okay, so the main idea for this post is quite simple: I8217m sure we8217re all familiar with classical momentum. That is, the price now compared to the price however long ago (3 months, 10 months, 12 months, etc.). E. G. P(now) 8211 P(10) And I8217m sure everyone is familiar with the simple moving average indicator, as well. E. G. SMA(10). Well, as it turns out, these two quantities are actually related. It turns out, if instead of expressing momentum as the difference of two numbers, it is expressed as the sum of returns, it can be written (for a 10 month momentum) as: MOM10 return of this month return of last month return of 2 months ago 8230 return of 9 months ago, for a total of 10 months in our little example. This can be written as MOM10 (P(0) 8211 P(1)) (P(1) 8211 P(2)) 8230 (P(9) 8211 P(10)). (Each difference within parentheses denotes one month8217s worth of returns.) Which can then be rewritten by associative arithmetic as: (P(0) P(1) 8230 P(9)) 8211 (P(1) P(2) 8230 P(10)). In other words, momentum 8212 aka the difference between two prices, can be rewritten as the difference between two cumulative sums of prices. And what is a simple moving average Simply a cumulative sum of prices divided by however many prices summed over. Here8217s some R code to demonstrate. With the resulting number of times these two signals are equal: In short, every time. Now, what exactly is the punchline of this little example Here8217s the punchline: The simple moving average is8230fairly simplistic as far as filters go. It works as a pedagogical example, but it has some well known weaknesses regarding lag, windowing effects, and so on. Here8217s a toy example how one can get a different momentum signal by changing the filter. With the following results: While the difference of EMA10 strategy didn8217t do better than the difference of SMA10 (aka standard 10-month momentum), that8217s not the point. The point is that the momentum signal is derived from a simple moving average filter, and that by using a different filter, one can still use a momentum type of strategy. Or, put differently, the maingeneral takeaway here is that momentum is the slope of a filter, and one can compute momentum in an infinite number of ways depending on the filter used, and can come up with a myriad of different momentum strategies. شكرا للقراءة. NOTE: I am currently contracting in Chicago, and am always open to networking. Contact me at my email at ilya. kipnisgmail or find me on my LinkedIn here. This post will outline a first failed attempt at applying the ensemble filter methodology to try and come up with a weighting process on SPY that should theoretically be a gradual process to shift from conviction between a bull market, a bear market, and anywhere in between. This is a follow-up post to this blog post. So, my thinking went like this: in a bull market, as one transitions from responsiveness to smoothness, responsive filters should be higher than smooth filters, and vice versa, as there8217s generally a trade-off between the two. In fact, in my particular formulation, the quantity of the square root of the EMA of squared returns punishes any deviation from a flat line altogether (although inspired by Basel8217s measure of volatility, which is the square root of the 18-day EMA of squared returns), while the responsiveness quantity punishes any deviation from the time series of the realized prices. Whether these are the two best measures of smoothness and responsiveness is a topic I8217d certainly appreciate feedback on. In any case, an idea I had on the top of my head was that in addition to having a way of weighing multiple filters by their responsiveness (deviation from price action) and smoothness (deviation from a flat line), that by taking the sums of the sign of the difference between one filter and its neighbor on the responsiveness to smoothness spectrum, provided enough ensemble filters (say, 101, so there are 100 differences), one would obtain a way to move from full conviction of a bull market, to a bear market, to anything in between, and have this be a smooth process that doesn8217t have schizophrenic swings of conviction. Here8217s the code to do this on SPY from inception to 2003: And here8217s the very underwhelming result: Essentially, while I expected to see changes in conviction of maybe 20 at most, instead, my indicator of sum of sign differences did exactly as I had hoped it wouldn8217t, which is to be a very binary sort of mechanic. My intuition was that between an 8220obvious bull market8221 and an 8220obvious bear market8221 that some differences would be positive, some negative, and that they8217d net each other out, and the conviction would be zero. Furthermore, that while any individual crossover is binary, all one hundred signs being either positive or negative would be a more gradual process. Apparently, this was not the case. To continue this train of thought later, one thing to try would be an all-pairs sign difference. Certainly, I don8217t feel like giving up on this idea at this point, and, as usual, feedback would always be appreciated. شكرا للقراءة. NOTE: I am currently consulting in an analytics capacity in downtown Chicago. However, I am also looking for collaborators that wish to pursue interesting trading ideas. If you feel my skills may be of help to you, let8217s talk. You can email me at ilya. kipnisgmail, or find me on my LinkedIn here . Post navigation CategoriesPioneering in Tomorrows Trading How does it work Build Algorithms in a Browser IDE, Using Template Strategies and Free Data Design and test your strategy on our free data and when youre ready deploy it live to your brokerage. رمز في لغات البرمجة متعددة وتسخير لدينا مجموعة من مئات من الخوادم لتشغيل باكتست لتحليل الاستراتيجية الخاصة بك في الأسهم، فكس، كفد، خيارات أو أسواق العقود الآجلة. كوانتكونيكت هو الثورة المقبلة في التداول الكمي، والجمع بين الحوسبة السحابية والوصول إلى البيانات المفتوحة. سرعة لا مثيل لها تسخير مزرعة الخادم لدينا لسرعات المؤسسية من جهاز الكمبيوتر الخاص بك سطح المكتب. يمكنك إيتيريت على أفكارك أسرع مما فعلت من أي وقت مضى من أي وقت مضى. مكتبة البيانات الضخمة نحن نقدم مكتبة بيانات حل بحجم 400 تيرابايت مجانية ضخمة تغطي الأسهم الأمريكية والخيارات والعقود الآجلة والأساسيات والعقود مقابل الفروقات والفوركس منذ عام 1998. تنفيذ الصف العالمي يتم وضع خوارزميات التداول المباشر لدينا بجوار خوادم السوق في إكينيكس (NY7) من أجل التنفيذ السريع والمأمون والتخفيف بسرعة إلى الأسواق. لديك بعض الأفكار العظيمة يتيح اختبار بها بدء خوارزمية الجودة المهنية، مكتبة البيانات المفتوحة استراتيجيات التصميم مع لدينا مكتبة البيانات المنسقة بعناية، والتي تمتد الأسواق العالمية، من القراد إلى القرار اليومي. يتم تحديث البيانات يوميا تقريبا حتى تتمكن باكتست على أحدث البيانات الممكنة، والتحيز البقاء على قيد الحياة مجانا. نحن نقدم بيانات الأسهم الأسهم التي تعود إلى يناير 1998 لكل رمز تداول، بلغ مجموعها أكثر من 29،000 الأسهم. يتم توفير السعر من قبل كوانتكوت. وبالإضافة إلى ذلك لدينا نجمة الصباح البيانات الأساسية لأكثر شعبية 8000 رموز ل 900 المؤشرات منذ عام 1998. الفوركس أمبير كفد نحن نقدم 100 أزواج العملات وعقود العقود مقابل الفروقات 70 تغطي كل الاقتصاد الرئيسي التي تقدمها فكسم و أواندا. البيانات هي في قرار القراد، يبدأ أبريل 2007 ويتم تحديثها يوميا. نحن نقدم التجارة الآجلة القراد التجارة والبيانات الاقتباس من يناير 2009 حتى الآن، عن كل عقد تداول في سم، كومكس و غلوبكس. يتم تحديث البيانات أسبوعيا ويتم توفيرها من قبل ألغوسيك. نحن نقدم الصفقات الخيار ونقلت وصولا الى دقة دقيقة، عن كل خيار تداول على أوربا منذ عام 2007، وتغطي الملايين من العقود. يتم تحديث البيانات في غضون 48 ساعة ويتم توفيرها من قبل ألغوسيك. تعاون فريق البحث عن أصدقاء جدد في المجتمع والتعاون جنبا إلى جنب مع لدينا ميزة الترميز فريق مشاركة المشاريع ورؤية رمزها على الفور أثناء الكتابة. يمكنك حتى منح الوصول المباشر والتحكم في خوارزمية حية معا. استخدام الرسائل الفورية الداخلية لدينا للعثور على أعضاء الفريق المحتملين للانضمام إلى القوات الآمنة الملكية الفكرية تركيزنا هو أن نقدم لك أفضل منصة التداول خوارزمية ممكنة وحماية الملكية الفكرية القيمة الخاصة بك. سنكون دائما موفر البنية التحتية والتكنولوجيا أولا. عندما كنت على استعداد للتداول الحية تساعد بسعادة بشكل جيد لك تنفيذ من خلال وسيط الخاص بك في الاختيار. تنفيذ من خلال الوساطة الرائدة ويف متكاملة مع شركات الوساطة الرائدة في العالم لتقديم أفضل تنفيذ وأقل الرسوم للمجتمع. استراتيجيات الحدث يحرك تصميم خوارزمية لا يمكن أن يكون أسهل. هناك اثنين فقط من المهام المطلوبة ونحن نحرص على كل شيء آخر أنت مجرد إنيتياليز () الاستراتيجية الخاصة بك والتعامل مع الأحداث البيانات التي طلبتها. يمكنك إنشاء مؤشرات جديدة، والفصول، والمجلدات والملفات مع مترجم C على شبكة الإنترنت كاملة والإكمال التلقائي. ونحن ملتزمون بإعطائك أفضل تجربة تصميم خوارزمية ممكنة. يمكن الاستفادة من إمكانيات أوبت في المستخدمين لديها استراتيجياتها المقدمة للعملاء هيدجيفوند في لوحة تحكم استراتيجية مهنية شفافة. يتم التحقق من صحة الاستراتيجيات من قبل كوانتكونكتس باكتستينغ والتجارة الحية، مما يتيح لك مراجعة طرف ثالث محايدة من التعليمات البرمجية. المهتمين هيدجيفوندز يمكن الاتصال بك مباشرة من خلال كوانتكونكت لنقدم لكم العمل أو تمويل لاستراتيجيتك الانضمام إلى مجتمعنا لدينا واحدة من أكبر المجتمعات التجارية الكمية في العالم، وبناء وتقاسم ومناقشة الاستراتيجيات من خلال مجتمعنا. التحدث مع بعض من ألمع العقول في العالم ونحن استكشاف عوالم جديدة للعلوم والرياضيات والمالية.

No comments:

Post a Comment