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

Re: [amibroker] Trade the Markets Squeeze Indicator in AB



PureBytes Links

Trading Reference Links

Jerry Gress wrote:

> |Plot( 2, /* defines the height of the ribbon in percent of pane width */|
> |"Ribbon",|
> |IIf( up, colorGreen, IIf( down, colorRed, 0 )), /* choose color */|
> |styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );|
>
> |Plot( Close, "Price", colorBlue, styleCandle );|

It's not often I know the answer to a question, so:

"Up" and "down" aren't words that Amibroker recognizes. You need either 
to define them before they are used or to substitute something else for 
them that AB will understand. At a guess, the technique defines "up" as 
C > O and "down" as C < O. [It could be C > Ref(C,-1) or C < Ref(C,-1).] 
So before your Plot() statements, add these lines:

up=C > O;
down=C < O;

Alternatively, you can change that part of the Plot() statement to:

|IIf(C > O, colorGreen, colorRed) .

Note that you don't really need nested IIFs to get the job done. This 
version will also color bars red if C==O. If you want C==O to come out 
green, you can use:

IIf(C < O, colorRed, colorGreen) .

Good luck with it.

Owen Davies
|


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/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/