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

[amibroker] StrFormat issue



PureBytes Links

Trading Reference Links

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 ;



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/