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

[amibroker] AB Guru's help, please.



PureBytes Links

Trading Reference Links

Hello,

I am trying to develop code for charts that would help determine 
market range and expansion and market opens. The idea is to give an 
idea of the potential risks AND rewards for any trade taken during 
the Day, by knowing what A typical trading Day looks like. 

I would need to do catalog the following: 

open
low
high
close
the distance from the Open to the Low
the distance from the Open to the High
the distance from the Open to the Close
the smallest distance from the Open for that day
the largest distance from the Open for that day

Then I would like to plot the following:

the 10 Day average of the smallest distance 
the 10 Day average of the largest distance


So far I have the following:

Cond1=abs(O-L);
Cond2=abs(O-H);
Cond3=abs(O-C);

The next part is where I am having problems. I believe that I would 
require an IIf statement to complete the next step, iif( EXPRESSION, 
TRUE_PART, FALSE_PART ).The formula result = iif( macd()<signal(), 
Volume, -Volume)was given as AB example. But I am having problems in 
the code that will return the lowest are highest value to be used in 
ploting the 10 dma.

// I need to plot the 10 dma of the the smallest distance from the 
open. That means the smallest distance from open whether that 
distance be the current high or low for the day. 

Smallest=iif(cond1<cond2 and cond1<cond3, cond1, null) or 
         iif(cond2<cond1 and cond2<cond3, cond2, null) or 
         iif(cond3<cond1 and cond3<cond2, cond3, null);

However the above code does not return the smallest of the three 
values (i.e. cond1, cond2, or cond3).

Plot(MA(Smallest,10),"MAs",2,styleLine);

//I need to plot the 10 dma of the the largest distance from the 
open. That means the largest distance from open whether that 
distance is the current high or low for the day.

Largest =iif(cond1>cond2 and cond1>cond3, cond1, null) or 
         iif(cond2>cond1 and cond2>cond3, cond2, null) or 
         iif(cond3>cond1 and cond3>cond2, cond3, null);

Same as above, formula does not return the largest value.

Plot(MA(Largest,10),"MAl",3,styleLine);

I maybe making this more complicated than it is. Regardless I could 
use your help.

Thank You
Mike
 



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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