VNINDEX

Flyup

58
Pine Script®
RSIExit = input(55, "RSI Exit")
RSILength = input(4, "RSI Length")

testPeriod() =>
time >= testPeriodStart and time <= testPeriodStop ? true : false

longSMA = sma(close, 200) // 200-day moving average
rsi = rsi(close, RSILength) // relative strength indicator with custom length

longCondition = close > longSMA // closing price is above 200-day sma

if longCondition and testPeriod()
strategy.entry("CALL", strategy.long, 100, when=rsi <= RSIEntry)
strategy.close("CALL", when=rsi >= RSIExit)

免責聲明

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