Below i have written a simple scan below to illustrate a problem i am having 
with StrFormat?
The code below always displays in the 5th column, "lower 0 day later", even 
though the value for 'whichDayLower' is being displayed correctly in it's own 
column (values of either 0, 1, or 2).  In cases where whichDayLower = 1, it 
should display "lower 1 day later". Same for when whichDayLower = 2, it should 
display "lower 2 day later".  Can anyone assist with this.

-----------------------------------------
N1 = 1;
N2 = 2;

sig = cross(ma(c,50),ma(c,200));

pctChgN1 = (ref(C, N1) - C)/C * 100;
pctChgN2 = (ref(C, N2) - C)/C * 100;

whichDayLower= iif((pctChgN1 <0), N1, 0);
whichDayLower= iif((pctChgN2 <0) && !whichDayLower, N2, 0);

strLower = StrFormat("lower %g day later", whichDayLower);

AddColumn (C, "Close", 1.2);
AddColumn (whichDayLower, "Close", 1.2);
AddTextColumn(strLower , "Close");
AddColumn( pctChgN1 , "pctChgN1" , 1.2, IIf(pctChgN1 < 0, colorRed, 
colorGreen));
AddColumn( pctChgN2 , "pctChgN2" , 1.2, IIf(pctChgN2 < 0, colorRed, 
colorGreen));

Filter = sig ;

Reply via email to