[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minutes left in bar indicator exercize



PureBytes Links

Trading Reference Links

however it does not work properly and also draws not only on last bar on chart but on all previous bars 
in real time.

could someone fix this problem to make it display only on the last bar in real time, if possible.
can be sort of a good exercise in EL.

setup: 
*** set "space to the right" to 10 bars. 
load 5 min chart in real time. 
load indicator. 
observe "<  n" to the right of the close, where n = number of minutes left in the bar.

post solution here.

good trading.
bilo.
var: min_left 	( "" ), { minutes left in bar }
	 ref 		( 0 );	{ ref # of text object }

if lastbaronchart then begin  
	{ string for text object }
	min_left = "<          " + numtostr(timetominutes(time) - timetominutes(currenttime),0);
	ref = text_new(date,time+1,close, min_left ); 
	text_setstyle( ref, 0, 2 );
	text_setcolor(ref, tool_yellow );
	{ debug }
	{ print ( min_left, ref ); }
end;