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

[amibroker] Re: if else problem



PureBytes Links

Trading Reference Links

Something like this?

z = CCI();
pos = z > 0;
neg = !pos;

trend5 = Flip( Sum( pos, 5 ) == 5, Sum( neg, 5 ) == 5 ) ; 
Color = IIf( trend5 == 1 AND pos, colorPaleGreen, 
        IIf( trend5 == 0 AND neg, colorPink, colorLightGrey ) );

Plot( z, "", colorBlue, styleLine );
Plot( z, "", color, styleHistogram|styleThick );


/Johan


--- In amibroker@xxxxxxxxxxxxxxx, "coba702002" <coba702002@xxxx> 
wrote:
> can anyone help with this code... it doesn't enter the last else 
to 
> color the bar grey... i have tried to move the grey bar color to 
be 
> the else from the plus/minusbar if and then it never gets into 
> coloring the red and green
> 
> what this code does that im trying to change is: after 5 bars 
above 
> or below it paints green/red. Thats fine, however if there are 5 
> bars above and below the zero line and it changes direction and 
gets 
> on the opposite side of the trend but doesn't make the 5 bar 
min... 
> THEN goes back in the direction of the original trend i want it to 
> pick up that trend color and not reset to grey and wait for the 
5th 
> bar again
> 
> any help would be appreciated... im going batty looking at this
> 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

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

<*> 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/