Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.
Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.
By using this site, you agree to our Terms of Use.
Trend Indicator Paintbar
in Coding Forum
Posted
I have taken this above suggestion and modified Squire69's code a little bit to include a Yellow color for "no trend". I have compared my version to the TradeTheMarket's TTMTrend and I like my version better.
For those who maybe interested (see below).
I am also wanting to find some kind of indication that the trend may be extrended and paint it with a different color (one for up, one for down). Any idea what might be used?
= = = = = = = = = = =
inputs:
Price( Close ),
FastLength( 9 ),
MidLength( 12 ),
SlowLength( 16 ),
UpColor( Green ),
NoTrendColor( Yellow ),
DnColor( Red );
variables:
FastAvg( 0 ),
MidAvg( 0 ),
SlowAvg( 0 ) ;
FastAvg = Average( Price, FastLength ) ;
MidAvg = Average( Price, MidLength ) ;
SlowAvg = Average( Price, SlowLength ) ;
if (FastAvg > MidAvg) and (MidAvg > SlowAvg) then
begin
PlotPaintBar( High, Low, "MACross", UpColor ) ; // This is Uptrend
Alert( "FastAvg above SlowAvg" ) ;
end
else if (FastAvg < MidAvg) and (MidAvg < SlowAvg) then
begin
PlotPaintBar( High, Low, "MACross", DnColor ) ; // This is Downtrend
Alert( "FastAvg below SlowAvg" ) ;
end
else
PlotPaintBar( High, Low, "MACross", NoTrendColor) ; // This is No trend