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

[amibroker] Help Required concerning Ratios in Amibroker



PureBytes Links

Trading Reference Links

Hello again,

I posted this question sometime ago and I had some help regarding 
the creation of ratios in Amibroker. What I need to do is to create 
a simple ratio between two stocks and to be able to apply various 
indicators on this "new" security. For example, I need to create a 
ratio between ORCL and MSFT (ORCL/MSFT). I coded it as follows:

OM=Open/Foreign("MSFT","Close");
HM=High/Foreign("MSFT","Close");
LM=Low/Foreign("MSFT","Close");
CM=Close/Foreign("MSFT","Close");
PlotOHLC(OM,HM,LM,CM,"SRatio",colorRed, styleCandle);

I apply this forula to the ORCL chart and it creates the ratio in a 
new panel. So far, so good! That's exactly what I want. But with 
this, I cannot apply indicators on this ratio. And that's what I 
need to do!

So I did as follows:

OM=Open/Foreign("MSFT","Close");
HM=High/Foreign("MSFT","Close");
LM=Low/Foreign("MSFT","Close");
CM=Close/Foreign("MSFT","Close");
PlotOHLC(OM,HM,LM,CM,"SRatio",colorRed, styleCandle);
AddToComposite(CM,"~Satio","C",1+2+8+16);
AddToComposite(HM,"~Satio","H",1+2+8+16);
AddToComposite(LM,"~Satio","L",1+2+8+16);
AddToComposite(OM,"~Satio","O",1+2+8+16);

Now as I understand this (please feel free to correct me as I am a 
newbie in Amibroker), the first five lines create the new security 
and plots it. The last four lines basically creates a new composite 
(~Satio) which I can find in the symbol bar and apply it to new 
templates.

However, it seems to work fine for the first security that I apply 
on; but for the second security it doesn't refresh. I need to 
refresh this new composite with each new stock that I open; but that 
doesn't seem to be the case. I open the first stock "ORCL"; then 
apply this new formula which creates and displays the ratio in a new 
pane; then in the symbol field I put in the new composite (~Satio) 
which then replaces ORCL with this nex composite. Now I change the 
stock to "CSCO" and now ~Satio doesn't update!!

Can anybody help me in this regard??? All I need to do is to create 
a ratio between two stocks; plot it and then apply indicators on 
this composite.

Any help would be highly appreciated.

Thanks again in advance for your help.

Regards,
S.






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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

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