strategy("risk to reward 1:1", overlay=true)
//Buy entry
longEntryCondition = close > nz(longEntryCondition[1],open) and (close - open)[1] > 0
if longEntryCondition and not nz(longExitCondition[1],false)
strategy.entry("Long", strategy.long, comment="Buy")
//Stoploss
stopLevel = open - (open - close)[1]
if longEntryCondition
strategy.exit("StopLoss", "Long", stop=stopLevel, comment="StopLoss")
//Take profit
takeProfitLevel = entryPrice + (open - close)[1]
if longEntryCondition
strategy.exit("TakeProfit", "Long", profit=takeProfitLevel, comment="TakeProfit")
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在
使用條款閱讀更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在
使用條款閱讀更多資訊。