Gesundheit

Customizable trailing Stop For Manual Entries

Gesundheit 已更新   
Here's how to create a trailing stop with a manual buy order, on an exchange that does not support native trailing stops. Code can easily be copy+pasted into your normal algos.

To set the entry price for your manual trade, specify the bar time when the trade was made. Note that the time you specify needs to correspond to an opening time on your chart--if it's a 3 hour chart, 6 pm or 9 pm will work, but 8 PM will not. It's not as bad as it sounds though, read on :)

Per usual I keep multiple options open.

Special features in this script:
  • Change time frame for trailing
  • Specify trailing parameter (high, close, hlc3, etc.)
  • Change time frame for stop loss trigger (use a shorter time frame for earlier exits!)
  • Specify trigger parameter (close, low, hlc3, etc.)

Remember that annoying issue where you might not be able to precisely specify entry price, because you want to use 3 hour closing prices for your trailing stop but you bought in at 7:41 pm? Add this indicator to a 1 minute chart and set your start time to 19:41, then set the trailing time frame to 3 hours!

Next stop is v2, where we take profits along the way before stop loss gets triggered.
發布通知:
Disabled plotting of variables outside of the trading period, so the script does not mess up chart scaling.

Attempted to add trailing stop capability for short trades, but for some reason it's not working. Anybody have a clue?
發布通知:
Trailing stop now works for shorts :)
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?