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

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
Tresor
Posts: 1104
Joined: 29 Mar 2008
Has thanked: 12 times
Been thanked: 51 times

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

Postby Tresor » 02 May 2008

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
Attachments
Thermostat Program.doc
(37 KiB) Downloaded 253 times
Choppy Market Index.doc
(27 KiB) Downloaded 242 times

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 02 May 2008

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.
Attachments
Thermostat.zip
(2.84 KiB) Downloaded 232 times

Tresor
Posts: 1104
Joined: 29 Mar 2008
Has thanked: 12 times
Been thanked: 51 times

Postby Tresor » 03 May 2008

Steven,

Thank you very very much :D

Tresor
Posts: 1104
Joined: 29 Mar 2008
Has thanked: 12 times
Been thanked: 51 times

Postby Tresor » 03 May 2008

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
Attachments
MaxBarsBack.jpg
MaxBarsBack.jpg (109.84 KiB) Viewed 494 times

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 03 May 2008

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.

Tresor
Posts: 1104
Joined: 29 Mar 2008
Has thanked: 12 times
Been thanked: 51 times

Postby Tresor » 03 May 2008

It works now. Thank you Steven very much.


Return to “User Contributed Studies and Indicator Library”