الفوركس التكامل المشترك
التكامل المشترك في أزواج العملات الأجنبية.
التكامل المشترك في أزواج العملات الأجنبية هو أداة قيمة. بالنسبة لي، التكامل المشترك هو الأساس لاستراتيجية تجارية ميكانيكية محايدة السوق ممتازة التي تسمح لي للاستفادة في أي بيئة اقتصادية. سواء كان السوق في اتجاه صعودي، اتجاه هبوطي أو ببساطة تتحرك جانبية، وتداول أزواج الفوركس يسمح لي لحصاد المكاسب على مدار السنة.
يتم تصنيف إستراتيجية تداول أزواج العملات الأجنبية التي تستخدم التكامل المشترك كشكل من أشكال التداول المتقارب على أساس المراجحة الإحصائية والرجوع إلى المتوسط. هذا النوع من الاستراتيجية كان أول شعبية من قبل فريق التداول الكمي في مورغان ستانلي في 1980s باستخدام أزواج الأسهم، على الرغم من أنني والتجار الآخرين وجدوا أنه يعمل أيضا بشكل جيد جدا لتداول أزواج الفوركس، أيضا.
تداول أزواج الفوركس على أساس التكامل المشترك.
تداول أزواج الفوركس على أساس التكامل المشترك هو في الأساس استراتيجية عودة إلى متوسط. وباختصار، عندما يكون زوجين أو أكثر من أزواج الفوركس مدمجة، فإن ذلك يعني أن انتشار السعر بين أزواج الفوركس المنفصلة يميل إلى العودة إلى قيمته المتوسطة باستمرار مع مرور الوقت.
من المهم أن نفهم أن التكامل المشترك ليس ارتباطا. الترابط هو علاقة قصيرة الأجل فيما يتعلق بالتحركات المشتركة للأسعار. ويعني الترابط أن الأسعار الفردية تتحرك معا. على الرغم من الاعتماد على بعض الارتباط من قبل التجار، في حد ذاته انها أداة غير جديرة بالثقة.
ومن ناحية أخرى، فإن التكامل المشترك هو علاقة أطول أجلا مع التحركات المشتركة للأسعار، حيث تتحرك الأسعار معا في حدود أو فروق معينة، كما لو كانت مربوطة معا. لقد وجدت التكامل المشترك ليكون أداة مفيدة جدا في تداول أزواج الفوركس.
خلال تداول أزواج العملات الأجنبية، عندما ينتشر انتشار إلى قيمة عتبة يحسبها بلدي خوارزميات التداول الميكانيكية، وأنا "قصيرة" الفرق بين أسعار أزواج. وبعبارة أخرى، أنا أراهن على انتشار سوف يعود مرة أخرى نحو الصفر بسبب التكامل المشترك بينهما.
استراتيجيات التداول أزواج العملات الأساسية بسيطة جدا، وخصوصا عند استخدام أنظمة التداول الميكانيكية: اخترت اثنين من أزواج العملات المختلفة التي تميل إلى التحرك بالمثل. إنني أشتري زوج العملات الضعيفة وبيع الزوج المتداول. عندما يتقارب الفارق بين الزوجين، أغلق موقفي لتحقيق الربح.
تداول أزواج الفوركس على أساس التكامل المشترك هو استراتيجية محايدة السوق إلى حد ما. وكمثال على ذلك، إذا انخفض زوج العملات، فإن التداول من المحتمل أن يؤدي إلى خسارة على الجانب الطويل وكسب تعويض على الجانب القصير. لذلك، ما لم تفقد جميع العملات والأدوات الأساسية فجأة قيمة، يجب أن يكون صافي التجارة بالقرب من الصفر في أسوأ السيناريوهات.
وعلى نفس المنوال، فإن تداول الأزواج في العديد من الأسواق هو استراتيجية تداول ذاتي التمويل، حيث أن العائدات من المبيعات القصيرة يمكن أن تستخدم أحيانا لفتح الصفقة الطويلة. حتى من دون هذه الفائدة، لا يزال تداول أزواج العملات الأجنبية التي تعمل بالوقود المشترك يعمل بشكل جيد جدا.
فهم التكامل المشترك لتداول أزواج الفوركس.
التكامل المشترك مفيد بالنسبة لي في أزواج الفوركس التداول لأنه يتيح لي برنامج بلدي نظام التداول الميكانيكية على أساس كل من الانحرافات على المدى القصير من أسعار التوازن وكذلك توقعات السعر على المدى الطويل، والتي أعني التصحيحات والعودة إلى التوازن.
ولفهم كيفية عمل أزواج الفوركس التي يحركها التكامل المشترك، من المهم أولا تحديد التكامل المشترك، ثم وصف كيفية عمله في أنظمة التداول الميكانيكية.
كما قلت أعلاه، يشير التكامل المشترك إلى علاقة التوازن بين مجموعات من السلاسل الزمنية، مثل أسعار أزواج الفوركس المنفصلة التي هي في حد ذاتها ليست في حالة توازن. أما في المصطلحات الرياضية، فإن التكامل المشترك هو تقنية لقياس العلاقة بين المتغيرات غير الثابتة في سلسلة زمنية.
وإذا كان لكل سلسلتين زمنيتين أو أكثر قيمة جذر مساوية للقيمة 1، إلا أن تركيبة الخطية هي ثابتة، ثم يقال إنها مركبة كوينيغراتد.
وكمثال بسيط، يجب النظر في أسعار مؤشر سوق الأسهم والعقود الآجلة ذات الصلة: على الرغم من أن أسعار كل من هذين الصكين قد يهيمون على وجوههم بشكل عشوائي على فترات قصيرة من الزمن، في نهاية المطاف سيعودون إلى التوازن، وانحرافاتهم ستكون ثابت.
هنا مثال آخر، ذكر من حيث الكلاسيكية "المشي العشوائي" سبيل المثال: دعونا نقول هناك اثنين من سكران الفردية المشي هومويارد بعد ليلة من الكاروس. دعونا نفترض أيضا أن هذين السكرين لا يعرفون بعضهم البعض، لذلك ليس هناك علاقة يمكن التنبؤ بها بين مساراتهم الفردية. لذلك، ليس هناك تكامل بين تحركاتهم.
في المقابل، والنظر في فكرة أن الفرد في حالة سكر يتجول هوموارد في حين يرافقه كلبه على المقود. في هذه الحالة، هناك صلة محددة بين مسارات هذين المخلوقات الفقيرة.
على الرغم من أن كل من اثنين لا يزال على مسار فردي على مدى فترة قصيرة من الزمن، وعلى الرغم من أن أي واحد من الزوج قد يؤدي عشوائيا أو تأخر الآخر في أي نقطة معينة في الوقت المناسب، لا يزال، وسوف تكون دائما على مقربة من بعضها البعض. المسافة بينهما يمكن التنبؤ بها إلى حد ما، وبالتالي يقال أن الزوج أن يكون كوينيغراتد.
وبعد العودة الآن إلى المصطلحات التقنية، إذا كان هناك نوعان من السلاسل الزمنية غير الثابتة، مثل مجموعة افتراضية من أزواج العملات أب و زي، التي تصبح ثابتة عند حساب الفرق بينهما، وتسمى هذه الأزواج سلسلة متكاملة من الدرجة الأولى - أيضا استدعاء I (1) سلسلة.
على الرغم من أن أيا من هذه السلسلة يبقى في قيمة ثابتة، إذا كان هناك تركيبة خطية من أب و زي التي هي ثابتة (وصفها I (0))، ثم أب و زي هي كوينيغراتد.
المثال البسيط أعلاه يتكون من سلسلتين زمنيتين فقط من أزواج الفوركس الافتراضية. ومع ذلك، فإن مفهوم التكامل المشترك ينطبق أيضا على سلسلة زمنية متعددة، وذلك باستخدام أوامر التكامل أعلى ... فكر من حيث سكر يتجول يرافقه العديد من الكلاب، كل على المقود مختلفة طول.
في اقتصاديات العالم الحقيقي، فإنه من السهل العثور على أمثلة تظهر التكامل بين الأزواج: الدخل والإنفاق، أو قسوة القوانين الجنائية وحجم السجناء. في تداول أزواج العملات الأجنبية، ينصب تركيزي على الاستفادة من العلاقة الكمية التي يمكن التنبؤ بها بين أزواج العملات المتراكمة.
على سبيل المثال، لنفترض أنني أشاهد هذين الزوجين المفترسين للعملة الافتراضية، أب و زي، والعلاقة المشتركة بينهما هي أب & # 8211؛ زي = Z، حيث يساوي Z سلسلة ثابتة بمتوسط صفر، وهذا هو I (0).
ويبدو أن هذا يشير إلى استراتيجية تداول بسيطة: عندما أب - زي & غ؛ V، و V هو بلدي عتبة سعر الزناد، ثم نظام تداول أزواج الفوركس سوف تبيع أب وشراء زي، لأن التوقعات ستكون ل أب لتقليل في الأسعار و زي لزيادة. أو، عندما أب - زي & لوت؛ - V، وأتوقع لشراء أب وبيع زي.
تجنب الانحدار الهامشي في تداول أزواج الفوركس.
ومع ذلك، فإنه ليس بسيطا كما يقترح المثال أعلاه. في الممارسة العملية، يحتاج نظام التداول الميكانيكي لتداول أزواج الفوركس إلى حساب التكامل المشترك بدلا من الاعتماد على قيمة R-سكارد بين أب و زي.
وذلك لأن تحليل الانحدار العادي يقصر عند التعامل مع المتغيرات غير ثابتة. ويسبب ذلك ما يسمى الانحدار الهامشي، مما يوحي العلاقات بين المتغيرات حتى عندما لا يكون هناك أي.
لنفترض، على سبيل المثال، أنني أترتب على مسلسل زمني واحد منفصل "المشي العشوائي" ضد بعضها البعض. عندما اختبر لمعرفة ما إذا كان هناك علاقة خطية، في كثير من الأحيان سوف تجد قيم عالية ل R - التربيع وكذلك القيم P المنخفضة. ومع ذلك، لا توجد علاقة بين هذين المشيين العشوائيين.
الصيغ واختبار التكامل المشترك في تداول أزواج الفوركس.
وأبسط اختبار للتكامل المشترك هو اختبار إنغل-غرانجر الذي يعمل على النحو التالي:
تحقق من أن أب t و زي t هما على حد سواء I (1) حساب العلاقة التكامل المشترك [زي t = أب t + إت] باستخدام طريقة المربعات الصغرى تحقق من أن بقايا التكامل المشترك وغير ثابتة باستخدام اختبار وحدة الجذر مثل المعزز ديكي فولر (أدف) الاختبار.
معادلة غرانجر مفصلة:
I (0) يصف علاقة التكامل المشترك.
ويصف زي T-1 - βAB t-1 مدى الاختلال بعيدا عن المدى الطويل، في حين أن αi هي السرعة والاتجاه الذي تصحح فيه السلاسل الزمنية لزوج العملات نفسها من الاختلال.
عند استخدام طريقة إنغل-غرانجر في تداول أزواج الفوركس، يتم استخدام قيم بيتا للانحدار لحساب أحجام التداول للأزواج.
عند استخدام طريقة إنغل-غرانجر في تداول أزواج الفوركس، يتم استخدام قيم بيتا للانحدار لحساب أحجام التداول للأزواج.
تصحيح الخطأ للتكامل المشترك في أزواج العملات الأجنبية:
عند استخدام التكامل المشترك لتداول أزواج الفوركس، من المفيد أيضا حساب كيفية ضبط المتغيرات المركزة والعودة إلى التوازن على المدى الطويل. لذلك، على سبيل المثال، وهنا هما عينة الوقت أزواج الفوركس سلسلة أظهرت أوتورجريسيفيلي:
تداول أزواج الفوركس على أساس التكامل المشترك.
عندما أستخدم نظام التداول الآلي الخاص بي لتداول أزواج الفوركس، فإن الإعداد والتنفيذ بسيطان إلى حد ما. أولا، أجد أزواج العملات التي تبدو وكأنها قد تكون مشتركة، مثل ور / أوسد و غبب / أوسد.
ثم، أحسب فروق السعر المقدرة بين الزوجين. بعد ذلك، تحقق من وجود استبانة باستخدام اختبار جذر الوحدة أو طريقة شائعة أخرى.
أتأكد من أن خلاصة البيانات الواردة تعمل بشكل مناسب، وأسمح لخوارزميات التداول الميكانيكية بإنشاء إشارات التداول. على افتراض لقد قمت بتشغيل الاختبارات الخلفية كافية لتأكيد المعلمات، وأنا أخيرا على استعداد لاستخدام التكامل المشترك في بلدي أزواج الفوركس التداول.
لقد وجدت مؤشر ميتاتريدر الذي يوفر نقطة انطلاق ممتازة لبناء نظام تداول أزواج الفوركس المشترك. يبدو وكأنه مؤشر بولينجر باند، ولكن في الواقع يظهر مذبذب الفرق السعر بين اثنين من أزواج العملات المختلفة.
عندما يتحرك هذا المذبذب نحو أعلى أو منخفض للغاية، فإنه يشير إلى أن أزواج هي فصل، مما يشير إلى الصفقات.
ومع ذلك، للتأكد من النجاح أعتمد على بلدي نظام البناء الميكانيكية بنيت بشكل جيد لتصفية الإشارات مع اختبار ديكي فولر المعزز قبل تنفيذ الصفقات المناسبة.
وبطبيعة الحال، أي شخص يريد استخدام التكامل المشترك له أو لها أزواج العملات الأجنبية التداول، ولكن يفتقر إلى المهارات المطلوبة ألغو البرمجة، ويمكن الاعتماد على مبرمج من ذوي الخبرة لخلق مستشار خبير الفوز.
من خلال سحر التداول الخوارزمي، وأنا برنامج بلدي نظام التداول الميكانيكية لتحديد ينتشر السعر على أساس تحليل البيانات. خوارزميات بلدي خوارزمية لانحرافات الأسعار، ثم تلقائيا يشتري ويبيع أزواج العملات من أجل حصاد أوجه القصور في السوق.
المخاطر التي يجب أن تكون على دراية عند استخدام التكامل المشترك مع تداول أزواج الفوركس.
تداول أزواج العملات الأجنبية ليس خاليا تماما من المخاطر. قبل كل شيء، أنا أضع في اعتبارنا أن أزواج العملات الأجنبية التداول باستخدام التكامل هو استراتيجية انعكاس المتوسط، الذي يقوم على افتراض أن القيم المتوسطة سوف تكون هي نفسها في المستقبل كما كانت في الماضي.
على الرغم من أن اختبار ديكي-فولر المعزز المذكور سابقا مفيد في التحقق من العلاقات المتآزرة لتداول أزواج الفوركس، إلا أنه لا يعني أن فروق الأسعار ستستمر في أن تكون مشتركة في المستقبل.
أنا أعتمد على قواعد قوية لإدارة المخاطر، مما يعني أن نظام التداول الآلي الخاص بي يخرج من الصفقات غير المربحة إذا أو عندما يتم إبطال العائد المحسوب إلى المتوسط.
عندما تتغير القيم المتوسطة، انها تسمى الانجراف. أحاول الكشف عن الانجراف في أقرب وقت ممكن. وبعبارة أخرى، إذا بدأت أسعار أزواج الفوركس التي تم تجميعها سابقا في التحرك في اتجاه بدلا من العودة إلى المتوسط المحسوب سابقا، فقد حان الوقت لخوارزميات نظام التداول الآلي الخاص بي لإعادة حساب القيم.
عندما أستخدم نظام التداول الميكانيكي الخاص بي لتداول أزواج الفوركس، أستخدم صيغة الانحدار الذاتي المذكورة سابقا في هذه المقالة من أجل حساب المتوسط المتحرك للتنبؤ بالانتشار. ثم، أنا الخروج من التجارة في بلدي حدود الخطأ المحسوبة.
التكامل المشترك هو أداة قيمة لأزواج الفوركس بلدي التداول.
استخدام التكامل في أزواج الفوركس التداول هو استراتيجية التداول الميكانيكية محايدة السوق التي تسمح لي التجارة في أي بيئة السوق. انها استراتيجية ذكية تقوم على العودة إلى يعني، ومع ذلك فإنه يساعدني على تجنب المزالق لبعض استراتيجيات العودة إلى المتوسط يعني تداول العملات الأجنبية.
ونظرا لاستخدامه المحتمل في أنظمة التداول الميكانيكية المربحة، فقد اجتذب التكامل المشترك لتداول أزواج العملات الأجنبية الاهتمام من التجار المحترفين وكذلك الباحثين الأكاديميين.
هناك الكثير من المقالات التي نشرت مؤخرا، مثل هذه المادة بلوق تركز على بلوق، أو هذه المناقشة العلمية للموضوع، فضلا عن الكثير من النقاش بين التجار.
التكامل المشترك هو أداة قيمة في بلدي أزواج الفوركس التداول، وأنا أوصي أن ننظر في الأمر لنفسك.
21 ردا.
مادة جيدة جدا. هو ملهم. شكرا لكتابة ذلك!
كما يتم تطبيق الارتباط في الأسهم (الأسهم). ماهو الفرق؟ هل يمكن تطبيق العملية المذكورة أعلاه على الأسهم؟
نعم، يمكن تطبيق نفس العملية على الأسهم وكذلك على المشتقات. ونظرا لوجود مثل هذا الكون الكبير من الأسهم عند مقارنته بأزواج الفوركس، ينبغي أن يكون هناك عدد أكبر من الفرص المحتملة للتداول. مع عدد من الطحن قوة اليوم & # 8217؛ s نظم التداول، العديد من مجموعات من العلاقات يمكن فحصها بسرعة، في الوقت الحقيقي. ويمكن أيضا استخدام التكامل المشترك من قبل التجار الخيارات. فإنه من المتوقع أن تنتج نتائج مثل انتشار كوكا كولا-بيبسي الشعبي الذي تسمح فيه العلاقات السعرية بين بعض الأسهم / الخيارات للمتداولين بالاشتراك في مسرحيات منخفضة المخاطر إلى حد ما مع فرصة جيدة إلى حد ما للفوز.
هل تتداول في غضون يوم أو أكثر من أسابيع باستخدام هذه الاستراتيجية؟ أيضا، ما لغة البرمجة التي تنصح بها. R يستغرق وقتا طويلا لتشغيل الحسابات وإذا كان في غضون التجارة اليوم، الكمون يأتي في اللعب.
لغة البرمجة لا تهم التداول في نهاية اليوم. أي لغة رئيسية مثل بيرل، بايثون، C / C ++ و C # على ما يرام. R يمكن أن يكون سريع للغاية لكنه يبطئ إذا كان & # 8217؛ s اضطر إلى تخصيص حيوي الذاكرة.
أنا التجارة باستخدام الرسوم البيانية اليومية، وأنا البقاء في معظم الصفقات لبضعة أيام لبضعة أسابيع. شون هو مبرمج خبير، وأنا أثق دائما حكمه لاستخدام أفضل لغة البرمجة للحصول على أفضل النتائج لاستراتيجية التداول معين. في الواقع، يمكن لشون خلق برنامج متوازن، الفوز لتحقيق الاستفادة من التكامل المشترك وعوامل أخرى كذلك. إذا كنت & # 8217؛ د مثل الاقتباس، يرجى الاتصال به مباشرة في معلومات @ أونيستيبريموفيد.
وهناك بعض االهتمام بتنفيذ هذا البرنامج ل MT4. إذا كنت تستطيع تقديم بعض التفاصيل على تنفيذ هذه الاستراتيجية في التعليمات البرمجية، يرجى إرسالها إلى زيمر @ أونيستيبريموفد.
أنا أفعل مشروع صغير على استراتيجيات التكامل المشترك في فكس لبلدي ماجستير. أعتقد أنك ركض اختبارات التكامل المشترك على الكثير من أزواج العملات. ما هي تلك التي وجدت أنها ذات دلالة إحصائية مركزة بشكل كبير؟
أنا لا & # 8217؛ ر أعتقد إدي ركض في الواقع الأرقام. والمقصود من هذه المادة أن تكون دليلا شاملا لهذا المفهوم، ولكن ليس تماما لدرجة كونه استراتيجية حسن النية.
1) أوسد / جبي و ور / تشف.
2) ور / بلن و ور / هف.
3) أوسد / تري و أوسد / زار.
4) أود / أوسد و نزد / أوسد.
5) ور / نوك ور / سيك.
وأنا أعلم أن هذه ترتبط ارتباطا وثيقا للغاية، ولكن هذا لا يعني التكامل المشترك.
هناك أزواج الفوركس جيدة سوينغاتراتد:
لن يكون الدولار أوسجبي / ورشف زوجا متآلفا لأنه لن يكون هناك استراتيجية محايدة للسوق.
شكرا للمشاركة.
هل نفذ أي شخص شفرة باكتست باستخدام إستراتيجية الإرجاع المتوسط؟
هل يجب أن أقيم القيم بين أزواج الفوركس؟
هل أضاف أي شخص تكلفة العمولة إلى باكتست كود وحصلت على نتائج مربحة؟
I & # 8217؛ m متأكد من شخص ما لديه، لكنه & # 8217؛ s ليس شيئا حيث أنت & # 8217؛ سوف تجد لإجابة واضحة على الرسوم البيانية على المدى القصير. قد تجد كوانتيغراتيونس على المدى الطويل، ولكن هذا & # 8217؛ s لا البحوث أنا & # 8217؛ القيام به.
ويتمثل التكامل المشترك الوحيد بين اليورو والفرنك السويسري وبين الدولار الأسترالي والدولار النيوزيلندي حيث أن التجارة والاقتصاد الحميمين الوحيدين بين هذه البلدان والمصارف المركزية يخلقان هذا التكامل المشترك.
ليس اليورو و الجنيه الإسترليني؟
مرحبا إدي. مقال ممتاز. لقد تم اختبار مرة أخرى 10 سنوات من الرسوم البيانية التفكير & # 8221؛ لا أستطيع أن أكون أول شخص فكر في هذا! & # 8221؛ عندما وجدت هذا الموقع. شكرا جزيلا لكتابة هذا. أنا لا & # 8217؛ ر يشعر تماما حتى وحده بعد الآن. 🙂 فقط أتساءل أي وسيط كنت تستخدم أو هل تستخدم وسطاء متعددة. شكرا على وقتك.
مع خالص التقدير روبرت J. أرماغوست.
الوسيط الرئيسي الذي أستخدمه هو بيبرستون و ستو (عبر توبترادر).
مرحبا شون لقد تم تداول هذه الاستراتيجية يدويا. هل لديك برنامج لأتمتة هذا؟ (حتى أنا لا & # 8217؛ ر لديك للحصول على ما يصل في منتصف الليل بعد الآن) شكرا على وقتك.
ليس من على الرف، ولكن ذلك & # 8217؛ ق شيء يمكننا أن نبني. تبادل لاطلاق النار لي رسالة بالبريد الالكتروني مع قواعد الدخول والخروج للحصول على تقدير. معلومات @ onestepremoved.
روبرت & # 8212؛ شكرا لردود فعل طيبة. شون لديه الأدوات المناسبة لتنفيذ هذا النوع من استراتيجية التداول، وأنا أتفق تماما مع توصيات وسيط له، شكرا مرة أخرى للتعليق! EF.
الميكانيكية الفوركس.
التداول في سوق الفوركس باستخدام استراتيجيات التداول الميكانيكية.
التكامل المشترك في سوق الفوركس.
من العديد من أنواع مختلفة من المراجحة الإحصائية المتاحة، قد يكون تداول أزواج واحدة من الأكثر شعبية. في تداول أزواج سوف يحاول المتداول استغلال العلاقة الخطية بين قيم اثنين من الصكوك، في محاولة لشراء / بيعها عندما العلاقة بين قيمها يزيد / ينخفض إلى القيم التي توفر ما يكفي من الأرباح المحتملة. ومع ذلك، فإن تداول الأزواج لا يتطلب فقط ارتباطا خطيا بالوجود، بل يتطلب أيضا أن تكون الأدوات مجتمعة، وهي خاصية أساسية تضمن اتصالا أساسيا بين الأدوات التي تقلل من احتمال الانتشار بين كلا الجهازين & # 8220؛ 8221؛ (اتسعت إلى ما هو أبعد مما هو متوقع إحصائيا). على الرغم من أن تداول الأزواج عادة ما يتم وصفه في الأسهم / السلع، إلا أننا نادرا ما نرى أي دراسة للتكامل المشترك في سوق العملات الأجنبية. اليوم نحن & # 8217؛ سوف ننظر في بعض الكوينغراتيونس المحتملة في سوق العملات الأجنبية، لماذا موجودة وكيف يمكن استغلالها.
دعونا نبدأ بتحديد ما نعنيه بالتكامل المشترك. يتم تجميع سلسلة اثنين من كوينيغراتد عندما تتشارك الانجراف العشوائي المشترك. مثال نموذجي لشرح محادثات التكامل المشترك حول رجل يذهب إلى شريط مع كلبه. بعد الحصول على حالة سكر وترك شريط كل من الرجل والكلب السير على نفس الطريق المنزل، على الرغم من الانجراف العشوائي & # 8211؛ وهي الطريقة العشوائية التي يمشي بها الرجل ويتعجب الكلب على طول الطريق & # 8211؛ مختلفة. وعندما يحدث هذا، فإن مساراتها ترتبط في الواقع ولكنها ليست مشتركة. إذا قرر الرجل بدلا من ذلك وضع المقود على الكلب تصبح مساراتها كوينيغراتد لأنها الآن تشترك الانجراف العشوائي المشترك الذي يحدده طول المقود. الرجل والكلب لا يمكن فصل أكثر من المقود يسمح بها، مما يجعل أي حركات عشوائية أنها تجعل وراء طول معين مشترك لكلا (كما أنها سوف سحب على بعضها البعض). في الإحصاء يمكننا تقييم للتكامل المشترك باستخدام العديد من الاختبارات المختلفة التي يستخدمها اختبار المعزز ديكي فولر (أدف) الأكثر شعبية. لاحظ أن هذا الاختبار يقيم فقط ستاتيوناريتي & # 8211؛ ليس بالضبط كوينغراشيون & # 8211؛ لذلك اختبار آخر مثل اختبار يوهانسن ضروري لتأكيد التكامل المشترك.
عند النظر في الأمثلة الكلاسيكية للتكامل المشترك في سلسلة زمنية مالية، ستلاحظ أن الأدوات التي يتم دمجها بشكل عام لديها بعض الأسباب الأساسية القوية لتكون مشتركة. المقطع & # 8220؛ المقطع & # 8221؛ هي علاقة أساسية بين كلا الصكين، الانجراف العشوائي المشترك بينهما. وعادة ما تكون هذه العلاقة قوية جدا، على سبيل المثال، شركتان منتجهتان للنفط تتقاسمان مصافي التكرير في نفس البلدان بشكل عام، ولديهما نفس العملاء، يتم وضعهما معا بإحكام بحيث يكون من غير المحتمل جدا لأي حدث عشوائي التأثير على أحدهما دون التأثير على الآخر. هذا هو ما يجعل الانحرافات محيرة بحيث تستغل. ولكن في الفوركس، فإن القصة مختلفة بعض الشيء لأن البلدان تواجه صعوبة كبيرة في أن تكون متشابهة بشكل أساسي.
يمكنك أن ترى فعلا هذا بسهولة عندما ننظر في العام الماضي من البيانات لعدة أزواج فكس أننا عادة ما ينظر إليها على أنها مترابطة. على سبيل المثال ور / أوسد و غبب / أوسد تقليديا لديها علاقة كبيرة. مؤامرة تطبيع تظهر السنة الأخيرة من البيانات يظهر لك أن كلا الزوجين في الواقع تميل إلى التحرك في نفس الاتجاه ولكن من الواضح أن هذه العلاقة لا تتبع نفس الانجراف العشوائي. اختبار أدف باستخدام السنة الأخيرة من البيانات لهذين الزوجين سوف تعطيك قيمة 0.28 التي هي ببساطة كبيرة جدا لرفض فرضية نول. النظر إلى أزواج مماثلة أخرى تكشف عن نتائج مشابهة جدا، أزواج مثل أودوس | نزدوسد & # 8211؛ والتي هي أكثر ارتباطا من اليورو مقابل الدولار الأميركي (غبوسد).
ھل ھناك أي تکامل مشترك في سوق العملات الأجنبیة؟ في الواقع الجواب هو نعم. أصدر البنك الوطني السويسري قرار إنشاء أرضية على اليورو مقابل الفرنك السويسري عند 1.20 على & # 8220؛ المقود & # 8221؛ التي جعلت عدة أزواج حصة الانجراف العشوائي. على سبيل المثال، اليورو يوروس و تشفوسد الآن كوينتيغراتد بسبب هذه الحقيقة. سيعطيك اختبار وحدة تغذية المستندات التلقائية قيمة أقل من 0.01 لهذا الزوج، مما يشير إلى أنها بالفعل مدمجة (مؤكدة من اختبار يوهانسن كذلك). كل تشف مماثلة تحتوي على أزواج تظهر أيضا كوينتيغراتيونس، مثل ورجبي | تشفجبي و ورود | أودف. تنشأ هذه التجمعات المشتركة من ربط اليورو مقابل الفرنك السويسري (ورشف)، وهو أمر واضح عند النظر إلى قيمة الانتشار كدالة للوقت بين أي من هذه الأزواج. الصورة الثالثة تظهر لك انتشار زوج اليورو مقابل الدولار الأميركي (تشفوسد) كدالة للوقت، فإنه ليس من المستغرب أن هذا هو نفس الرسم البياني بالضبط مثل اليورو مقابل الفرنك السويسري للعام الماضي. بطول المقطع & # 8220؛ المقطع & # 8221؛ يختلف، لذلك لا قيمة انتشار على أزواج كوينيغراتد.
هل يمكننا الاستفادة من هذه المجموعات المشتركة؟ حسنا، أنت بالتأكيد يمكن. هناك العديد من الطرق التي يمكن أن يتم تداول التكامل المشترك ولكن مع متفاوتة & # 8220؛ المقود & # 8221؛ ومن المحتمل أن تكون هناك طريقة جيدة للتداول بين فرق البولنجر حول الانتشار. يمكنك التداول على أي الأطر الزمنية ولكن حتى عند التداول في الإطار الزمني اليومي يمكنك جعل بعض المال. الصورة الرابعة تظهر محاكاة بسيطة جدا في R حيث تداولت 3 أزواج المذكورة أعلاه، وذلك باستخدام رافعة 1:10، على المتوسط المتحرك 10 فترة باستخدام 1 الانحراف المعياري لمسافات الفرقة. تظهر المحاكاة ربح بنسبة 25٪ مع سحب بنسبة 10٪ خلال العام الماضي، ليست كبيرة جدا ولكن ليست سيئة للغاية أيضا. ومن الممكن أن يؤدي المزيد من التحسينات والإدخالات / المخارج على فترات زمنية أقل إلى زيادة هذه الهوامش.
من المهم أن نتذكر هنا أن المقود هو ربط من البنك المركزي. إذا توقف هذا الربط لسبب ما يتوقف من الممكن أن هذا التكامل المشترك سوف تتلاشى ببساطة. ولذلك فمن المستحسن أن نبقي على التطورات الأساسية ووقف التداول في التكامل إذا حدث ذلك. ومن المهم أيضا أن نكرر باستمرار الاختبارات الإحصائية للتكامل المشترك حيث تأتي البيانات الجديدة بحيث يمكنك التوقف عن تداول أي من هذه الأزواج بمجرد أن يظهر التكامل المشترك للكسر. إذا كنت ترغب في معرفة المزيد عن تداول العملات الأجنبية وكيف يمكنك أيضا تصميم استراتيجيات التداول الخاصة بك يرجى النظر في الانضمام إلى أسيريكوي، موقع على شبكة الإنترنت مليئة أشرطة الفيديو التعليمية، ونظم التداول، والتنمية، ونهج سليم وصريح وشفاف نحو التداول الآلي بشكل عام. آمل أن يحظى هذا المقال بإعجابكم ! : س)
6 الردود على & # 8220؛ التكامل المشترك في سوق الفوركس & # 8221؛
& # 8221؛ في الإحصاء يمكننا تقييم للتكامل المشترك باستخدام ثلاثة اختبارات مختلفة من اختبار ديكي فولر (أدف) المعزز هو الأكثر شعبية. & # 8221؛
يو، وهذا هو الاختيار ستاتياريتي. فإنه لا يعني التكامل المشترك.
هذا صحيح، ولكن عندما تكون نتيجة هذا الاختبار إيجابية لسلسلة المالية أنها دائما كوينيغراتد، وهذا هو السبب في ذلك هو شعبيا تستخدم لهذا الغرض وأعتقد. ومع ذلك يمكنك إجراء اختبار يوهانسن كذلك أو اختبار إنغلين "جرانجر اختبارين. في الأمثلة المستخدمة في هذه المقالة كل سلسلة التي تمر اختبار أدف أيضا اجتياز اختبار جوهانسن، تبين أنها كوينيغراتد.
وسوف أكون أكثر من سعيد إذا كنت يمكن أن حصة رمز r الخاص بك من أجل معرفة كيفية القيام بهذه العملية.
تداول الفروقات على اليورو مقابل الدولار الأميركي (تشفوسد) يساوي تداول اليورو مقابل الفرنك السويسري (يورشف) نفسه، والذي، كما هو في الواقع ممكن بشكل مباشر في معظم الوسطاء، يجب أن يفضل (يدفع فقط نصف تكاليف الانتشار / العمولة). انتشار اليورو مقابل الدولار الأميركي (تشفوسد) هو في الواقع أداة اصطناعية لليوروشف.
فكيف يتم تداول هذا التداول بأي شكل مختلف (للأفضل)؟
شكرا على التعليق: o) أنت & # 8217؛ الحق بوضوح، انها نفس التداول على استراتيجية الفرقة البولينجر على اليورو / فرنك سويسري. كما هو مذكور في المقال فإن الانتشار هو في الواقع نفس الرسم البياني مثل ور / تشف. تنعكس قيمة اليورو مقابل الدولار الأميركي (تشفوسد) في الواقع كميل للعودة إلى المتوسط على زوج اليورو مقابل الفرنك السويسري (ور / تشف). إذا كنت ذاهبا إلى تداول هذا في الممارسة التي سوف تستخدم بالفعل ور / تشف لحفظ تكاليف التداول بدلا من شراء / بيع اليورو مقابل الدولار الأميركي و أوسشف.
مادة كبيرة عموما ولكن مربكة في بعض الأماكن. كما تعليق واحد & # 8217؛ أو أشار، اختبار أدف هو اختبار الجذر وحدة. وهو اختبار رسمي يستخدم لتحديد ما إذا كانت سلسلة الأسعار ثابتة أم لا. إذا كنت تحصل على قيمة P أكثر من 1٪، 5٪ أو 10٪ يمكنك أن تفشل فقط في رفض نول من الجذر وحدة على أساس مستوى الأهمية كنت مرتاحا مع. وهذا لا يستدل على وجود التكامل المشترك.
كما تم توثيق قوة وحدة تغذية المستندات التلقائية (أدف) لتكون منخفضة بحيث يمضي معظم الباحثين الآن للمراجعة عبر اختبار تكميلي مثل كبس.
سيكون من المثير للاهتمام أن نرى رمز R حتى نتمكن من تشغيله أيضا ونرى النتائج. يمكنك أن تذكر أن اختبار يوهانسن يؤكد وجود التكامل المشترك، لذلك في كل شيء أعتقد أن النتائج الخاصة بك هي على أرض صلبة.
بعض الأسئلة المثيرة للاهتمام التي تأتي هي كيف مستقرة هي علاقة التكامل المشترك؟ كم عدد المرات التي تتغير فيها علاقة المدى الطويل وتغير حجم هذه التغييرات عندما تحدث.
مقالة كبيرة عموما، والحفاظ عليها القادمة والقيام بمشاركة بعض رمز R.
جيكو كوانت - التداول الكمي.
التداول الكمي، التحكيم الإحصائي، تعلم الآلة والخيارات الثنائية.
آخر الملاحة.
إربيتال أربتريج & # 8211؛ تداول زوج مشترك.
في آخر مشاركة جيكوكانت / 2018/12/17 / إحصائي-التحكيم-اختبار-ل - التكامل المشترك-زيادة-ديكي-أكمل / أثبتت التكامل المشترك، وهو اختبار رياضي لتحديد أزواج ثابتة حيث يجب أن يكون الانتشار حسب التعريف يعني العودة.
في هذا المنصب أعتزم أن أشرح كيفية تداول زوج مشترك، وسوف تستمر في تحليل أسهم رويال داتش شل A مقابل B (ونحن نعلم أنها & # 8217؛ كوينتيغراتد من آخر مشاركة بلدي). تداول زوج كوينغراتد هو مستقيم إلى الأمام، ونحن نعرف متوسط والتباين في انتشار، ونحن نعلم أن تلك القيم هي ثابتة. نقطة الدخول ل أرب ستات هي مجرد البحث عن انحراف كبير بعيدا عن المتوسط.
وتتمثل الاستراتيجية الأساسية فيما يلي:
إذا انتشرت (t) & غ؛ = يعني سبرياد + 2 * الانحراف المعياري ثم انتقل شورت إف سبرياد (t) & لوت؛ = مين سبرياد & # 8211؛ 2 * الانحراف المعياري ثم يذهب طويل.
إذا كان معدل الانتشار (t) & غ؛ = ناداي موفينغ أفيراج + 2 * ناداي رولينغ ستاندارد ديفياتيون ثين غو شورت إف سبرياد (t) & لوت؛ = ناداي موفينغ أفيراج & # 8211؛ 2 * ناداي المتداول الانحراف المعياري ثم يذهب طويلا.
إذا انتشرت (t) & لوت؛ = متوسط انتشار + 2 * الأمراض المنقولة جنسيا وانتشار (t-1) & غ؛ متوسط انتشار + 2 * ستد إذا انتشار (t) & غ؛ = يعني سبرياد & # 8211؛ 2 * الأمراض المنقولة جنسيا وانتشار (t-1) & لوت؛ مين سبرياد & # 8211؛ 2 * ستد ميزة هي أننا التجارة فقط عندما نرى متوسط انعكاس، حيث كما نماذج أخرى تأمل في متوسط انعكاس على انحراف كبير عن المتوسط (هو انتشار تهب؟)
ستنظر هذه المشاركة في المتوسط المتحرك ونموذج الانحراف المعياري المتداول لأسهم شركة رويال داتش شل A مقابل B، وسوف تستخدم نسبة التحوط الموجودة في آخر مشاركة.
شارب راتيو شل A & أمب؛ B ستات أرب شل A.
نسبة شارب السنوية (رف = 0٪):
شل A & أمب؛ B ستات أرب 0.8224211.
شل A 0.166307.
لدى أرباب الاستثمار نسبة متفوقة من شارب أكثر من مجرد الاستثمار في شل أ. للوهلة الأولى فإن نسبة شارب 0.8 تبدو مخيبة للآمال، ولكن بما أن الاستراتيجية تنفق أكثر من ذلك & # 8217؛ ق الخروج من السوق سيكون لها منخفضة سنويا نسبة محددة. لزيادة نسبة شارب يمكن للمرء أن ننظر إلى تداول ترددات أعلى أو لديك أزواج محفظة بحيث يتم قضاء المزيد من الوقت في السوق.
22 أفكار حول & لدكو؛ إربيتال أربتريج & # 8211؛ تداول زوج كوينيغراتد & رديقو؛
وهذا يعني أيضا أنه عند تحديد الاختلاف الأقصى يمكنني اتخاذ موقف في المشتقات مثل الخيارات؟
-خيار أتم دعوة النداء على الأسهم الأولى.
-buy خيار الاتصال على الثانية.
أو مع باكسبريدكال على الأولى و باكسبريدبوت على الثانية حتى أتمكن من تعيين الحماية وأنا يمكن أن لفة لهم إذا خرجوا السيطرة & # 8230؛
يجب أن تكون المراكز قصيرة المال أتم أو أوتم خفيف في رأيي.
ماذا تفكر؟
هل حاولت استخدام نهج اختبار يوهانسن من أجل إجراء اختبار أكثر صرامة للتكامل المشترك؟ ما رأيك في الجمع بين إنغل-غرانجر مع يوهانسن؟
إن الانتشار في ما سبق لا يتأرجح حوله يعني، من الناحية المثالية، يجب أن يتفاعل الزوج المشترك بين الجانبين بشكل غير متجانس كما هو مبين أعلاه & # 8230؛. لقد كانت عملية الكتابة المثالية مثالية للتكامل المشترك الصحيح الذي أظهرته. ولكن هذا الانتشار ليس انتشارا مثاليا.
أنا 100٪ أتفق معك.
ولكن لأغراض عملية طالما أن متوسط العائد يحدث أسرع من متوسط التغييرات ثم أنت & # 8217؛ ليرة لبنانية بشكل جيد.
أعتقد أن & # 8217؛ شيء أنا & # 8217؛ غاب، كيفية قياس نصف الحياة / سرعة الإرجاع.
يرجى ملاحظة أنه في التجريبي أعلاه نظرة فترة العودة 90 يوما. هذا قصير إلى حد ما. اختيار 200 يوما سوف يؤدي إلى يعني أن أقل استجابة / اتجاه التغييرات. ومن المرجح أن تزيد من حجم نطاقات الانحراف المعياري وتؤدي إلى صفقات أقل في السنة. وهذا يؤدي عادة إلى انخفاض نسبة شارب.
وظيفة مثيرة جدا للاهتمام. أحب أن نرى التنفيذ على سلة من أزواج.
أفعل بعض التغييرات في البرنامج الخاص بك لحساب البولنجر العصابات وأريد أن أعرف لماذا أنت & # 8217؛ وضع الانحراف المعياري إلى اليمين؟ (موفينغستد = رولابلي (سبرياد، لوكباك، سد، ألين = & # 8221؛ رايت & # 8221 ؛، na. pad = ترو))
موافق شكرا لك على الإجابة!
مدونتك تعطيني فرصة لتنفيذ وبناء أسرع استراتيجية بلدي قانون الأحوال الشخصية.
أنا ذاهب لاختبار نماذج مختلفة للمراجحة الإحصائية. أظل جميع الزوار في حلقة!
في البرنامج الخاص بك، وتأثير مارتينغال ليست هنا. كيف يمكنني إضافة هذا التأثير؟
أنا تشغيل بلدي باكتيستس إون مع برامج مختلفة (إكسيل، R إت برورالتيمي (منصة الفرنسية)) ومن أجل القيام ببعض المقارنة، ولست بحاجة لإضافة تأثير مارتينغال.
شكرا على التوضيح. بواسطة نفس الحجة، رولمان يجب أن يكون لها نفس: رولمان (سبرياد، لوكباك، na. pad = ترو، ألين = 'رايت')
مع هذا التعديل الجديد نسبة شارب تنخفض بشكل كبير ..
أشياء عظيمة!! أعتقد أن هناك اثنين من الأخطاء في التعليمات البرمجية الخاصة بك، على الرغم من. الأول هو في حساب المتوسط المتحرك. لقد نسيت تعيين معلمة المحاذاة إلى & # 8220؛ اليمين & # 8221؛ (كما تفعل للإنحراف المعياري). تستخدم الدالة ديفولت & # 8220؛ سينتر & # 8221؛ والبيانات الخاصة بك & # 8211؛ لا يتم محاذاة المتوسط المتحرك والمتوسط المتحرك. يمكنك أن ترى هذا من المؤامرة كذلك. ينتهي متوسط الانتقال قبل 45 يوما من الانتشار. العلة الثانية هي في حساب عوائد التداول. أعتقد أنك يجب أن تأخذ العودة من اليوم التالي ونحن ندخل الموقف بسعر الإغلاق.
شكرا لرمزك الأنيق. لقد لاحظت أن سطر التعليمات البرمجية:
is meant to apply the function shortPositionFunc to (-1*aboveUpperBand+belowMAvg).
However, the function shortPositionFunc takes two arguments x and y.
Is there any typo in the code?
Thank you for your clarification!
Thanks Gekko for the backtesting code. It is very useful. Couple of comments below:
1) Another reader has already commented about this above. movingAvg needs to be amended by adding align=”right” in order to have the first moving avg number on day 90:
movingAvg = rollmean(spread, lookback, align=”right”, na. pad=TRUE)
2) since we enter trades at end of day, the return on trade date shouldn’t count. we can simply shift every element in the “positions” vector down by using the “shift” function in the taRifx library.
Also, I don’t believe daily return is (aRet – stockPair$hedgeRatio*bRet). Imagine if you had a large hedge ratio, i. e. if stock A is priced at $100 and stock B is priced at $10, then the hedgeRatio would be in the neighborhood of 10. Since aRet and bRet are in % terms, the formula won’t work. Daily return should be aRet – bRet * (ratio between dollar neutral ratio vs hedge ratio).
#Calculate spread daily ret.
dailyRet <- aRet – bRet*hedgeRatioOVERdollarNeutralRatio.
tradingRet <- dailyRet * shift(positions,-1)
I am looking for new strategies in equity pair trading that improve the standard cointegration approach (for instance I started looking into the pair trading with copulas, which still seems an “unstable” alternative to cointegration). Do you have any new paper to suggest me? Thank you very much and congrats for the great blog.
The second half of the book goes through lots of more advanced techniques for hedging a portfolio / finding stationary pairs.
i am a bit confused in this step.
when i plotted the longPositions and ShortPositions along with the spread, bands and moving average lines found then there are consecutive long signals and short signals. According to my understanding.
longPostions <- if spread is below lowerband.
longExit <- if spread is above movAvg while long.
shortPostions <- if spread is above upperband.
shortExit <- if spread is below movAvg while short.
is this same thing your code is doing. Please help me understand this part.
Hi Gekko, I read the books of EP Chan that talks about this topic and I a little bit confused about mean reservion. When two assets ara cointegrated we are supposing that they will come back to their mean, but their moving average or their total mean in a fixed period? I’m giving better results using static parameters than using bollinger bands. I will show you an image with my doubt. prntscr/51jofw Could you write another article of mean reversion! شكرا للجميع.
Hi Gekko. Great Code. Could you closer explain an idea behind this cappedCumSum function ? I do not understand the moment when you are specifing two input variables, but in Reduce() function is only one parameter, – is it because of 0?
There is a mistake. Your algorithm looks in the future, the problem in rollmean function. Algorithm using moving average from future days to close position.
Forex cointegration trading
Page last updated.
February 16, 2003.
Cointegration-based trading strategies:
A new approach to enhanced index tracking and statistical arbitrage.
The search for appropriate quantitative techniques to construct long-short equity strategies is not a last moment development in the financial markets. Newcomers in this game are constantly joining the traditional players and, currently, the most fervent searchers in quantitative strategies are the hedge funds involved in equity trading. Their operational flexibility and lack of constraints are ideally suited to allow them to benefit from the application of these types of trading strategies.
In this line of research, we are proposing several 'cointegration' trading strategies, such as index tracking and statistical arbitrage. The first strategy aims to replicate a benchmark in terms of returns and volatility, while the other seeks to generate steady returns under all market circumstances. As opposed to other traditional trading strategies, the portfolio optimisation is based on cointegration rather than correlation. When applied to the stocks in DJIA, these trading strategies have produced very steady results. For example, between January 1995 and December 2001 the most successful self-financing statistical arbitrage strategies returned (net of transaction and repo costs) approximately 10% with roughly 2% annual volatility and negligible correlation with the market (Alexander and Dimitriu, 2002). The funded strategies discussed in that paper return far more, of course, but have slightly higher volatility. In most years our strategies had Sharpe ratios close to one.
The applicability of the cointegration technique to asset allocation was pioneered by Lucas (1997) and Alexander (1999). Its key characteristics, i. e. mean reverting tracking error, enhanced weights stability and better use of the information comprised in the stock prices, allow a flexible design of various funded and self-financing trading strategies, from index and enhanced index tracking, to long-short market neutral and alpha transfer techniques.
Why use cointegration in portfolio management?
The concept of cointegration has been widely applied in financial econometrics in connection with time series analysis and macroeconomics. It has evolved as an extremely powerful statistical technique because it allows the application of simple estimation methods (such as ordinary least square and maximum likelihood) to non-stationary variables. Still, its relevance to investment analysis has been rather limited so far, mainly due to the fact that the standard in portfolio management and risk measurement is the correlation analysis of asset returns.
However, the correlation analysis is valid only for stationary variables. This requires de-trending the prices and other level financial variables, which are usually found to be integrated of order one or higher. Taking the first difference in log prices is the standard procedure for ensuring stationarity and leads all further inference to be based on returns. This procedure has, however, the disadvantage of loosing valuable information. In particular, de-trending the variables before the analysis removes any possibility to detect common trends in prices. By contrast, the aim of the cointegration analysis is to detect any stochastic trend in the price data and use these common trends for a dynamic analysis of correlation in returns (Alexander, 2001).
The fundamental remark justifying the application of the cointegration concept to, for example, stock prices analysis, is that a system of non-stationary stock prices in level can share common stochastic trends (Stock and Watson, 1991). According to Beveridge and Nelson (1981), a variable has a stochastic trend if its difference has a stationary invertible ARMA(p, q) representation plus a deterministic component. Since ARIMA(p,1,q) models seem to characterise many financial variables, it follows that the growth in these variables can be described by stochastic trends.
When applied to stock prices in a stock market index, cointegration exists when there exists at least one portfolio of stocks that has a stationary tracking error (we use the term tracking error as statisticians do, to denote the difference between the index and the portfolio). In other words, cointegration exists when there is mean reversion in the price spread between the portfolio and the index. This finding does not provide any information for forecasting the individual prices in the system, or the position of the system at some point in the future, but it provides the valuable information that, irrespective to its position, the prices of the portfolio and the index will stay together on a long-run basis.
Outline of the trading strategies.
Considering the above, finding a cointegration relationship, i. e. a stationary linear combination of the market index and a number of stocks from its components (usually specified as log prices), is equivalent to having a mean reverting spread between the market index and a tracking portfolio. Under such circumstances, by means of construction, the returns on the tracking portfolio will equal the returns on the index, on a long-run basis.
Additionally, being constructed on a rather long history of prices, the portfolio weights tend to ignore short-term movements in stock prices, such as bubbles or just noise, and focus on the long-run behaviour of the prices. As already shown, the fact that the tracking error is, by construction, mean reverting ensures that the tracking portfolio will stay 'tied together' with the index in the long-run, irrespective to short-term movements in individual stock prices. There can, however, be short-term de-correlations between the tracking portfolio and the index. In fact, this is a potential source of 'alpha', i. e. excess return, in the tracking portfolios.
A number of trading strategies can be constructed based on cointegration relationships:
A. Index tracking.
The first cointegration-based trading strategy investigated is a classical index tracking aiming to replicate a benchmark in terms of returns and volatility. An index tracking process entails two, equally important stages: first, selecting the stocks to be included in the tracking portfolio and then, determining the portfolio holdings in each stock based on a cointegration optimisation technique.
The first stage, stock selection, can be the result of proprietary selection models, technical analysis, or just stock picking skills of a portfolio manager. The degree of cointegration and consequently the tracking performance will depend very much on the selection process. However critical, the selection process does not have special features in a cointegration-based tracking technique. It constitutes rather a control variable in identifying the most appropriate tracking strategy.
The second stage of index tracking concerns determining the portfolio holdings in each of the stocks selected in the previous stage. The stocks weights in each portfolio are estimated based on the ordinary least square (OLS) coefficients of the cointegration equation regressing the index log-price on the portfolio stocks log-prices over a given calibration period prior to the portfolio's construction moment. We note that the application of OLS to non-stationary dependent variables such as log(index) is only valid in the special case of a cointegration relationship. Unless the residuals from the cointegration regression are found to be stationary, the OLS coefficients will be inconsistent and further inference based on them will be invalid. Therefore, testing for cointegration is an essential step in constructing cointegration-based tracking portfolios.
Further to estimation, the OLS coefficients are normalised to sum up to one, thus providing the weights of each stock in the tracking portfolio.
As shown in Alexander and Dimitriu (2002), even by using simple stock selection rules such as ranking the stocks by their weight in the index, the tracking portfolios constructed based on this methodology can accurately replicate the market index.
B. Enhanced index tracking and statistical arbitrage.
Having constructed the simple tracking strategy, a natural extension for exploiting the tracking potential of the cointegrated portfolios would be to replicate artificial indexes, 'plus' or 'minus', constructed as to linearly over-perform or under-perform the market index by a given amount per annum. Then, self-financing long-short strategies can be set up by being short on a portfolio tracking the 'minus' benchmark, and long on a portfolio tracking the 'plus' benchmark.
This type of statistical arbitrage strategy should generate returns according to the 'plus'/'minus' spread (i. e. double alpha) with fairly low volatility and no significant correlation with the market returns. We expect to become more and more difficult to find cointegrated portfolios as the magnitude of the spread between the benchmarks tracked increases. The cointegration relationship between the market index and its component stocks has a solid rationale, but this is not necessarily the case for portfolios tracking artificial benchmarks, which may be chosen to over-perform the market index by 50%, for example. The difficulty in finding an appropriate cointegration relationship leads to an increased instability of the stock weights, higher transaction costs and higher volatility of returns. To avoid this, it is essential to ensure that all the portfolios tracking 'plus' or 'minus' benchmarks pass the cointegration test.
C. Combining index tracking with statistical arbitrage.
In case market neutrality is not a requirement and an exposure to a market index is desired, another possibility would be to transport the alpha gained in the market neutral framework to an index, through the use of derivatives (e. g. index futures). Or, instead of derivatives, an enhanced cointegration-based index tracking procedure can be implemented.
This type of strategy, combining enhanced index tracking with statistical arbitrage, should have a high correlation with the market index, while gaining alpha from two sources: first, the excess return from enhanced index tracking and then, double alpha from the statistical arbitrage. When applying alpha transfer strategies to the stocks in DJIA, Alexander and Dimitriu (2002) have obtained significantly better Sharpe ratios then the market, even after accounting for transaction and repo costs.
As already pointed out, the cointegration concept has a number of attractive features in modelling asset prices, which recommend it as a significantly better alternative to the classic correlation analysis in portfolio management. Its key characteristics, i. e. mean reverting tracking error, enhanced weights stability and better use of the information comprised in stock prices, allow a flexible design of trading strategies, from enhanced index tracking to statistical arbitrage. Moreover, its application in constructing trading strategies within the DJIA stocks has produced encouraging results, which can be further refined.
Alexander, C. O. (1999) "Optimal hedging using cointegration" Philosophical Transactions of the Royal Society A 357, pp. 2039-2058.
Alexander, C. O. (2001) Market Models: A Guide to Financial Data Analysis, John Wiley, pp. 347-388.
Alexander, C. O. and A. Dimitriu (2002) "The Cointegration Alpha: Enhanced Index Tracking and Long-Short Equity Market Neutral Strategies", Discussion Paper 2002-08, ISMA Centre Discussion Papers in Finance Series.
Beveridge, S. and C. R. Nelson (1981) "A New Approach to Decomposition of Economic Time Series into Permanent and Transitory Components with Particular Attention to Measurement of the Business Cycle", Journal of Monetary Economics 7, pp. 151-74.
Lucas, A. (1997) "Strategic and Tactical Asset Allocation and the Effect of Long - Run Equilibrium Relations", Research Memorandum 1997-42, Vrije Universiteit Amsterdam.
QuantStart.
الانضمام إلى كوانتكاديمي بوابة العضوية الخاصة التي تلبي احتياجات التجزئة المتزايد بسرعة المجتمع تاجر الكمي. سوف تجد مجموعة من ذوي الخبرة مثل التفكير من التجار الكميون على استعداد للرد على أسئلة التداول الكمي الأكثر إلحاحا.
تحقق من بلدي يبوك على التداول الكمي حيث أنا يعلمك كيفية بناء مربحة استراتيجيات التداول المنهجي مع أدوات بايثون، من الصفر.
نلقي نظرة على بلدي الكتاب الاليكتروني الجديد على استراتيجيات التداول المتقدمة باستخدام تحليل سلسلة زمنية، والتعلم الآلي والإحصاءات بايزي، مع بيثون و R.
By Michael Halls-Moore on June 2nd, 2018.
A while back we considered a trading model based on the application of the ARIMA and GARCH time series models to daily S&P500 data. We mentioned in that article as well as other previous time series analysis articles that we would eventually be considering mean reverting trading strategies and how to construct them.
In this article I want to discuss a topic called cointegration, which is a time series concept that allows us to determine if we are able to form a mean reverting pair of assets. We will cover the time series theory related to cointegration here and in the next article we will show how to apply that to real trading strategies using the new open source backtesting framework: QSTrader.
We will proceed by discussing mean reversion in the traditional "pairs trading" framework. This will lead us to the concept of stationarity of a linear combination of assets, ultimately leading us to cointegration and unit root tests . Once we have outlined these tests we will simulate various time series in the R statistical environment and apply the tests in order to assess cointegration.
Mean Reversion Trading Strategies.
The traditional idea of a mean reverting "pairs trade" is to simultaneously long and short two separate assets sharing underlying factors that affect their movements. An example from the equities world might be to long McDonald's (NYSE:MCD) and short Burger King (NYSE:BKW - prior to the merger with Tim Horton's).
The rationale for this is that their long term share prices are likely to be in equilibrium due to the broad market factors affecting hamburger production and consumption. A short-term disruption to an individual in the pair, such as a supply chain disruption solely affecting McDonald's, would lead to a temporary dislocation in their relative prices. This means that a long-short trade carried out at this disruption point should become profitable as the two stocks return to their equilibrium value once the disruption is resolved. This is the essence of the classic "pairs trade".
As quants we are interested in carrying out mean reversion trading not solely on a pair of assets, but also baskets of assets that are separately interrelated.
To achieve this we need a robust mathematical framework for identifying pairs or baskets of assets that mean revert in the manner described above. This is where the concept of cointegrated time series arises.
The idea is to consider a pair of non-stationary time series, such as the random-walk like assets of MCD and BKW, and form a linear combination of each series to produce a stationary series, which has a fixed mean and variance.
This stationary series may have short term disruptions where the value wanders far from the mean, but due to its stationarity this value will eventually return to the mean. Trading strategies can make use of this by longing/shorting the pair at the appropriate disruption point and betting on a longer-term reversion of the series to its mean.
Mean reverting strategies such as this permit a wide range of instruments to create the "synthetic" stationary time series. We are certainly not restricted to "vanilla" equities. For instance, we can make use of Exchange Traded Funds (ETF) that track commodity prices, such as crude oil, and baskets of oil producing companies. Hence there is plenty of scope for identifying such mean reverting systems.
Before we delve into the mechanics of the actual trading strategies, which will be the subject of the next article, we must first understand how to statistically identify such cointegrated series. For this we will utilise techniques from time series analysis, continuing the usage of the R statistical language as in previous articles on the topic.
Cointegration.
Now that we've motivated the necessity for a quantitative framework to carry out mean reversion trading we can define the concept of cointegration. Consider a pair of time series, both of which are non-stationary. If we take a particular linear combination of theses series it can sometimes lead to a stationary series. Such a pair of series would then be termed cointegrated .
The mathematical definition is given by:
Cointegration.
Let $\ $ and $\ $ be two non-stationary time series, with $a, b \in \mathbb $, constants. If the combined series $a x_t + b y_t$ is stationary then we say that $\ $ and $\ $ are cointegrated .
While the definition is useful it does not directly provide us with a mechanism for either determining the values of $a$ and $b$, nor whether such a combination is in fact statistically stationary. For the latter we need to utilise tests for unit roots .
Unit Root Tests.
In our previous discussion of autoregressive AR(p) models we explained the role of the characteristic equation . We noted that it was simply an autoregressive model, written in backward shift form, set to equal zero. Solving this equation gave us a set of roots .
In order for the model to be considered stationary all of the roots of the equation had to exceed unity. An AR(p) model with a root equal to unity - a unit root - is non-stationary. Random walks are AR(1) processes with unit roots and hence they are also non-stationary.
Thus in order to detect whether a time series is stationary or not we can construct a statistical hypothesis test for the presence of a unit root in a time series sample.
We are going to consider three separate tests for unit roots: Augmented Dickey-Fuller (AFD), Phillips-Perron and Phillips-Ouliaris. We will see that they are based on differing assumptions but are all ultimately testing for the same issue, namely stationarity of the tested time series sample.
Let's now take a brief look at all three tests in turn.
Augmented Dickey-Fuller Test.
Dickey and Fuller [2] were responsible for introducing the following test for the presence of a unit root. The original test considers a time series $z_t = \alpha z_ + w_t$, in which $w_t$ is discrete white noise. The null hypothesis is that $\alpha = 1$, while the alternative hypothesis is that $\alpha < 1 $.
Said and Dickey [6] improved the original Dickey-Fuller test leading to the Augmented Dickey-Fuller (ADF) test, in which the series $z_t$ is modified to an AR(p) model from an AR(1) model. I've discussed the test in a previous article where we've used Python to calculate it. In this article we will carry out the same test using R.
Phillips-Perron Test.
The ADF test assumes an AR(p) model as an approximation for the time series sample and uses this to account for higher order autocorrelations. The Phillips-Perron test [5] does not assume an AR(p) model approximation. Instead a non-parametric kernel smoothing method is utilised on the stationary process $w_t$, which allows it to account for unspecified autocorrelation and heteroscedasticity.
Phillips-Ouliaris Test.
The Phillips-Ouliaris test [4] is different from the previous two tests in that it is testing for evidence of cointegration among the residuals between two time series. The main idea here is that tests such as ADF, when applied to the estimated cointegrating residuals, do not have the Dickey-Fuller distributions under the null hypothesis where cointegration isn't present. Instead, these distributions are known as Phillips-Ouliaris distributions and hence this test is more appropriate.
Difficulties with Unit Root Tests.
While the ADF and Phillips-Perron test are equivalent asymptotically they can produce very different answers in finite samples [7] . This is because they handle autocorrelation and heteroscedasticity differently. It is necessary to be very clear which hypotheses are being tested for when applying these tests and not to simply apply them blindly to arbitrary series.
In addition unit root tests are not great at distinguishing highly persistent stationary processes from non-stationary processes. One must be very careful when using these on certain forms of financial time series. This can be especially problematic when the underlying relationship being modelled (i. e. mean reversion of two similar pairs) naturally breaks down due to regime change or other structural changes in the financial markets.
Simulated Cointegrated Time Series with R.
Let's now apply the previous unit root tests to some simulated data that we know to be cointegrated. We can make use of the defiition of cointegration to artificially create two non-stationary time series that share an underlying stochastic trend, but with a linear combination that is stationary.
Our first task is to define a random walk $z_t = z_ + w_t$, where $w_t$ is discrete white noise. Take a look at the previous article on white noise and random walks if you need to brush up on these concepts .
With the random walk $z_t$ let's create two new time series $x_t$ and $y_t$ that both share the underlying stochastic trend from $z_t$, albeit by different amounts:
\begin x_t &=& p z_t + w_ \\ y_t &=& q z_t + w_ \end.
If we then take a linear combination $a x_t + b y_t$:
\begin a x_t + b y_t &=& a (p z_t + w_ ) + b (q z_t + w_ ) \\ &=& (ap + bq) z_t + a w_ + b w_ \end.
We see that we only achieve a stationary series (that is a combination of white noise terms) if $ap + bq = 0$. We can put some numbers to this to make it more concrete. Suppose $p=0.3$ and $q=0.6$. After some simple algebra we see that if $a=2$ and $b=-1$ we have that $ap +bq = 0$, leading to a stationary series combination. Hence $x_t$ and $y_t$ are cointegrated when $a=2$ and $b=-1$.
Let's simulate this in R in order to visualise the stationary combination. Firstly, we wish to create and plot the underlying random walk series, $z_t$:
Realisation of a random walk, $z_t$
If we plot both the correlogram of the series and its differences we can see little evidence of autocorrelation:
Correlograms of $z_t$ and the differenced series of $z_t$
Hence this realisation of $z_t$ clearly looks like a random walk. The next step is to create $x_t$ and $y_t$ from $z_t$, using $p=0.3$ and $q=0.6$, and then plot both:
Plot of $x_t$ and $y_t$ series, each based on underlying random walk $z_t$
As you can see they both look similar. Of course they will be by definition - they share the same underlying random walk structure from $z_t$. Let's now form the linear combination, comb , using $p=2$ and $q=-1$ and examine the autocorrelation structure:
Plot of comb - the linear combination series - and its correlogram.
It is clear that the combination series comb looks very much like a stationary series. This is to be expected given its definition.
Let's try applying the three unit root tests to the linear combination series. Firstly, the Augmented Dickey-Fuller test:
The p-value is small and hence we have evidence to reject the null hypothesis that the series possesses a unit root. Now we try the Phillips-Perron test:
Once again we have a small p-value and hence we have evidence to reject the null hypothesis of a unit root. Finally, we try the Phillips-Ouliaris test (notice that it requires matrix input of the underlying series constituents):
Yet again we see a small p-value indicating evidence to reject the null hypothesis. Hence it is clear we are dealing with a pair of series that are cointegrated.
What happens if we instead create a separate combination with, say $p=-1$ and $q=2$?
Plot of badcomb - the "incorrect" linear combination series - and its correlogram.
In this case we do not have sufficient evidence to reject the null hypothesis of the presence of a unit root, as determined by p-value of the Augmented Dickey-Fuller test. This makes sense as we arbitrarily chose the linear combination of $a$ and $b$ rather than setting them to the correct values of $p=2$ and $b=-1$ to form a stationary series.
الخطوات التالية.
In this article we examined multiple unit root tests for assessing whether a linear combination of time series was stationary, that is, whether the two series were cointegrated.
In future articles we are going to consider full implementations of mean reverting trading strategies for daily equities and ETFs data using QSTrader based on these cointegration tests.
In addition we will extend our analysis to cointegration across more than two assets leading to trading strategies that take advantage of cointegrated portfolios.
المراجع.
مجرد بدء مع التداول الكمي؟
3 أسباب الاشتراك في قائمة البريد الإلكتروني كوانتستارت:
1. دروس التداول الكمي.
سوف تحصل على إمكانية الوصول الفوري إلى دورة مجانية 10-البريد الإلكتروني معبأة مع تلميحات ونصائح لمساعدتك على البدء في التداول الكمي!
2. جميع أحدث المحتوى.
كل أسبوع سوف نرسل لك التفاف جميع الأنشطة على كوانتستارت لذلك عليك أن لا يفوتون وظيفة مرة أخرى.
ريال مدريد، وقابلة للتنفيذ نصائح التداول الكمي مع أي هراء.
Comments
Post a Comment