//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")
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. קרא עוד בתנאים וההגבלות.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.