I have an indicator that works great on minute charts but it does not work on second charts. It either does not display or the trend line extension doesn't align with the 2 latest data points. Can someone please help me with this. Much appreciated!!
[ inputs: Displace( 5);
Variables: Price(0), Length( 5), NumATRs( .5);
Variables: Avg( 0 ), Shift( 0 ), LowerBand( 0 ), Pi2( 0 ) ,
TL(-1);
Price=(low );
AVG = AverageFC( Price, Length ) ;
Shift = NumATRs * AvgTrueRange( Length ) ;
Pi2 = Avg + Shift ;
if Displace >= 0 or CurrentBar > AbsValue( Displace ) then
begin
Plot1[Displace]( Pi2, "Pi#2" ) ;
Once TL=TL_New(Date,Time,0,Date,Time,0);
TL_SetEnd(TL,Date[Displace],Time[Displace],Plot1 [Displace] );
TL_SetBegin(TL,Date[Displace+1],Time[Displace+1],Plot1[Displace+1]);
TL_SetExtRight(TL,true) ;
TL_SetStyle(TL, tool_dotted);
TL_SetColor(TL,darkgreen);
end; ]
Please get it to work on second charts [SOLVED]
Re: Please get it to work on second charts [SOLVED]
Hi PiTrader... So the problem is you need to add the _s suffix to break it down to seconds... Try this. Youll notice that i added the suffix to both tl new and tl sets as well as the time calls..
Once TL=TL_New_s(Date,Time_s,0,Date,Time_s,0);
TL_SetEnd_s(TL,Date[Displace],Time_s[Displace],Plot1 [Displace] );
TL_SetBegin_S(TL,Date[Displace+1],Time_s[Displace+1],Plot1[Displace+1]);
Once TL=TL_New_s(Date,Time_s,0,Date,Time_s,0);
TL_SetEnd_s(TL,Date[Displace],Time_s[Displace],Plot1 [Displace] );
TL_SetBegin_S(TL,Date[Displace+1],Time_s[Displace+1],Plot1[Displace+1]);