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

[amibroker] Indicator stops displaying if zooming in too far.



PureBytes Links

Trading Reference Links

Unhappy with the results I was getting with CompositeEquity, I 
created an index as an indicator (I'll post the code below).  I 
assigned equal dollar amounts to each stock, calculated the number of 
shares for each stock, multiplied the shares by the closing prices 
and added them all together.

The difficulty is a strange one.  With the chart zoomed out to 
display a year (or more) of price bars, the index/indicator displays 
just as it should, with an appropriate scale on the right-hand side 
of the screen.  Zooming in to display 8 months or so the line 
displaying index/indicator disappears, the scale on the right-hand 
side of the index chart changes to a range of 0.0000-0.1000, and the 
title changes to "Indexpr={EMPTY}".  

It's a problem unique to this indicator, not a general problem with 
all my indicators.  Any ideas as to how to fix this so that the 
indicator displays properly at every zoom setting?  TIA.


Sebastian


start=1051003;

Stequity=1000;

Abaxsh=Stequity/(ValueWhen(DateNum()==start,(Foreign("ABAX","C"))));
Abaxpr=Foreign("ABAX","C")*Abaxsh;

Babysh=Stequity/(ValueWhen(DateNum()==start,(Foreign("BABY","C"))));
Babypr=Foreign("BABY","C")*Babysh;

Epexsh=Stequity/(ValueWhen(DateNum()==start,(Foreign("EPEX","C"))));
Epexpr=Foreign("EPEX","C")*Epexsh;

Jdassh=Stequity/(ValueWhen(DateNum()==start,(Foreign("JDAS","C"))));
Jdaspr=Foreign("JDAS","C")*Jdassh;

Mrgesh=Stequity/(ValueWhen(DateNum()==start,(Foreign("MRGE","C"))));
Mrgepr=Foreign("MRGE","C")*Mrgesh;

Nwresh=Stequity/(ValueWhen(DateNum()==start,(Foreign("NWRE","C"))));
Nwrepr=Foreign("NWRE","C")*Nwresh;

Osursh=Stequity/(ValueWhen(DateNum()==start,(Foreign("OSUR","C"))));
Osurpr=Foreign("OSUR","C")*Osursh;

Petssh=Stequity/(ValueWhen(DateNum()==start,(Foreign("PETS","C"))));
Petspr=Foreign("PETS","C")*Petssh;

Rnowsh=Stequity/(ValueWhen(DateNum()==start,(Foreign("RNOW","C"))));
Rnowpr=Foreign("RNOW","C")*Rnowsh;

Scursh=Stequity/(ValueWhen(DateNum()==start,(Foreign("SCUR","C"))));
Scurpr=Foreign("SCUR","C")*Scursh;


Indexpr=Abaxpr + Babypr + Epexpr + Jdaspr + Mrgepr + Nwrepr + Osurpr 
+ Petspr + Rnowpr + Scurpr;
Plot(Indexpr,"Indexpr",3,style=styleLine);






  





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/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/