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

[amibroker] Newbie - help to create an indicator



PureBytes Links

Trading Reference Links

I am new to Amibroker language, and not in touch with programming in
general for some time now. I read about %C indicator in "Futures &
Options Trader" magazine (issue Oct. 2008) Here is what is says:

=====================================
The %C indicator uses true range
to measure trend strength, as follows:

1. Add each bar's true range in the 14-bar look-back period.

2. Divide this running total by the largest one-day true range 
value of that look-back period.

3. Calculate the logarithm of the raw value from step 2.

4. Divide the result by the logarithm of the look-back 
period (14, in this case).

5. Multiply by 100.

The following example uses 15-minute bars on the E-Mini Russell 2000
futures. On Sept. 12 at noon, the running total of the E-Mini Russell
2000 futures' 14-bar true range was 47.3,and the largest one-bar
true-range of the past 14 bars was 5. The %C reading would be:

1. 47.3/5 = 9.46.
2. log(9.46) = 0.9758.
3. log(14) = 1.1461
4. 0.9758/1.1461 = .8514
5. 0.8514*100 = 85.14

Therefore, the %C indicator's value is 85.14. Logarithms are used
calculation to make sure the extreme levels range from one to 99.
==============================================================

Can someone help to code this?

Thanks in advance,

- SRJ


------------------------------------

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