Creating a commodity channel index in blox

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Post Reply
gm
Contributor
Contributor
Posts: 3
Joined: Tue Nov 13, 2007 11:11 am
Location: MI

Creating a commodity channel index in blox

Post by gm »

I have been trying to create a "commodity channel index" block

and having trouble with the "counter" and length variables, and perhaps more.

This may be a little beyond my capabilities at this time.

If anyone has already constructed this indicator in blox and is willing to share it, I'd appreciate it?
Roger Rines
Roundtable Knight
Roundtable Knight
Posts: 2038
Joined: Wed Oct 06, 2004 10:52 am
Location: San Marcos, CA

Post by Roger Rines »

Creating a Blox for the CCI indicator shouldn't be much of an effort. However, when you are new to a program I find some projects are easier to accomplish when you look at how other indicators were created.

If you have not poked around in the Blox MarketPlace forum for some ideas, that would be were I would go next. For example if you go poking around in that forum section, you might find this Blox: Hull Moving Average Function

That Blox should teach you what you need to know about dealing with the FOR loop you'll need for the CCI function.

If after you've looked at that Blox and hopefully others as well, and you still don't get there, consider posting what you've accomplished in the Trading Blox Support section, However, if Tim gets this posting moved there before you need help on whatever remaining items you'll need help, just keep posting in this thread to keep the pieces together.

Don't worry, you'll get there, if you don't give up. This is an easy indicator to create.
Roger Rines
Roundtable Knight
Roundtable Knight
Posts: 2038
Joined: Wed Oct 06, 2004 10:52 am
Location: San Marcos, CA

Post by Roger Rines »

Here is something to give you hope.
Attachments
Commodity Channel Index
Commodity Channel Index
TB_CCI_Indicator.png (29.33 KiB) Viewed 6901 times
Tim Arnold
Site Admin
Site Admin
Posts: 9024
Joined: Tue Apr 06, 2004 1:41 pm
Location: Boston, MA
Contact:

Post by Tim Arnold »

Here is a quick sample block that plots the CCI Index. The parameters are the number of bars to use for the CCI, as well as the CCI Constant.

You can drop this in any system, and the CCI will plot on the trade chart. To use the cci indicator in your entry/exit block, just define an external series variable called "cci" and it will be available to access and use.
Attachments
plot cci.tbx
(5.97 KiB) Downloaded 658 times
gm
Contributor
Contributor
Posts: 3
Joined: Tue Nov 13, 2007 11:11 am
Location: MI

Post by gm »

Thanks, Roger. I'll see what I can do.
Roger Rines
Roundtable Knight
Roundtable Knight
Posts: 2038
Joined: Wed Oct 06, 2004 10:52 am
Location: San Marcos, CA

Post by Roger Rines »

Glad you're going to give it a go. There is a lot of information available on the forum, and if you ask questions, you'll get to fill in the gaps you need to make the process easier each time you make a go at something new.
Post Reply