Indicator Superposition
Posted: Jun 30 2010
I wrote an indicator that is supposed to display some info on the LAST BAR ONLY.
The problem is that it works right when the indicator is applied to the strat at first, but as soon as another 1mn tick comes in, the display just DOUBLES and the (lastbaronchart - 1) does NOT erase.
How can I have this indicator just displaying on LAST BAR ONLY (see snapshot) ?
Here's the code (fyi, "displ" is a very simple function that I wrote) :
thanks
The problem is that it works right when the indicator is applied to the strat at first, but as soon as another 1mn tick comes in, the display just DOUBLES and the (lastbaronchart - 1) does NOT erase.
How can I have this indicator just displaying on LAST BAR ONLY (see snapshot) ?
Here's the code (fyi, "displ" is a very simple function that I wrote) :
Code: Select all
value3 = GVGetNamedDouble("tot_pl",value1);
value4 = GVGetNamedDouble("mo_pl",value1);
value5 = GVGetNamedDouble("sprd",value1);
if LastBarOnChart then value10=displ("TotP/L:" + numtostr(value3,0) + "$", +2, "yellow" ) ;
if LastBarOnChart then value10=displ("MonthlyP/L:" + numtostr(value4,0) + "$", +4, "yellow" ) ;
if LastBarOnChart then value10=displ("Spread:" + numtostr(value5,1) + "p", +6, "yellow" ) ;