니프티 50 인덱스

AATMANIRBHAR INDICATOR

150
//version=5
strategy("Aatmanirbhar Indicator with Buy/Sell Orders and Alerts", overlay=true)

// Input parameters
fast_length = input.int(9, "Fast MA Length")
slow_length = input.int(21, "Slow MA Length")

// Calculate moving averages
fast_ma = ta.sma(close, fast_length)
slow_ma = ta.sma(close, slow_length)

// Determine buy and sell signals
buy_signal = ta.crossover(fast_ma, slow_ma)
sell_signal = ta.crossunder(fast_ma, slow_ma)

// Place buy and sell orders
strategy.entry("Buy", strategy.long, when=buy_signal)
strategy.entry("Sell", strategy.short, when=sell_signal)

// Plot buy and sell signals on the chart
plotshape(series=buy_signal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(series=sell_signal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)

// Send alerts for buy and sell signals
alertcondition(condition=buy_signal, title="Buy Signal", message="Buy Signal Detected")
alertcondition(condition=sell_signal, title="Sell Signal", message="Sell Signal Detected")

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.