Friday 26 January 2018

جون إهلرز نظام التداول


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

جون إهلرز ".
نأمل أن تستمتع هذا المعرض.
جون إهلرز، المطور من ميسا، وقد كتب ونشر العديد من الأوراق المتعلقة بالمبادئ المستخدمة في دورات السوق. يتم عرض ملخصات للأوراق المتاحة أدناه. تحميل كل عن طريق تحديد النص التشعبي المرتبطة بها.
لماذا التجار تفقد المال (وماذا تفعل حول ذلك)
مقال في عدد مايو 2017 من الأسهم & أمب؛ وصفت مجلة السلع كيفية إنشاء منحنيات الأسهم الاصطناعية من خلال معرفة فقط عامل الربح والفائزين في المئة من استراتيجية التداول. كما يتم تضمين إحصاءات منحنى بيل لتداول الأسهم التي تم اختيارها عشوائيا وتداول المحفظة. هذا هو جدول بيانات إكسيل التي تمكنك من تجربة هذه الوصفات الإحصائية من أداء نظام التداول.
المؤشرات التنبؤية لاستراتيجيات التداول الفعالة.
يدرك التجار الفنيون أن المؤشرات تحتاج إلى تسهيل بيانات السوق لتكون مفيدة، وأن التمهيد يدخل التأخير كأثر جانبي غير مرغوب فيه. ونحن نعلم أيضا أن السوق هو كسورية. يظهر الرسم البياني الفاصل الأسبوعي مثل الرسم البياني الشهري أو اليومي أو اليومي. ما قد لا يكون واضحا تماما هو أنه مع زيادة الفاصل الزمني على طول المحور س، يتزايد تقلبات السعر من الأعلى إلى الأدنى على طول المحور ص أيضا، تقريبا في نسبة. وتؤدي ظواهر "توسع الطيف" هذه إلى تشويه غير مرغوب فيه، وهو ما لم يتم التعرف عليه أو تجاهله إلى حد كبير من قبل مطوري المؤشرات وفنيي السوق.
استنتاج استراتيجيات التداول من وظائف الكثافة الاحتمالية المقاسة.
وكان هذا الفائز الوصيف في جائزة 2008 تشارلز H. داو متا. في هذه الورقة أظهروا الآثار المترتبة على أشكال مختلفة من ديترندينغ وكيف يمكن استخدام توزيعات الاحتمالية الناتجة كاستراتيجيات لتوليد أنظمة التداول الفعالة. تتم مقارنة نتائج هذه الأنظمة التجارية القوية مع النهج القياسية.
هذه الورقة تظهر وسيلة تفاعلية للقضاء على تأخر بكثير كما هو مطلوب من مرشحات تمهيد. وبطبيعة الحال، انخفاض تأخر يأتي بسعر انخفاض نعومة التصفية. لا يظهر المرشح أي تجاوزات عابرة موجودة عادة في المرشحات ذات الترتيب الأعلى.
الوضع التجريبي التحلل.
نهج جديد لدورة واتجاه وضع الكشف.
تحويل فورييه للتجار.
المشكلة مع تحويل فورييه لقياس دورات السوق هو أن لديهم قرار ضعيف للغاية. في هذه الورقة تظهر كيفية استخدام تحويل غير الخطية آخر لتحسين القرار بحيث تحويل فورييه قابلة للاستخدام. يتم عرض الطيف المقاس كخريطة حرارية.
مؤشر سكين الجيش السويسري.
المؤشرات هي مجرد الردود على نقل بيانات المدخلات. من خلال تغيير بسيط للثوابت، يمكن أن يصبح هذا المؤشر إما، سما، 2 القطب غوسيان مرشح منخفض، 2 القطب بوترورث ممر منخفض مرشح، أو أكثر سلاسة، مرشح الموجة، أو مرشح باندستوب.
تصفية إهلرز.
يتم وصف مرشح غير محدد لخطأ معلومات الطيران. هذا المرشح هو من بين الأكثر استجابة لتغيرات الأسعار ولكن أسلس في الأسواق الجانبية.
تقييم أداء النظام.
عامل الربح (الأرباح الإجمالية مقسوما على الخسائر الإجمالية) يشبه عامل العائد في الألعاب. وهكذا، عندما يتم الجمع بين عامل الربح مع الفائزين النسبة المئوية في سلسلة من الأحداث العشوائية، وحالات كيف يمكن محاكاة نمو الأسهم استراتيجية التداول. تصف هذه الورقة كيف ترتبط واصفات الأداء الشائعة بهاتين المعلمتين. يتم وصف جدول بيانات إكسيل، مما يسمح لك بإجراء تحليل مونت كارلو لأنظمة التداول الخاصة بك إذا كنت تعرف هذه المعلمات اثنين (من العينة).
فراما (فراكتال المتوسط ​​المتحرك التكيفي). يتم اشتقاق المتوسط ​​المتحرك غير الخطية باستخدام أس هورست.
ماما هي أم جميع المتوسطات المتحركة التكيف. أكتوالي الاسم هو اختصار ل ميسا المتوسط ​​المتحرك التكيفي. يتم إنتاج العمل غير الخطية من هذا المرشح من قبل فلايباك المرحلة كل دورة نصف. عندما يقترن مع فاما، المتوسط ​​المتحرك التكيفي التالية، وشركات الانتقال تشكل إشارات الدخول والخروج ممتازة التي هي نسبية خالية من السياط.
الوقت الاعوجاج دون السفر الفضاء.
وتستخدم لاغوير متعددو الحدود لتوليد بنية مرشح مماثلة لمتوسط ​​متحرك بسيط مع الاختلاف أن التباعد الزمني بين الصنابير مرشح غير نينيار. والنتيجة تمكن من إنشاء مرشحات قصيرة جدا وجود خصائص التمهيد مرشحات أطول بكثير. تعني الفلاتر الأقصر تأخيرا أقل. وتتجلى مزايا استخدام متعددو الحدود لاقوير في المرشحات في كل من المؤشرات وأنظمة التداول الآلي. تتضمن المقالة رمز إيسيلانغواج.
و سغ المذبذب.
و سغ المذبذب هي فريدة من نوعها لأنه هو مذبذب على حد سواء على نحو سلس ولها صفر تأخر. ويجد مركز الثقل (سغ) لقيم الأسعار في مرشح معلومات الطيران. ويتمتع سغ تلقائيا بتجانس فلتر معلومات الطيران (على غرار المتوسط ​​المتحرك البسيط) مع وضع سغ في مرحلة معينة مع حركة السعر. يتم تضمين رمز إيسيلانغواد.
باستخدام تحويل فيشر.
تم تصميم العديد من أنظمة التداول باستخدام افتراض أن التوزيع الاحتمالي للأسعار له توزيع عادي، أو غوسي، الاحتمال حول المتوسط. في الواقع، لا شيء يمكن أن يكون أبعد من الحقيقة. تصف هذه الورقة كيفية تحويل فيشر تحويل البيانات إلى ما يقرب من توزيع احتمال عادي. وبالنظر إلى احتمال توزيع عادي بعد تطبيق فيشر ترانسفورم، وتستخدم البيانات لإنشاء نقاط الدخول مع الدقة الجراحية. تتضمن المقالة رمز إيسيلانغواج.
تحويل فيشر معكوس.
تحويل فيشر معكوس يمكن استخدامها لتوليد مذبذب أن يتحول بسرعة بين ذروة البيع و ذروة الشراء دون سياط.
مرشحات غاوسية.
لاغ هو سقوط مرشحات تمهيد. توضح هذه المقالة كيف يمكن تخفيض الفارق الزمني ويتم الحصول على أعلى درجة تمهيد الدقة عن طريق الحد من تأخر مكونات عالية التردد في البيانات. يتم توفير جدول كامل لمعامل التصفية غاوس.
البولنديون والأصفار.
وصف للمرشحات الرقمية من حيث Z تحويلات. وتوصف تشعبات المرشحات ترتيب أعلى. وتعطى الجداول من معاملات ل 2 القطب و 2 القطب مرشحات بوترورث.
بالنسبه لشركتنا.
ميسا البرمجيات متخصصة في تحليل بيانات السوق في مجال التردد. نحن نأخذ النهج العلمي في تطوير المرشحات، والمؤشرات، وأنظمة التداول ومن ثم استخدام الإحصاءات للتحقق من الأداء.

نظام التداول جون إهلرز
مؤشرات جون إهلرز: لقد جمعت معظم المؤشرات في هذه الصفحة من كتب إهلرز. وقد أجريت بعض التعديلات للتوضيح أو لجعلها تعمل بشكل سليم. وقد تحققت جميعها في ترادستاتيون ولكن لا ضمانة أي ضمانات الكمال أو وظيفة سليمة. تم تطوير صيغة ميسا (التحليل الطيفي الأقصى للأنتروبيا) والتي تستخدم في العديد من هذه المؤشرات لتفسير المعلومات السيزموغرافية للتنقيب عن النفط. وقد تم تكييفها هنا لقياس دورات السوق - فهي تنتج مخرجات عالية الدقة ذات كميات استثنائية من المعلومات، وهي مزيج مثالي لتقييم السوق.
ماما فاما المؤشر: - ماما لتقف على ميسا المتوسط ​​المتحرك التكيف (وقد أطلق عليه أيضا اسم الأم من جميع المتوسطات المتحركة). هذا هو ما الذي يضبط نفسه إلى أعلى / أسفل دورات وقوية جدا - أنا تخطط لدمجها في بعض الاستراتيجيات قريبا.
فيشر ترانسفورم إنديكاتور: هذا مؤشر سريع للتبادل التجاري عبر كروسوفر، وإذا ما استخدم بالاقتران مع أداة جيدة للاتجاه، فإنه تنبؤي ويمكن تطبيقه في الاستراتيجيات (قريبا). بالمقارنة مع ماسد أو مؤشرات كروس أخرى فيشر تحويل واضح بشكل واضح وفي الوقت المناسب.
مؤشر الاتجاه لحظية (إترند): مؤشر الاتجاه مع ما يقرب من الصفر تأخر وعن نفس تمهيد كما إما. يتم إنشاء إشارات التجارة عن طريق عبور خط الزناد وخط إترند.
مركز مؤشر الجاذبية: إهلرز مذبذب آخر - أنا لم تجرب كثيرا مع هذا واحد - قد تتطلب مؤشرا الاتجاه إضافية للمساعدة في وظيفة أفضل - هل الاختبار الخاص بك.
مؤشر دورة السيبرانية: مؤشر إهلرز المبكر الذي يحاول قياس دورات السوق.
مؤشر قياس الدورة: نفس مؤشر دورة الدورة. مؤشر آخر قياس دورة، أكثر قوة من واحد أعلاه، ولكن مع سطر واحد فقط - لا عمليات الانتقال.
فيشر مؤشر دورة الإنترنت: مؤشر قياس دورة مع تعديل فيشر التحويل.
مؤشر النشاط النسبي: مفهوم رفي هو أن الأسعار تغلق أعلى مما تفتح في مكتس و v. v. في أسفل مكتس. رفي هو مذبذب حيث يتم تطبيع الحركة إلى نطاق التداول من كل شريط. ويستخدم أربعة بار متناظرة مرشحات تأخر إلغاء معلومات الطيران لإنتاج مؤشر قابل للقراءة.
ستوشاستيك سغ مذبذب: Rev.10 / 01/08 تم تعديل عدة مؤشرات مع خوارزمية عشوائية. في بعض الحالات هذا يحسن الأداء ولكن ليس بشكل ملحوظ.
فيشر ستوكاستيك سغ مذبذب: مؤشر فيشر ستوكاستيك سغ / مذبذب يشبه المذبذب ستوشاستيك سغ ولكن مع انعكاسات أكثر وضوحا وإشارات سابقة في بعض الأحيان.
مؤشر ستوكاستيك رفي: Rev.10 / 01/08 - The مفهوم رفي هو أن أسعار إغلاق أعلى مما تفتح في مكتس و v. v. في أسفل مكتس. رفي هو مذبذب حيث الحركة.
تطبيع إلى نطاق التداول من كل شريط. ويستخدم أربعة بار متناظرة مرشحات تأخر إلغاء معلومات الطيران لإنتاج مؤشر قابل للقراءة.
وهذه المؤشرات التكيفية أكثر استجابة من نظيراتها الثابتة (غير التكيفية). وهي تهدف إلى القضاء على تأخر. ومن المفترض أن تكون الموجة الجيبية (قريبا) تنبؤية.
مؤشر موجة جيبية: نشر 8/27/08 - يحاول هذا المؤشر تحديد المرحلة الحالية من دورة كنت في، لديه ميزة على مؤشرات التذبذب الأخرى مثل مؤشر القوة النسبية ومؤشر ستوكاستيك لأنه يتنبأ بدلا من الانتظار لتأكيد. سو يعطي إشارات الدخول والخروج 1/16 من فترة دورة قبل نقطة تحول دورة ونادرا ما يعطي إشارات ساذجة كاذبة عندما يكون السوق في وضع الاتجاه.
ستوشاستيك مؤشر القوة النسبية الاستراتيجية: هذه الاستراتيجية على أساس بعض مؤشرات إهلرز تظهر نتائج إيجابية وتستحق بعض التجارب الأخرى. وسأواصل العمل على ذلك.
مؤشر موجة جيبية إضافية؛ 8/27/08 أنا لا أعرف من أين حصلت على هذا الرمز - لا تجميعها من قبلي. هذا لا يطابق إهلرز معلومات من كتابي - قد يتم تجميعها من كتاب سابق. فإنه يعرض مماثلة ولكن ليست متطابقة لمؤشر موجة جيبية أعلاه - ربما شخص ما إعادة التكيف من التعليمات البرمجية له.
أغسطس 2009 - تلقيت ملاحظة من ويلي، وهو تاجر يقول أن هناك أخطاء في هذا الرمز موجة جيبية. وقدم نسخة منقحة - لينك.
على الرغم من أنني لم تعد تستخدم ترادستاتيون لاختبار أو التداول، تبقى هذه الرموز هنا لأي شخص مهتم، ولكن استخدام على مسؤوليتك الخاصة. هذه الرموز كلها لأغراض الاختبار فقط، نشرت أصلا لبلدي وصول والآخرين الذين يعملون معي في مشاريع التنمية، انكم مدعوون الى الاستفادة من هذه الصفحات لتجريب الخاص بك. ولا يطالب بأي ضمانات للاستقرار أو الربحية.
ملاحظة # 2 - نشر 4/15/2017: لأي شخص يختبر هذه الاستراتيجيات إهلرز في مولتيشارتس، تم تحميل أوبودلواد رموز من قبل مستخدم مولتيشارتس ويمكن تحميلها بتنسيق ملف. pla عبر الرابط التالي. - - - - رموز مولتيشارتس - - - -

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

كوانسترات ترادر.
التداول، كوانتسترات، R، وأكثر من ذلك.
أرتشيفس: الدكتور جون إهلرز.
إهلرز & # 8217؛ s فترة الترابط الذاتي.
هذا المنصب سيعرض آلية جون إهلرز & أوتوريلاتيون بيريودوغرام & # 8211؛ آلية مصممة لإيجاد فترة رد فعل حيوي. وهذا هو، المعلمة الأكثر شيوعا الأمثل في باكتيستس هي فترة الاسترجاع.
قبل البدء في هذا المنصب، يجب أن أعطي الفضل حيث أنه يعود إلى السيد فابريزيو ماكاليني، رئيس المشتقات المنظمة في أسواق نوردا في لندن. يمكنك العثور على بقية المستودع الذي قام به الدكتور جون إهلرز & # 8217؛ ق تحليلات دورة للتجار على جيثب له. أنا ممتن وشرف أن هؤلاء الأفراد ذكاء وذوي الخبرة تساعد على جلب بعض طرق الدكتور إهلرز & # 8217؛ إلى R.
نقطة من فترة إهلرز الارتباط الذاتي هو تعيين حيوي فترة بين الحد الأدنى وطول الفترة القصوى. بينما أترك التفسير الدقيق للميكانيكي لكتاب الدكتور إهلرز & # 8217؛ s، لجميع النوايا والأغراض العملية، في رأيي، فإن هذه الطريقة هي محاولة لإزالة مصدر هائل من الإفراط في الحيازة من إنشاء نظام التداول & # 8217؛ 8211؛ وتحديد فترة الاستعراض.
سما من 50 يوما؟ 100 يوم؟ 200 يوم؟ حسنا، هذه الخوارزمية تأخذ هذا الاحتمال من الإفراط في الخروج من يديك. ببساطة، حدد الحد العلوي والسفلي لاسترجاع الخاص بك، وأنه لا بقية. ما مدى نجاحه هو موضوع مناقشة لأولئك الذين لديهم دراية جيدة في منهجيات الهندسة الكهربائية (أنا & # 8217؛ لا)، لذلك لا تتردد في ترك التعليقات التي تناقش مدى خوارزمية القيام بعملها، وتتردد في بلوق عن ذلك أيضا.
في أي حال، هنا & # 8217؛ s خوارزمية الأصلي رمز، من باب المجاملة من السيد ماكاليني:
شيء واحد أنا لاحظت أن هذا الرمز يستخدم حلقة تقول ل (ط 1 في: طول (فيلت))، وهو O (نقاط البيانات) حلقة، والتي أرى كما الطاعون في R. بينما أنا & # 8217؛ في استخدام رسب قبل، فإنه & # 8217؛ ق كان فقط لأبسط الحلقات، لذلك هذا هو بالتأكيد المكان الذي يمكن أن تقف خوارزمية إلى تحسين مع رسب بسبب R & # 8217 الصورة الحلقات الفقيرة المتأصلة.
المهتمين في منطق الدقيق من الخوارزمية، مرة أخرى، العثور عليه في جون إهلرز & # 8217؛ ق تحليلات دورة لكتاب التجار (انظر الرابط في وقت سابق من هذا المنصب).
بطبيعة الحال، فإن أول شيء يجب القيام به هو اختبار مدى الخوارزمية يفعل ما يدعى القيام به، وهو لتملي فترة الاسترجاع من خوارزمية.
السماح بتشغيله على بعض البيانات.
الآن، ماذا تبدو فترة الاسترجاع الخوارزمية؟
دعونا التكبير في 2001 إلى 2003، عندما ذهبت الأسواق من خلال بعض الاضطرابات.
في هذه الصورة المكبرة، يمكننا أن نرى أن تقديرات الخوارزمية & # 8217؛ s تبدو ثابتة إلى حد ما.
هنا بعض التعليمات البرمجية لإطعام خوارزمية & # 8217؛ s تقديرات n إلى مؤشر لحساب مؤشر مع فترة الاسترجاع الديناميكي كما هو محدد من قبل إهلرز & # 8217 s الارتباط الذاتي.
وهنا هي وظيفة تطبيقها مع سما، لضبط ما بين 120 و 252 يوما.
كما رأينا، هذه الخوارزمية أقل اتساقا مما أود، على الأقل عندما يتعلق الأمر باستخدام المتوسط ​​المتحرك البسيط.
في الوقت الحالي، سأغادر هذا الرمز هنا، وأسمح للأشخاص بتجربته. آمل أن يجد شخص ما أن هذا المؤشر مفيد لهم.
شكرا للقراءة.
ملاحظات: أنا دائما مهتم في الشبكات / لقاء المنبثقة في شمال شرق (فيلادلفيا / مدينة نيويورك). وعلاوة على ذلك، إذا كنت تعتقد أن شركتك سوف تستفيد من مهاراتي، لا تترددوا في التواصل معي. يمكن العثور على الملف الشخصي لينكدين هنا.
وأخيرا، أنا التطوع لتنظيم قسم R للكتب عن الكوموقراطية. إذا كان لديك كتاب حول R التي يمكن أن تنطبق على التمويل، تأكد من اسمحوا لي أن أعرف عن ذلك، حتى أستطيع أن مراجعة ذلك وربما التوصية به. ثاكن لك.
A جون إهلرز أوزيلاتور & # 8212؛ دورة مؤشر القوة النسبية (2)
منذ أن كنت قد ضربت في الاتجاه التالي (كيف يمكنك تحديد ارتفاع / هبوط / شقة؟ ما يعرف حتى تلك المصطلحات الثلاث في تعريف دقيق، آلة؟ كيف يمكنك تجنب شراء قمم في حين لا تحصل المفروم من قبل السياط؟)، قررت أن ننظر بطريقة أخرى، مع مؤشرات التذبذب. بالتأكيد، أنا & # 8217؛ م ليست مستعدة للتخلي عن الدكتور إهلرز فقط حتى الآن. لذلك، في هذا المنصب، أنا & # 8217؛ ليرة لبنانية إدخال ابتكار الأخيرة من مؤشر القوة النسبية من قبل الدكتور جون إهلرز.
المؤشر مؤشر رسي المعدل من د. إهلرز & # 8217 من الفصل 7 من تحليلات دورة للتجار.
بالنسبة للمبتدئين، هنا كيف أن مؤشر القوة النسبية إهلرز يختلف عن تلك المعتادة: يتم تصفيته بمرشح تمريرة عالية ومن ثم تمهيده بمرشح سوبيرسموثر. في حين تطرق مايكل كابلر أيضا حول هذا الموضوع في حين يعود، أفترض أنه يمكن & # 8217؛ ر يضر إذا حاولت أن أتطرق إلى نفسي.
هنا هو مرشح تمرير عالية والسوبر أكثر سلاسة، من ملف util. R في دسترادينغ. لم يتم تصديرها منذ اللحظة، فهي مجرد مكونات لمؤشرات أخرى.
باختصار، كل من هذه الوظائف تعمل على تمهيد الأسي على البيانات باستخدام بعض الكميات المثلثية المحسوبة بشكل ثابت، والأساس المنطقي الذي سوف أؤجل ببساطة لكتاب الدكتور إهلرز & # 8217؛ ق (الرابط هنا).
هنا & # 8217؛ s إهلرز المعدل رسي، الذي أسميه سيكلرسي، من الكتاب الذي هو & # 8217؛ s محددة:
هنا صورة تقارن أربعة مؤشرات رسي منفصلة.
الأول هو مؤشر القوة النسبية ظهرت في هذا المنصب (دورة رسي) باللون الأزرق. التالي هو مؤشر القوة النسبية الأساسي (2) باللون الأحمر. واحد بعد ذلك هو لاري كونورس & # 8217؛ ق كونورس رسي، والتي قد يتم لمسها في المستقبل، وآخر واحد، باللون الأرجواني، هو رسي لاغور المعمم، وهو آخر إنشاء الدكتور إهلرز (الذي أنا & # 8217 ؛ ليرة لبنانية لديك لاختبار في وقت ما في المستقبل).
لبدء الأمور مع مؤشر القوة النسبية دورة، قررت لرمي استراتيجية بسيطة من حوله:
شراء عندما سيكلرسي (2) يعبر تحت 10 عند الإغلاق فوق SMA200، والذي هو في إطار استراتيجية التداول لاري كونورس من & # 8220؛ استراتيجيات التداول إتف قصيرة الأجل أن العمل & # 8221؛ (سواء كانت تعمل أم لا تظل قابلة للنقاش)، وبيع عند سيكلرسي (2) يعبر فوق 70، أو عندما ينخفض ​​إغلاق تحت SMA200 بحيث لا يتم القبض على استراتيجية في الاتجاه الهبوطي هارب.
وبما أن الإستراتيجية تأتي من دفتر تداول إتف، قررت استخدام مجموعة بيانات إتف القديمة، من عام 2003 حتى عام 2018.
في ما يلي شفرة الإستراتيجية، كالمعتاد:
وهنا النتائج:
وعموما، فإن الإحصاءات دون & # 8217؛ ر تبدو سيئة. ومع ذلك، فإن العائد السنوي 1: 1 إلى الحد الأقصى للسحب لا يسر بشكل خاص، لأنه يعني أنه لا يمكن الاستفادة من هذه الاستراتيجية بفعالية للاستمرار في الحصول على عوائد كبيرة في هذه الحالة. مزعجة جدا. هنا & # 8217؛ s منحنى الأسهم.
باختصار، كما هو الحال مع غيرها من العوائد المتوسطة، عندما يحدث السحب، فإنها تحدث بسرعة نسبيا وبوحشية.
هنا & # 8217؛ s موقف موقف أداة فردية.
من وجهة نظر الأشياء، فإن الاستراتيجية الأفضل في السوق الذي يطحن صعودا، بدلا من سوق جانبية متقلبة تماما.
وأخيرا، هنا & # 8217؛ ق بعض التعليمات البرمجية لرسم كل الصفقات المختلفة.
والمؤامرة الناتجة:
واحد آخر شيء أن نلاحظ & # 8230؛ أن $ 50،000 التجارة في الزاوية اليسرى العليا؟ كان هذا هو قضية البيانات ياهو وهو طباعة كاذبة. أبعد من ذلك، مرة أخرى، وهذا يبدو وكأنه أجرة القياسية لمتوسط ​​ريفرتر & # 8211؛ عندما الصفقات تذهب سيئة، انهم & # 8217؛ ري * حقا * سيئة، ولكن اللغز من أين وضع وقف هو قضية منفصلة تماما، كما هو وعادة ما يعني تأمين في الكثير من الخسائر التي تنخفض في الحجم، جنبا إلى جنب مع ربما تحول الفائزين إلى الخاسرين. على الجانب الآخر، هنا & # 8217؛ s الحد الأقصى مؤامرة رحلة مؤاتية.
وباختصار، هناك بالتأكيد الصفقات التي كان يمكن وقفها من أجل الربح الذي تحول إلى الخاسرين.
في الختام، في حين أن نظام التداول الأولي يبدو أن بداية جيدة، انها & # 8217؛ s بعيدا عن الاكتمال.
شكرا للقراءة.
آخر التقلب فشل تقطعي: إهلرز & # 8217؛ s فكرة خاصة.
هذا الأسبوع، حاولت استخدام إهلرز & # 8217؛ s فكرة من هذا العرض التقديمي.
بشكل أساسي، الفكرة هي أنه عندما يكون المؤشر ثابتا، يمكن أن تؤدي المعابر الخطية إلى انحرافات، وبالتالي إضافة جزء من النطاق اليومي للمؤشر المتخلف، ومعرفة ما إذا كان المؤشر غير المتخطى يتجاوز العتبة. وفي هذه الحالة، يتم استخدام نطاق يومي ممتد أضعافا يستخدمه لحساب النطاقات. ركضت هذا من عام 2018 حتى يومنا هذا في وقت كتابة هذا التقرير (14 يوليو، 2017)، حيث أن الرابط الأصلي يمر عبر معظم العقد الأول من القرن الحادي والعشرين. (أيضا، تأكد من أنك تستخدم أحدث حزمة إكترادينغ الخاصة بي، حيث قمت بتحديث وظيفة كواندكلان للتعامل مع بعض قضايا البيانات الفوضى اللحظية التي مرت دون أن يلاحظها أحد.)
الإعدادات التي استخدمتها هي الإعدادات الأصلية ل جون إهلرز & # 8217؛ & # 8212؛ أي فترة تحليل مدتها 20 يوما، وهي عبارة عن تجانس للنطاق الأسي لمدة 10 أيام (أي أن النطاق يتم حسابه على أنه 0.1 * (منخفض-منخفض) + 9 * باند)، يدخل عند النسبة B (أي، التيار فراما ناقص الفرقة منخفضة على الفرق من العصابات)، وجزء هو 1 / 10th من النطاق اليومي.
وهنا المؤشر المستخدم:
وهنا & # 8217؛ s رمز الاستراتيجية:
في ما يلي النتائج:
باختصار، انها خاسر على مدى السنوات الثلاث الماضية. هنا & نبسب؛ منحنى الأسهم:
الآن في حين أنها قد عملت في الماضي (أو شيء من هذا القبيل، وذلك باستخدام إهلرز & # 8217؛ s مؤشر التصفية)، فإنه لا يبدو أن تفعل ذلك للمضي قدما.
أنا & # 8217؛ ليرة لبنانية ترك هذا هنا الآن كمظاهرة لكيفية القيام إهلرز العصابات.
شكرا للقراءة.
التقشفية: أول محاولة.
لذا في المرة الأخيرة التي حاولت فيها استراتيجية فراما مع عمليات الانتقال السعرية، كانت المشكلة أنه بسبب الفشل المعاكس للاتجاه، فإن المرشح الذي تمت إضافته قد غاب عن الكثير من الصفقات الجيدة، وجرح حتى فقدان الكثير من المال خلال الأسواق المسطحة التي مرت مرشح التعسفي.
يحاول هذا النظام التجاري تصحيح تلك القضايا من خلال تداول فراما ارتفاع تصفيتها على نسبة انحراف معياري لمدة 5 أيام.
الفرضية هي: فراما ترتفع في الأسواق تتجه بشكل شرعي، ويبقى ثابتا في الأسواق متقلبة. ولذلك، فإن نسبة الانحرافات المعيارية (أي الانحراف المعياري للفرما عن الانحراف المعياري لإغلاق السوق) ينبغي أن تكون أعلى خلال الأسواق المتجهة، وأقل خلال الأسواق المتقلبة. بالإضافة إلى ذلك، حيث أن هذه النسبة تتساقط في الصفر وعادة ما ترتفع في 1 (نادرا ما يحصل على أعلى)، ويمكن استخدامه كمؤشر عبر الصكوك من خصائص مختلفة إلى حد كبير.
البيانات التي سيتم استخدامها سوف يكون ملف بيانات العقود الآجلة (دون الأموال الاتحادية، القهوة، أو السكر، بسبب قضايا البيانات).
هنا & # 8217؛ ملف البيانات:
وهنا الاستراتيجية:
لاحظ أن المخرج بسبب مرشح التقلب كان يجب أن يعلق عليه (لأنه تسبب في الاستراتيجية لتفقد كل حافة). على أي حال، و فراما هو المعتاد 126 يوم فراما، والانحراف المعياري هو 5 أيام، في محاولة للحد من تأخر. وتكون عتبة نسبة الانحراف المعياري هي 0.2 أو أعلى. في ما يلي النتائج:
وبعبارة أخرى، نتائج متتبع الاتجاه النموذجي. 40/60 الخطأ إلى اليمين، مع فوز 2: 1 لنسبة الخسارة. بعيدا عن مذهلة.
وباختصار، فإن الفائزين يستمرون لفترة أطول من الخاسرين، وهذا أمر منطقي بالنظر إلى أن هناك الكثير من الانحرافات، وأن هذه استراتيجية تتبع الاتجاه.
38٪. فكيف أدائها؟
مثله. لا سيما كبيرة، معتبرا انها & # 8217؛ s 60٪ كسب أكثر من 11 عاما. وفيما يلي الإحصائيات الخاصة:
وبعبارة أخرى، حوالي 10 نقطة أساس من العائدات في المائة من التعرض للسوق، أو عائد سنوي بنسبة 10٪. المشكلة هي؟ إن السحب هو أعلى بكثير من العائد السنوي، وهذا يعني أن الرافعة المالية سوف تجعل الأمور أسوأ فقط. في الأساس، لانخفاض العائد على التعرض وخفض عالية إلى العائد السنوي، هذه الاستراتيجية هو الفشل. في حين أن منحنى الأسهم الصاعد باطراد جيد، فإنه لا معنى له عندما يستغرق أسوأ الخسائر أكثر من عام للتعافي من.
في أي حال، هنا & # 8217؛ ق نظرة على بعض الصكوك الفردية.
هنا & # 8217؛ s منحنى الأسهم ل e-- مينيس.
حتى أولا، يمكننا أن نرى ميزة واحدة صغيرة من هذه الاستراتيجية & # 8211؛ نظرا لدخول وخروج لا متماثلة (أي أنه يأخذ شرطين لدخول & # 8211؛ ارتفاع فراما ونسبة الانحراف المعياري أعلاه .2 & # 8211 & # 8211؛ 8211؛ والخروج فقط على واحد منهم (الوقوع فراما)، والعمل السعر الذي يظهر طحن مطرد صعودا، وذلك بسبب التغير السريع في أتر (انها & # 8217؛ سا 10 يوما الرقم) يمكن فعلا الهرم قليلا من وقت لآخر. هذه هي ميزة جيدة في رأيي، لأنها يمكن أن تضيف على موقف الفوز، ولكن في أوقات التقلب الشديد، عندما حتى مؤشر تكيف يمكن أن ترتد حول مطاردة & # 8220؛ الاتجاهات الصغيرة & # 8221 ؛، يمكننا أن نرى خسائر كومة على.
بعد ذلك، دعونا ننظر إلى وضع أسوأ بكثير. هنا & # 8217؛ s منحنى الأسهم ل يورودولار / تيد انتشار.
في هذه الحالة، فإنه من الواضح أن الاستراتيجية لديها مشاكل عكسية، فضلا عن حقيقة أن نسبة الانحراف المعياري لمدة 5 أيام يمكن أن تكون قصر النظر نسبيا عندما يتعلق الأمر بالأدوات التي لها فترات طويلة من الخمول الكامل & # 8211؛ وهذا هو، فإن السوق ليست متقلبة حتى بقدر ما لا يزال فقط.
أنا & # 8217؛ ليرة لبنانية ترك هذا هنا، والانتقال إلى محاولات أخرى للالتفاف حول هذا النوع من حاجز المقبل.
شكرا للقراءة.
فراما الجزء الخامس: التفاف على مؤشر تأكيد / عينة الاختبار.
لذلك، فمن الممكن لإنشاء نظام التداول التي يمكن أن يعزل بشكل صحيح الانتكاسات الشديدة والمطولة، دون اتخاذ (الكثير جدا) إشارات كاذبة.
في ما يلي القواعد:
126 يوم فراما، فك = 4، سك = 300 (نحن & # 8217؛ لا يزال تعديل استراتيجية إتفهق الأصلية).
وسيط التشغيل (ما بين 150 يوما و 252 يوما & # 8211؛ على ما يبدو، كل هذه التهيئات تعمل).
يجب أن يتحرك كل من فراما والمتوسط ​​التوكيدى في نفس الاتجاه (صعودا للتداول الطويل، لأسفل للتجارة القصيرة & # 8211؛ متوسط ​​الارتفاع هو القاعدة الجديدة هنا)، ويجب أن يعبر السعر فراما في هذا الاتجاه إلى الدخول في التجارة، في حين الخروج عندما يعبر السعر تحت فراما. تظهر كمجموعة من القواعد كوانسترات، فإنه يحصل طويلا إلى حد ما، لأن القاعدة تحتاج إلى تحديد شروط الإعداد الثلاثة، قاعدة لربط لهم معا، وقاعدة خروج (5 قواعد كل جانب).
تعمل الاستراتيجية على كل من النهايات الطويلة والقصيرة، على الرغم من أن النسخة القصيرة تبدو أكثر من استراتيجية التأمين من أي شيء آخر. وهنا & # 8217؛ s منحنى الأسهم لمتوسط ​​150 يوم:
في الأساس، فإنه يجعل المال في فترات رهيبة، ولكن يعطي بعض من العودة مرة أخرى خلال أي وقت آخر. انها هناك فقط لوضعه هناك شيء يمكن أن تحاول في نهاية المطاف وعزل الظروف الحقير حقا وتعطيك البوب ​​في تلك الأوقات. بخلاف ذلك؟ ويعتمد استخدامه على عدد المرات التي يعتقد فيها شخص ما أن هذه الأنواع من شروط السحب سوف تحدث & # 8211؛ أي مؤشر تنازلي تنازلي، متوسط ​​تنازلي 7-12 شهرا.
وفيما يلي إحصاءات التجارة والمحفظة:
وبعبارة أخرى، انها ليست على الإطلاق استراتيجية مستقلة، ولكن أكثر من شيء قليلا لإعطاء استراتيجية طويلة فقط دفعة خلال الأوقات السيئة. انها & # 8217؛ ق بالتأكيد ليست مذهلة كما يحصل. على سبيل المثال، هنا منحنى الأسهم ل زلك في أواخر 2008-2009. أساسا، المشكلة مع استراتيجية إتفهق (أنا & # 8217؛ م لا يزال على ذلك، نعم) هو أنه لا يأخذ في الاعتبار على الإطلاق حجم اتجاه المؤشر. وهذا يعني أنه في سوق عائد، فإن هذه الاستراتيجية لديها احتمال أن تفقد قدرا كبيرا من المال دون داع.
في الأساس، هذه الاستراتيجية هي محافظة للغاية، وهذا يعني أن لديها ميل لتفويت الصفقات الجيدة، واتخاذ غير الضرورية، وهي معيبة عموما لأنه لا يوجد لديه وسيلة لتقدير حقا منحدر فراما.
As the possible solution to this involves a strategy by John Ehlers, I think I’ll leave this strategy here for now.
So, to send off this original ETFHQ price cross strategy off, I’ll test it out of sample using a 200-day median, using both long and short sides (from 2018-03-01 to get the 200 day median burned in, to the current date as of the time of this writing, 2017-06-20).
Here are the trade stats and portfolio stats:
With the corresponding equity curve:
In short, definitely not good. لماذا ا؟
Here’s a good symptom as to why:
This is the out-of-sample equity curve of SHY–that is, the ETF of short term bonds. The trend had ended, but the trading system didn’t pick up on that.
In this case, you can see that the magnitude of the trend makes no difference to the strategy–which is a major problem. Although the counter-trend trading was eliminated, forcing action was not, and trying to remain loyal to the price crossing the indicator strategy while sticking to more conventional methods (a confirming indicator) turns out to be flawed. Here is another side symptom of a flawed system:
In this instance, using such a conservative confirmatory indicator for the short trade and simply using that same indicator for the long side indicates that there may very well have been overfitting on the system. On a more general note, however, this picture makes one wonder whether a confirmatory indicator was even necessary. For instance, there were certainly protracted periods during which there was a long trend that were cut off due to the running median being slightly negative. There were both long and short opportunities missed.
In my opinion, I think this puts the kibosh on something as ham-handed as a long-running confirmatory indicator. لماذا ا؟ Because I think that it over-corrects for a flawed order logic system that doesn’t take into account the magnitude of the slope of the indicator. Obviously, trading in a countertrend (descending indicator) is a terrible idea. But what about a slight change of directional sign as part of a greater counter-trend? Suddenly, a robust, deliberately lagging confirmatory indicator no longer seems like such a bad idea. However, as you can see, the downside of a lagging indicator is that it may very well lag your primary indicator in a good portion of cases. And it does nothing to eliminate sideways trading.
Surely, a more elegant solution exists that attempts to quantify the fact that sometimes, the smooth-yet-adaptive FRAMA can trend rapidly (and such trades should be taken posthaste), and can also go flat. Ultimately, I think that while the indicator settings from ETFHQ have some merit, the simplistic order logic on its own can certainly hurt–and coupled with an order-sizing function that downsizes orders in times of trending while magnifying them in times of calm (a side-effect of ATR, which was created to equalize risk across instruments, but with the unintended consequence of very much not equalizing risk across market conditions) can cause problems.
The next strategy will attempt to rectify these issues.
شكرا للقراءة.
FRAMA Part IV: Continuing the Long/Short Filter Search.
This post examines an n-day median filter for two desirable properties: robustness to outliers and an inherent trend-confirming lag. While this is an incomplete filter (or maybe even inferior), it offers some key insights into improving the trading system.
The strategy will be thus:
First and foremost, this will be a short-only strategy, due to the long bias within the sample period, so the stress-test of the system will be to attempt to capture the non-dominant trend (and only when appropriate).
Here’s the strategy: we will continue to use the same 126 day FRAMA with the fast constant set at 4, and a slow constant at 300 (that is, it can oscillate anywhere between an EMA4 and EMA300). We will only enter into a short position when this indicator is descending, below the 126-day median of the price action, and when the price action is lower than this indicator (usually this means a cross, not in all cases though). We will exit when the price action rises back above the indicator.
Here’s the strategy in R code:
The results aren’t pretty, meaning that the filter is still incomplete. Here are the trade stats:
At this point, for the sake of brevity, I’ll leave off the equity curves and portfolio statistics (they’ll obviously be bad). However, let’s look at some images of what exactly is going on with individual trades.
Here is the full-backtest equity curve and corresponding indicators for XLP. The FRAMA is in purple, with the 126-day median in orange, along with the 10-day ATR (lagged by a day) on the bottom.
And here we can immediately see certain properties:
1) ATR order-sizing is not a be-all, end-all type of order. It was created for one purpose, which is to equalize risk across instruments (the original idea of which, I defer to Andreas Clenow’s article). However, that is only a base from which to begin, using other scaled order-sizing procedures which can attempt to quantify the confidence in any particular trade. As it currently stands, for short strategies in equities, the best opportunities happen in the depths of rapid falling price action, during which ATR will rise. One may consider augmenting the ATR order sizing function in order to accomplish this task (or merely apply leverage at the proper time, through modifying the pctATR parameter).
2) While the running median certainly has value as a filter to keep out obviously brainless trades (E. G. in the middle of an uptrend), once the FRAMA crosses the median, anything can happen, as the only logic is that the current FRAMA is just slightly lower than the previous day’s. This may mean that the running median itself is still rising, or that the FRAMA is effectively flat, and what is being traded on is purely noise. And furthermore, with ATR order sizing amplifying the consequences of that noise, this edge case can have disastrous consequences on an equity curve.
Here’s a zoom in on 2005, where we see a pretty severe drawdown (chart time series recolored for clarity).
As can be seen, even though the FRAMA seems to be slightly rising, a price crossing when the FRAMA is lower than the previous day by even an invisibly small amount (compare the purple–the FRAMA, to the red–the same quantity lagged a day) is enough to trigger a trade that will buy a sizable number of shares, even when the volatility is too small to justify such a trade. Essentially, most of the losses in this trading system arise as a result of trading during these flat periods during which the system attempts to force action.
This pattern repeats itself. Here is the equity curve for XLB.
Again, aside from maybe a bad trade in the end thanks to any trade being taken once all three conditions line up (decreasing FRAMA, FRAMA lower than median, price lower than FRAMA) too late due to a flat FRAMA/median relationship, most of the losers seem to be trades made during very flat and calm market action, even when the running median may be going in the opposite direction of the FRAMA, during which the ATR order-sizing function tried to force action. A second filter that serves to catch these edge-case situations (or maybe a filter that replaces the running median entirely) will be investigated in the future.
So, to recap this post:
The running median filter is an intrinsically lagging but robust indicator, chosen deliberately for these two properties. It is able to filter out trades that obviously go against the trend. However, due to some edge cases, there were still a great deal of losses that were incurred, which drown out the one good shorting opportunity over this sample period. This is an issue that needs addressing.
شكرا للقراءة.
FRAMA Part III: Avoiding Countertrend Trading — A First Attempt.
This post will begin to experiment with long-term directional detection using relationships between two FRAMA indicators. By observing the relationship between two differently parametrized FRAMAs and the relationship by virtue of the ATR, it will be possible to avoid counter-trend trading on both sides. We will see this example later:
As with TVI, when the signals and rules were swapped for the short end, the equity curve was an unmitigated disaster. Unlike the flat-during-bull-runs-and-permanently-popping-up equity curve of ETFHQ, this equity curve was a disaster. For those that read the final TVI post, the equity curve looked almost identical to that–just a monotonous drawdown until the crisis, at which point the gains aren’t made up, and then the losses continue. In short, there’s no need to go into depth of those statistics.
As the link to ETFHQ suggests, we will use a longer-term FRAMA (the n=252, FC=40, SC=252 version). The market will be in an uptrend when the fast FRAMA (the FRAMA from the previous post) is above this slower FRAMA, and vice versa. Furthermore, in order to avoid some whipsaws, the fast FRAMA will have to be ascending (or descending, during a downtrend), and the entry signal will be when the price crosses over (under) the faster FRAMA, with the exit being the reverse.
In the interest of brevity, since the sample period was an uptrend, then a great deal of strategies will look good on the upside. The question is whether or not the strategy does well on the short side, as the litmus test in testing a confirming indicator is whether or not it can create a positive expectation in a strategy that is counter-trend to the dominant trend in the sample data. As this is a replication of an implied idea by ETFHQ (rather than my own particular idea), let’s look at the code for the strategy. In this instance, both the long and short end of this symmetric strategy are included, and in RStudio, commenting or uncommenting one half or the other is as simple as highlight+ctrl+shift+C.
First, a quick little side-note: since many indicators look for the word “low”, my usage of the label “slow” would cause a bug if I added the lagATR indicator after that point. So try to avoid labels such as “high”, “low”, “open”, and “close” in your indicators, or at least declare all indicators that would look for the word “low” before declaring the indicator you label in part as “slow”, if you must go this route. Low is probably the easiest one for which to overlook this, since “slow” has so many applications to confirmatory indicators. (EG: SMA fast vs. SMA slow, etc.)
Again, to reiterate, the system will take a long position when price crosses over (under) a rising (falling) fast FRAMA that’s higher (lower) than the slow FRAMA, and exit that position when the price crosses back under (over) the fast FRAMA. The cross must happen when the other two conditions are intact, as opposed to a trade being entered when all three conditions come together, which may be in the middle of a trend.
As the majority of the sample data was in an uptrend (and the fact that the Andreas Clenow-inspired ATR order-sizing function pays enormous dividends in protecting for a limited time in a counter-trend), I decided to put the (slightly modified–with the one condition of rising in an uptrend or falling in a downtrend) system to the test by testing it on the non-dominant trend in the sample–that is, to see if the system can stay out at all points aside from the crisis.
Here are the (not-so-flattering) results:
In other words, we can already see that the proposed confirmatory indicator is a dud. To display the raw instrument daily stats at this point would also be uninteresting, so we’ll move past that.
Basically, we can see that there are some really long trades that win, but between this table and the previous trade stats output, that is more than swamped by the legions of losers. Here is the market exposure:
In other words, even though the market exposure is rather small, the system still manages to hemorrhage a great deal during those small exposures, which does not sing many praises for the proposed system.
Here is the code for a cash sharpe and the equity curve comparisons:
Which gives us the following results:
In short, the idea of using a “slower” FRAMA does not seem to hold much water. And here are the portfolio statistics to confirm it:
For that, we’ll look at a picture of the equity curve of an individual instrument, complete with overlaid indicators.
Which produces the following plot:
The primary indicator is in purple, while the confirmatory indicator is in orange. And now we see the reason why: because although the FRAMA (n=252, FC=40, SC=252) is a seemingly fine parametrization in and of itself, as a “big-picture/long-term-trend/greater smoothing” indicator, it does not seem like the best choice, at least in the conventional sense as using something such as the SMA200, ROC200 > 0, or RS Rank (see this post from SystemTraderSuccess).
لماذا ا؟ Because from my intuition, adaptive moving average indicators all aim to do the same thing–they aim to be a more accurate way of aggregating lots of data in order to tell you what is happening to as close as current time as they can get. That is, if you look at the presentation by Dr. John Ehlers (see this link), you’ll notice how similar all of the indicators are. All of them effectively aim to maximize near-term smoothness and eliminate as much lag as possible. That is, if you’re looking to make short-term momentum trades that last five days, if your indicator has a five-day lag (EG a 10-day running median), well, your indicator isn’t of much use in that case, because by the time you receive the signal, the opportunity is over!
However, while eliminating lag is usually desirable, in one case, it isn’t. To go off on a tangent, the Japanese trading system called Ichimoku Kinko Hyo (which may be investigated in the future), created by Goichi Hosoda, deliberately makes use of lagging current price action to create a cloud. That is, if you want a confirmatory indicator, you want something robust (especially to the heightened volatility during corrections, bear markets, downtrends, etc.), and something that *has* a bit of lag to it, to confirm the relationship between the more up-to-date indicator (E. G. an adaptive moving average, a short-term oscillator such as RSI2, etc.), and the overarching, long-term trend.
The failure to do so in this case results in problematic counter-trend trades before the financial crisis. While the trading during the financial crisis had a very choppy equity curve during the height of the crisis itself, this was for an individual instrument, and note, that by the end of the crisis, the strategy had indeed made money. The greater problem was that due to the similarities in kind of the confirmatory indicator with the one used for entries and exits, then occasionally, the confirmatory indicator would overtake the indicator it was supposed to confirm, even in a sideways or upwards market, which resulted in several disastrous trades.
And while the indicator used for entries and exits should be as up-to-date as possible so as to get in and out in as timely a fashion as possible, a confirmatory indicator, first and foremost, should not reverse the entire system’s understanding of the market mode on a whim, and secondly, should try to be more backward looking, so as to better do its job of confirmation. Thus, in my opinion, the recommendation of this “slower” FRAMA to be used as a confirmatory indicator by ETFHQ was rather ill-advised. Thus, the investigation will continue into finding a more suitable confirmatory indicator.
شكرا للقراءة.
FRAMA Part II: Replicating A Simple Strategy.
This post will begin the investigation into FRAMA strategies, with the aim of ultimately finding a FRAMA trading strategy with less market exposure, fewer whipsaw trades, and fewer counter-trend trades. This post will also introduce new analytics regarding trade duration.
To begin the investigation into developing strategies based on the previously-introduced FRAMA, I’m going to replicate the simple strategy from ETFHQ — use a 126 day FRAMA with a fast constant of 4 (that is, an EMA that goes as fast as a 4-day EMA), and all the way up to a slow constant of 300. For my ATR order-sizing, which, once again, was inspired by Andreas Clenow in the post on leverage being pointless, I’m going to use 2 percent of notional capital, with a 10 day ATR for my order sizing (ATR 20 and 30 display slightly weaker results, but nevertheless, are very close in performance).
Once again, let’s start by looking at the strategy, using our same 30 instruments as with our TVI demos (I thought about testing on mutual funds, but due to the obnoxious fees that mutual funds charge for trying to trade with them, I feel that I’d have to employ too much magical thinking to neglect their obscene trading transaction costs):
It’s a fairly simple strategy–buy the next day’s open when the price crosses above the indicator, and vice versa. In other words, it’s about as simple a strategy as you can get as its sole purpose was to demonstrate the effectiveness of the indicator. And while someone interested can peruse through ETFHQ to find all of the indicator relative tests, the general gist is that adaptive moving averages work very well, and the FRAMA (the fractal adaptive moving average) works slightly better than the rest. Ultimately though, if one believes ETFHQ’s analysis (and I do), then even one good trend-following indicator will be sufficient.
Here are the trade statistics:
And the aggregate trade statistics:
Far from spectacular. Less than 50% hit rate, the profit factor definitely indicates that there is massive room for improvement as well.
Here are the daily statistics:
Now, I’d like to introduce some new analytics found in my IKTrading package–namely, trade duration statistics. This is a simple little function that breaks down the trades by duration, in aggregate, winners, and losers, using the usual five-number summary and the mean time. It’s programmed under the assumption that the units are days. Once you start drilling into more frequent trading, one would likely need a bit more refined analysis. However, as most freely available data occurs at the daily frequency, this function should be sufficient for most analyses.
Here is the input and output for this strategy:
From top to bottom in this transposed table (or left to right in the original), we have aggregate trade duration statistics, the same statistics on winners, and finally, losers. This paints a picture of this current strategy as having a profile of a classic trend follower: let your winners run, and cut your losses. Or, to set it to a higher standard, the occasional winner at the price of plenty of small whipsaws, with the occasional long-duration loser. Note that this loser may not have been a loser the entire time–it could very well have been a trade that was going sideways for a long time and finally sunk into negative territory near the end, but it seems that every instrument has had at least one somewhat long-running trade that wound up losing at least a penny.
On the winning side of the trade, the winning trades stay in the market for long berths, with the best ones riding waves that last for around half a year. Ultimately, this is the appeal of trend following–the idea of just getting in once, and just having the market pay you. The goal of investigating the FRAMA (and potentially other trend indicators), is to try and locate those long profit waves while avoiding the whipsaws, countertrends, and so on.
One other interesting piece of analytics I’m incorporating into this demo is the idea of market exposure–or what percentage of the time that the strategy is actually *in* the market. Here is the code and the results:
Essentially, this little piece of code takes advantage of the daily statistics output to compute market exposure. Here’s the output:
So basically, around 60-66% of the time spent in the market, most of which are short, sporadic, losing trades, with the occasional long winner.
Here’s what the equity curve looks like:
As can be seen during the crisis, this baseline strategy is taking lots of trades…for no reason at all.
And here are the three aggregate portfolio statistics:
The largest drawdown occurs during the crisis, but beyond that, the annualized returns are solid. What I find most impressive is that the annualized Sharpe Ratio over the course of this backtest, even with what seems to be a period of drawdowns that can be removed with what seems to be relative ease (most market timing trend-followers seem to do a decent job of avoiding most of the brunt of the crisis).
And finally, to demonstrate the indicator and investigate areas for improvement, here’s the equity curve of XLF (not XLB this time), since XLF lost eight dollars over the course of the backtest.
One advantage that I think the FRAMA has over the Trend Vigor is that as it is an indicator that’s superimposed directly on the price action, it’s easier to understand visually. (Also, the math is definitely more intuitive.) As we can see from the XLF equity curve, the base strategy presented by ETFHQ could certainly use a confirmatory, slower-moving indicator to keep out counter-trend trading. After all, while the tiny little whipsaw trades are undoubtedly a nuisance, correcting counter-trend trading is a lower-hanging fruit, and would seem to be more profitable in addressing.
شكرا للقراءة.
The Continuing Search For Robust Momentum Indicators: the Fractal Adaptive Moving Average.
Following from the last post and setting aside the not-working-as-advertised Trend Vigor indicator, we will turn our attention to the world of adaptive moving averages. In this case, I will be working with the FRAMA–the FRactal Adaptive Moving Average. The reason I am starting off with this one is that according to ETFHQ in this post, FRAMA is an indicator that seems to have very strong performance, even using what definitely seems to be a very simple strategy (long if the price crosses over the indicator, exit vice versa), which would most likely leave one open to whipsaws.
But before then, I’d like to make an introduction to the FRAMA, by linking to the original Dr. John Ehlers paper, here.
While I won’t attempt to give a better formal explanation than the man that created the indicator (which is why the paper is there), the way I intuitively think about the FRAMA (or the adaptive moving average family of indicators, found here) is that they are improvements of the exponential moving average that attempt to smooth the indicator during cyclical market periods to avoid whipsaws, and to have a faster response during periods of strong trends, so as to minimize the damage done due to an ending trend.
The FRAMA itself compares two periods of n/2 days (the last n/2 days, and the last n/2 days before those last n/2 days) to the total period (n days). Intuitively, if there is a straight trend upwards, then the expression (log(N1+N2)-log(N3))/log(2), where N1 is the difference of highest high and lowest low over the last n/2 days and N2 is identical except for the previous n/2 days before the last n/2 days, and N3 is the same quantity over all n days, will be equal to zero, and thus, the exponent of that would be equal to 1, which is analogous to an EMA of 1 day. Similarly, when there is a great deal of congestion, then the expression log(N1+N2) will be greater than log(N3), and so the exponent (that is, the fractal dimension) of the exponent would be closer to 2 (or greater, since I implemented the modified FRAMA).
Let’s look at the code:
Essentially, from the second chunk of code, this is an advanced form of the exponential moving average that takes into account the amount of movement over a greater time period relative to the swing at two finer intervals in the two halves of that period. The methodology for the modified FRAMA is thanks to ETFHQ (once again), found here.
And while words can make for a bit of explanation, in this case, a picture (or several) is worth far more. Here is some code I wrote to plot an EMA, and three separate FRAMA computations (the default John Ehlers settings, the best ETFHQ settings, and the slower ETFHQ settings) on XLB from 2003 through 2018 (yes, the same XLB from our Trend Vigor backtest, because it was the go-to instrument for all our individual equity curves).
This produces the following plot:
From this perspective, the improvements are clear. Essentially, the long-term FRAMA (FC 40, n 252, SC 252) possesses much of the smoothness of the 126 day EMA, while being far more responsive to the turns in price action to keep open equity at the end of a trend. The two faster FRAMAs, on the other hand, hug the price action more closely, yet still retain a degree of smoothness.
Here’s the code to zoom in on 2007-2008.
And, the corresponding plot.
Here, we can see some more properties. While the default John Ehlers settings (blue) seemingly tracks price action very closely, the indicator usually finds itself right in the middle of the price action, but still has the occasional trend following property when price action breaks through it at the start of the financial crisis. In other words, it seems that it can hurt you both as a trend follower (whipsaws), and as a mean reverting indicator (as seen when XLB starts falling in the crisis), so this gives rise to the idea that an indicator can track the price too well.
On the other hand, the 126 day FRAMA (the ETFHQ settings, in green) seems to look like a dynamic support and resistance indicator that the talking heads go on and on about (yet give very little advice on how to actually objectively compute), in that the price action seems to touch it every so often, but not oscillate around it. It breaks in one direction and manages to stay in that direction, until it breaks in the other direction, and sustain a move to that direction. This seems like a foundation of a future trading strategy.
Finally, the 252 day FRAMA (the ETFHQ settings for the long-term FRAMA indicator, in red) looks like a confirmatory indicator or filter.
Notice that by comparison, the 126 day EMA seems to lag as much if not more than the 252 day FRAMA, and from this vantage point, it seems that the results are not as good for the same amount of data processed.
Overall, it seems that by trading off smoothness and responsiveness, one can see the foundations of a possible system.
The potential trading systems here will be explored in the future.
شكرا للقراءة.
Trend Vigor Part IV: Shorting and Walk Forward Test.
While Trend Vigor has potential on the long end (as seen in part III of this investigation here), as Andreas Clenow has stated in his article “Trend Following Does Not Work On Stocks”, the short side of trend following gets killed in equities. And, since by far and away most of the securities in this backtest were equity-based ETFs (most of the ones available before 2003 were equity index ETFs), the results can basically be summed up as “buying insurance for Black Swans”. On the plus side, Trend Vigor at very high period settings (longer than 120) is able to capture some of the upside from being short in the depths of the financial crisis, but unfortunately gives most of it back.
To begin, here’s the code for this strategy, starting off at the previous settings of a period of 20 and delta 0 with ATR order sizing. The demo data has slightly changed in that the initialization, from, and to parameters are now found in the demo scripts, rather than the file itself, which, as a result, is no longer a standalone file.
And here is the output:
So, already, we can see that it’s pretty much a bloodbath–namely because throughout 2003 through 2018, the general trend was upwards, and also, because of the use of constant ATR order sizing, when the moves are largest (during the heightened volatility), our position size is smallest, relative to it. Which isn’t to say that this is a particularly bad idea considering that a short position can get whipsawed badly, but that such a short-term detection system has no sense of the overall larger trend.
Here are some more portfolio statistics.
In other words, this strategy simply costs you an annualized 4% a year, just to get the pop-up during the financial crisis, and then proceed to give that all back to the market anyway. In other words, it’s a really silly form of insurance, especially considering that due to the heightened volatility in times of extreme crisis, the ATR order sizing function *already* functions as a massive hedge. For the sake of completeness, here’s the equity curve of this strategy.
And here’s the usual equity curve of XLB.
Note that just when all the blood is in the water, the ATR order-sizing function actually works *against* the strategy. This is due to the fact that with equities, that are bought in the expectation of price appreciation as an investment (rather than, say, a commodity, whose prices need to fluctuate, and whose price appreciation perhaps means adverse consequences outside of the investment universe, or an exchange rate, which is by nature long in one instrument, short another, so may not be marked by severe volatility to the downside), and thus, trends to the upside are more sustained, while moves to the downside happen much more quickly, and by the time there is “sufficient evidence” (at any level of evidence) of a move to the downside, the largest part of the move already happened, and it’s much more likely that a short trade would get whipsawed for a loss.
If the other extreme is tried–that is, a more conservative delta parameter (.1), and a much larger period (greater than 120 days, to attempt to implement this more as a filter, in this case, 140), these are the results:
The NaN means that one or more of the instruments had so few trades that there were no losers (most likely 1 or 2 trades that just so happened to get lucky), E. G. XLU had 1 trade.
Again, nothing worth writing home over. Even after I tried several different settings (for instance, if the delta parameter is too high, most of the move to the downside in the crisis will be missed, and any profit will get consumed by the recovery, and then some), when the best result barely breaks even in a once-in-a-lifetime crisis, and so many other configurations either bite too easily on minor dips in an uptrend, or the converse, are too afraid to enter even in a once-in-a-lifetime opportunity, it’s best to not even try to fit this square peg into a round hole, and just not even think about trying Trend Vigor on the short end in equities.
For the record, here’s the equity curve.
So even when the indicator gets the once-in-a-lifetime black swan opportunity, it still manages to do little noteworthy. To put it into perspective, let’s once again look at XLB.
Basically, enter late, exit late (meaning there’s a lot of lag to this computation) on the filter end, and bite too easily on the short-term trading end.
In other words, as a standalone indicator, I’d be careful with it. Originally, this indicator was meant to be a predictor of trending vs. cycling. And essentially, at least when it comes to equities, it fails miserably, taking many trades it shouldn’t in an environment that steadily grinds upwards. This makes me believe that in a trend that grinds downwards, that a long strategy would be similarly disastrous. In short, in my opinion, the Trend Vigor indicator fails its original stated purpose, which is to partition markets into trending/cycling/trending downwards.
This all in mind, let’s see what happened to our holdout data–that is, from 2018 onwards using the long-only ATR position-sizing strategy through 2018 to present day (that is, the current date as of the time of this writing, which is June 9th, 2017, or “2017-06-09”).
Nothing spectacular, that’s for certain. في ما يلي النتائج:
Overall, it still was profitable, but definitely not impressively so. For the first time, the 50% mark got broken, which essentially contradicted the uniqueness of the indicator to begin with.
Here are the daily stats:
Basically, it seems that while the domestic side of equities seemed to do fairly well, the international side of the trade really hurt. For once, the perils of diversification are apparent. Here are the portfolio statistics:
So, ho-hum annualized returns, but the Sharpe Ratio at this point is far from stellar, and the drawdowns are definitely disappointing. Here is the resultant equity curve comparison.
In other words, it kept pace with the S&P 500 up until the beginning of 2018 (when in fact, their performance was just about equal), with less violent (but longer-lasting) drawdowns. Unfortunately, starting in mid-2018, the S&P 500 roared away, while the strategy just seemed to be flat, at the new equity high. This would probably anger quite a few investors. Let’s check out an equity curve from a losing security and see what happened.
In short, Trend Vigor as an entry indicator seems to be like the rest of the usual trend following indicators. Susceptible to buying tops and getting caught in cycles, gives back open equity (see that long trade in 2018-2018), takes counter-trend trades, but essentially at the price of incorporating a bunch of mathematics far more complex than the usual SMAs and EMAs, and at best, to marginally better results.
So does this mean that there was absolutely nothing to take away from this?
حسننا، لا. Trend Vigor is something that can be added to a repertoire of indicators. Unlike the usual SMA and EMA fare, the advantage that Trend Vigor has is that over longer time horizons, assuming gradual trends (as opposed to the steep drops in things such as equities), is that it still can get things right more often than not, and when it does, the average win to loss profile is usually impressive. However, a marginal improvement over the basics isn’t what trend vigor was originally advertised to be, so much as a reliable market mode indicator. And in a trending environment, even your basic SMA crossovers will make money. In an oscillating environment, even the most basic RSI plug-and-chug will make money. The key, of course, is to try and find an indicator that will tell you what to deploy when. And for that purpose, unlike what was advertised in the original John Ehlers presentation, Trend Vigor, as far as this investigation has led me, is *not* that.

No comments:

Post a Comment