Page 1 of 1

Creating a commodity channel index in blox

Posted: Tue Nov 13, 2007 12:44 pm
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?

Posted: Tue Nov 13, 2007 3:45 pm
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.

Posted: Tue Nov 13, 2007 6:42 pm
by Roger Rines
Here is something to give you hope.

Posted: Wed Nov 14, 2007 12:12 pm
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.

Posted: Wed Nov 14, 2007 12:45 pm
by gm
Thanks, Roger. I'll see what I can do.

Posted: Wed Nov 14, 2007 1:34 pm
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.