OPEN-SOURCE SCRIPT

SHAAKUNI INDICATO

//version=5
indicator("Simple Moving Average Crossover", overlay=true)

// Input for Moving Averages
fastLength = input.int(10, title="Fast MA Length")
slowLength = input.int(20, title="Slow MA Length")

// Calculating Moving Averages
fastMA = ta.sma(close, fastLength)
slowMA = ta.sma(close, slowLength)

// Plotting Moving Averages
plot(fastMA, color=color.green, title="Fast MA")
plot(slowMA, color=color.red, title="Slow MA")

// Highlight Buy/Sell Signals
buySignal = ta.crossover(fastMA, slowMA)
sellSignal = ta.crossunder(fastMA, slowMA)

plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.new(color.green, 0), style=shape.labelup, text="BUY")
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.new(color.red, 0), style=shape.labeldown, text="SELL")
almaaverageCandlestick analysisChart patternsmoving_average

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明