adolgov

Stepped trailing strategy example

‎6912‎ مشاهدة
563
This is a stepped trailing exit example for educational purpose.

Short brief.
There are 1 stop loss and 3 profit levels.
  • When first tp is reached we move stop loss to break-even.
  • When second tp is reached we move stop loss to first tp.
  • When third tp is reached we exit by profit.
ملاحظات الأخبار: Stop Loss & Take Profit in %% for independence from instrument's tick size.
ملاحظات الأخبار: New input `activateTrailingOnThirdStep` added.
With `activateTrailingOnThirdStep = true` when tp2 will be reached, the strategy places trailing stop with amount at tp3 level and offset at tp2 level.
By default the old behavior remains.
إزالة من البرامج النصية المفضلة إضافة إلى المؤشرات المفضلة

التعليقات

500 ‎عملة افتراضية
+3 رد
So nice script!

Abusing your knowledge a bit, could you do something like this in a study version and with % instead of points?

It would be magnificent.
+11 رد
This publication is now featured in our Editors' Picks: https://www.tradingview.com/scripts/editors-picks/ .
In the name of all TradingView traders, thank you for your valuable contribution to the TradingView community, and congrats!
+2 رد
Really nice, clean and usefull script!!

Too bad the "strategy" commands don't work in studies, this would be so helpfull and avoid a lot of unneccesary coding and keeping track of variables.

Good job!

Gr, JD.
+2 رد
adolgov Duyck
@Duyck, the `strategy` can all things that `study` can )
+1 رد
Duyck adolgov
@adolgov, I know, but a study can't do all the things a strategy can.
it would be super usefull if the "wall" between strategies and studies would disappear.

right now studies can't keep track of trades and strategies can't launch alerts,...
+1 رد
adolgov Duyck
@Duyck, strategies will can launch alerts soon ;-)
+2 رد
Duyck adolgov
@adolgov, Great!! ;-)
+1 رد
nilux Duyck
@Duyck, yeah I was thinking the same. It's a great strategy but it would be a dirty job to turn this into a study, maybe with 500 lines of code to keep track of all the entries, exits etc...
رد
nice script:)
+1 رد
الصفحة الرئيسية منصة الأسهم منصًة العملات منصّة العملات الرقمية جدول الأعمال الاقتصادي كيف تعمل مميزات الرسم البياني أسعار العضوية إحالة صديق قوانين الموقع مركز المساعدة حلول المواقع الإلكترونية والوسطاء الأدوات حلول الرسوم البيانية مكتبة الرسوم البيانية صغيرة الحجم المدوّنة والأخبار تويتر
ملف التعريف إعدادات الصفحة الشخصية الحساب وإعداد الفواتير الأصدقاء المُحالون العملات الافتراضية تذاكر الدعم الخاصة بي مركز المساعدة التحاليل المنشورة المتابعين تُتابع رسالة خاصة المحادثة تسجيل الخروج