PureBytes Links
Trading Reference Links
|
Hi,
You may find the following document useful for some ideas (thanks to
Herman):
http://www.amibroker.org/3rdparty/IntroToAtc.pdf
Additionally, be sure to study page 17 to ensure that your immediate
Foreign usage of ~MyIndex within a single exploration is behaving as
you expect.
Mike
--- In amibroker@xxxxxxxxxxxxxxx, "toddk63" <toddk63@xxx> wrote:
>
> I have created a custom "Index" using "AddToComposite". Here is the
> code that runs in Exploration:
> -----------------------------------------
> Counter = IIf(IsNull(Close),0,1);
>
> AddToComposite( Counter * ROC(Close,1), "~MyIndex", "C", 1+2+8+16 );
> AddToComposite( Counter, "~MyIndex", "I", 1+2+8+16 );
>
> Index = 100 + Cum(Foreign( "~MyIndex", "C" ) / Foreign( "~MyIndex",
> "I" ));
>
> Multiplier = (100 + Foreign( "~MyIndex", "C" )/Foreign( "~MyIndex",
> "I" ))/100;
>
> Filter=1;
>
> AddColumn (Close,"Close");
> AddColumn (Index,"Index");
> AddColumn (Multiplier*100,"Multiplier x 100");
> --------------------------------------------------
> The problem is using the "CUM" function adds the daily percent
change
> to calculate the "Index". I wish to use the "Multiplier" to
calculate
> an index where the previous days index value is multiplied by the
> "Multiplier". The index should initialize as "Index = 100" to start
> with the first bar. Its probably simple fix, but I can't get there.
>
> Frustrated,
>
> Todd K.
>
------------------------------------
**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
*********************
TO GET TECHNICAL 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/
|