Page 1 of 1

Thermostat Program (a little help needed in the re-coding)

Posted: 02 May 2008
by Tresor
Hello Guys,

Yesterday I encountered a trading strategy that uses different approach when the market is in chop and yet different approach when the market is in trend (using ChoppyMarketIndex function.

The strategy was written for TS and is said to be profitable. I rewritten the code but since I am a layman in coding I could not overcome the differences between TS and MC.

Could somebody please clean the code of this trading system? Attached is the system and the ChoppyMarketIndex (both in word)


Will appreciate any help :D

Regards

Posted: 02 May 2008
by brodnicki steven
There were several errors , so I had to use my best guess. It does compile and includes the choppynessindex function. Be sure to test it against a known good version if possible.

Posted: 03 May 2008
by Tresor
Steven,

Thank you very very much :D

Posted: 03 May 2008
by Tresor
Hi Steven again,

I tried to optimize this strategy and whenever I do it the information ''Tried to reference back more bars (#) than allowed by the current MaxBarsBack settings. Please increase MaxBarsBack setting''.

And every time this happens I increase the ''maximum number of bars study will reference'' in Format settings - Properties. And everytime I do increase the study seems to need one more bar to test.

What would the possible solution be?

Regards

Posted: 03 May 2008
by brodnicki steven
Make sure the maxbarsback setting is greater then any of the lengths that your optimizing on, for example if Boll length is 100, maxbarsback has to be greater than 100. I used 200 for max bars back and it worked fine.

Posted: 03 May 2008
by Tresor
It works now. Thank you Steven very much.