Code Library / Moving Average
Pine Script Triple MA
Triple MA system with fast, medium, and slow for trend confirmation.
Language: Pine Script · Category: Moving Average · Tags: triple MA, moving average, Pine Script, trend, strategy
Source code
//@version=5
strategy("Triple MA",overlay=true)
f=ta.ema(close,10); m=ta.ema(close,25); s=ta.sma(close,50)
if f>m and m>s and ta.crossover(close,f)
strategy.entry("Long",strategy.long)
if f<m and m<s and ta.crossunder(close,f)
strategy.entry("Short",strategy.short)
plot(f,"Fast",color.green); plot(m,"Med",color.orange); plot(s,"Slow",color.red)How to use this snippet
This is a building block, not a finished trading system. Paste it into your own Pine Script project, compile it, and test it on a demo account with your broker's real spreads before relying on it. You can convert it to MQL4 or MQL5 with the Pine Script converter.