Hello Nik,

you can do this easily with the sum function:

FinalCondition = sum(condition1+Condition2+Condition3,1);
Graph0 = FinalCondition;
Buy = FinalCondition >1; //or > 2

Regards
 
Thomas
www.tradingbasis.com


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of nikkunayar
Sent: Wednesday, September 13, 2006 9:31 AM
To: [email protected]
Subject: [amibroker] cumulative indicator in Amibroker

Hi everyone

It's been a while, hope all are well. Good to see the group going strong.

I am trying to code something in AB. I have asked support for help and
they tried, but unfortunately I have not been able to convey to them
exactly what it is that I need, and I don't want to keep bugging them
about it. I tried to figure out how to do this using the help, but no
luck.

I want to create a 'cumulative indicator', which shows how many of a
sub-set of indicators are true at any time. Let us say that my
three sub-indicators are

1. condition1=Cross( Close, EMA(Close,9) );

2. condition2=c==hhv(c,21);

3. condition3=rsi(14)>ref(rsi(14),-1);

I want a cumulative indicator that will plot a '1' if any one of these
conditions is true, plot a '2' if any two are true, and plot a '3' if
all three indicators are in a true state. The resulting indicator
would look something like a staircase going up and down from 0 to 3
and back, variably.

Obviously the indicators that I have here are more complex, but I hope
this conveys the gist of what I want. I would also like to plot the
different true conditions as different coloured bars, but I hope I can
adapt an answer to this post for that.

As always, I wish I could offer more in return... any help is appreciated.

Nik





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






 




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/
 


Reply via email to