adolgov

Stepped trailing strategy example

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.
從常用腳本中移除 Add to favorite indicators

評論

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.
+12 回覆
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 回覆
首頁 股票篩選器 外匯篩選器 加密貨幣篩選器 全球財經日曆 如何運作 圖表功能 價格 推薦朋友 網站規則 幫助中心 網站 & 經紀商解決方案 小工具 圖表解決方案 輕量圖表庫 部落格 & 新聞 推特
概覽 個人資料設定 賬戶和賬單 推薦朋友 代幣 我的客服工單 幫助中心 私人訊息 在線聊天 登出