SDP51 Try this. 

The KISS principle works for me.  You could stick the parm statement in the

code line if you really want to, but why?  This is easier to read.

Wouldn't you want to parametize the test threshold limits instead?

HTH

Joe

 

THL = IIf(H != L, H - L, 0.01);

BOP = (C - O)/THL;

col1 = ParamColor("Bulls",colorGreen);

col2 = ParamColor("Bears",colorRed);

col3 = ParamColor("Indecision",colorYellow);

col = IIf( Ref(BOP,-1) > 0.1, col1, IIf(BOP < - 0.1, Col2, IIf(BOP > - 0.1 ,Col3,0)));

Plot(BOP, "BOP", col, styleHistogram | styleThick | styleArea);

----- Original Message -----
From: "sdp_51" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 28, 2006 8:20 PM
Subject: [amibroker] Newbie trying to create an indicator

> Hi,
>
> I'm trying to create a balance of power indicator which has a simple
> formula but I want to display it in a somewhat complex way.
>
> I want to plot the parts over a certain value in green, those in a
> range in yellow and those below a certain value in red.
>
> here is my code:
>
> THL = IIf(H != L, H - L, 0.01);
>
> BOP = (C - O)/THL;
>
> col = IIf( Ref(BOP,-1) > .1, ParamColor("Bulls",colorGreen),1);
> col = IIf( col=1 & Ref(BOP,-1) < -.1,ParamColor("Bears",colorRed),1);
> col = IIf( col=1 & Ref(BOP,-1) > -.1,ParamColor
> ("Indecision",colorYellow),1);
>
> Plot(BOP, "BOP", col, styleHistogram | styleThick | styleArea);
>
> It doesn't work.  The syntax checks out according to AB but the graph
> doesn't display correctly.  All the bars are yellow, and there are
> gaps in it, which I am assuming are supposed to be the other color
> parts of the indicator.  However, I also notice that though in my
> code, anything over .1 should be green and those under -.1 should be
> red, the yellow bars are all over the place, within the range and
> above and below those limits.  Can anyone help?
>
>
>
>
>
>
> 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/
>
> <*> 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:[EMAIL PROTECTED]
>   
mailto:[EMAIL PROTECTED]
>
> <*> To unsubscribe from this group, send an email to:
>   
[EMAIL PROTECTED]
>
> <*> Your use of Yahoo! Groups is subject to:
>   
http://docs.yahoo.com/info/terms/

>
>
>
>
__._,_.___

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






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to