I deleted a discussion of the inconsistency of some backtesting here. What the comments came down to were that you need to use two fractals, etc. to get things to click. Also the exits and entries were when you saw them instead of locking into HLOC data. T
This is a response to an alternative back testing software:
You could do that - but you'll do a lot better simply sitting there keeping track of the trades on paper for a few days.
1) You'll reinforce the rules and method.
2) You'll begin to understand what you don't understand
3) Most importantly, you'll begin to believe.
When I first started reading Jack's work, I was convinced that he was a befuddled old man (no slight intended, that's what I am). The next step was to assume that he had something to say, but wasn't very good at saying it. Now I am at a level that truly has me alarmed - I am beginning to understand what he is communicating. Jack sees things a little differently than you or I do. That's what makes it worth the effort to figure out what he has to say. Back testing won't really do that for you.
Re: EasyLanguage/TS6 Code For Backtesting...
Below within the quote I made some suggestions to help you get a starting point that is correct.
Basically your MACD is wrong and so are the exits. Both of these things will tend to change the results. The exit will cause a lesser result as vvvvvv says and the MACD being correct should make it better.
look for the ***'s
I've been following this thread and today, as an exercise, I decided to try to implement this strategy in EasyLanguage. Unfortunately, it's massively unprofitable when run on 5 min bars over the last two years (the most intraday data that I've got with Tradestation 6). Without commissions and slippage, the numbers are closer to breakeven. I assume I'm missing something but I can't figure out what it is. Is there a directional component on the MACD that needs to be taken into consideration? Is the MACDLimit too low? Maybe I'll mess around with it some more later this week.
I've attached the code in a MS Word document since I cannot upload fiiles with a .ELD extension. Because of this, you will have to copy and paste into blank strategies in TS6 to get these to work. There are two strategies - the first is the basic strategy without the MACD filter. The second is with the MACD filter.
The default input parameters are as suggested in this thread: (14,1,3) for stochastics with 25/75 as oversold and overbought levels; (5,13,6) for MACD with +/- .04 as the filter level for entry.
*** the value is .4 for the histogram for either long or short.
The rules as implemeted (and as I understand them after reading this thread) are as follows:
The Basic Strategy ("Fast Trend") is:
- Enter long when both the fast and slow line crosses above the overbought level
- Exit longs when both the fast and slow lines crosses below the overbought level
*** when first line to leave happens, you leave right then. the first line to leave is usually the fast line. So replace the above line.
- Enter short when both the fast and slow line crosses below the oversold level
- Exit short when both the fast and slow lines crosses above the oversold level
**** when first line to leave happens, you leave right then. the first line to leave is usually the fast line. so replace the above line.
The Filters that are applied are:
- Do not enter long unless the MACD is above the MACDLimit
- Do not enter short unless the MACD is below the MACDLimit*-1
Your limits are off by a factor of ten (too small).
None of the early entry techniques discussed were implemented. None of the variations (such as slow trend or the reversals) were implemented either.
Hopefully someone will find this useful or, if I'm lucky, be able to tell me what I'm doing wrong.
You are in luck these are just details that are easily screwed up. As you get into how markets work and trading it will come more natural to you. After the beginner part is over and you can do wash trades it get fairly interesting.
It would be unfair to add wash trades for you because it defeats finding out how profitable something is and what a win loss ratio is like if a person is not trying to make money.
It is okay to use some of the intermediate stuff and not the others.
Re: Re: EasyLanguage/TS6 Code For Backtesting...
I've modifed the code as suggested - the biggest difference was with the modified MACD limit. Going to 0.4 from 0.04 reduced the number of trades to less than 10 over a two year period. That tells me I've misunderstood how the MACD is used to filter the signals.
The MACD filter, as I understand it, is as follows:
- Do not enter long unless the MACD is above 0.4
- Do not enter short unless the MACD is below -0.4
I have not posted the revised code - I will if I ever figure out the MACD mistake.
This is a response to an alternative back testing software:
You could do that - but you'll do a lot better simply sitting there keeping track of the trades on paper for a few days.
1) You'll reinforce the rules and method.
2) You'll begin to understand what you don't understand
3) Most importantly, you'll begin to believe.
When I first started reading Jack's work, I was convinced that he was a befuddled old man (no slight intended, that's what I am). The next step was to assume that he had something to say, but wasn't very good at saying it. Now I am at a level that truly has me alarmed - I am beginning to understand what he is communicating. Jack sees things a little differently than you or I do. That's what makes it worth the effort to figure out what he has to say. Back testing won't really do that for you.
Re: EasyLanguage/TS6 Code For Backtesting...
Below within the quote I made some suggestions to help you get a starting point that is correct.
Basically your MACD is wrong and so are the exits. Both of these things will tend to change the results. The exit will cause a lesser result as vvvvvv says and the MACD being correct should make it better.
look for the ***'s
I've been following this thread and today, as an exercise, I decided to try to implement this strategy in EasyLanguage. Unfortunately, it's massively unprofitable when run on 5 min bars over the last two years (the most intraday data that I've got with Tradestation 6). Without commissions and slippage, the numbers are closer to breakeven. I assume I'm missing something but I can't figure out what it is. Is there a directional component on the MACD that needs to be taken into consideration? Is the MACDLimit too low? Maybe I'll mess around with it some more later this week.
I've attached the code in a MS Word document since I cannot upload fiiles with a .ELD extension. Because of this, you will have to copy and paste into blank strategies in TS6 to get these to work. There are two strategies - the first is the basic strategy without the MACD filter. The second is with the MACD filter.
The default input parameters are as suggested in this thread: (14,1,3) for stochastics with 25/75 as oversold and overbought levels; (5,13,6) for MACD with +/- .04 as the filter level for entry.
*** the value is .4 for the histogram for either long or short.
The rules as implemeted (and as I understand them after reading this thread) are as follows:
The Basic Strategy ("Fast Trend") is:
- Enter long when both the fast and slow line crosses above the overbought level
- Exit longs when both the fast and slow lines crosses below the overbought level
*** when first line to leave happens, you leave right then. the first line to leave is usually the fast line. So replace the above line.
- Enter short when both the fast and slow line crosses below the oversold level
- Exit short when both the fast and slow lines crosses above the oversold level
**** when first line to leave happens, you leave right then. the first line to leave is usually the fast line. so replace the above line.
The Filters that are applied are:
- Do not enter long unless the MACD is above the MACDLimit
- Do not enter short unless the MACD is below the MACDLimit*-1
Your limits are off by a factor of ten (too small).
None of the early entry techniques discussed were implemented. None of the variations (such as slow trend or the reversals) were implemented either.
Hopefully someone will find this useful or, if I'm lucky, be able to tell me what I'm doing wrong.
You are in luck these are just details that are easily screwed up. As you get into how markets work and trading it will come more natural to you. After the beginner part is over and you can do wash trades it get fairly interesting.
It would be unfair to add wash trades for you because it defeats finding out how profitable something is and what a win loss ratio is like if a person is not trying to make money.
It is okay to use some of the intermediate stuff and not the others.
Re: Re: EasyLanguage/TS6 Code For Backtesting...
I've modifed the code as suggested - the biggest difference was with the modified MACD limit. Going to 0.4 from 0.04 reduced the number of trades to less than 10 over a two year period. That tells me I've misunderstood how the MACD is used to filter the signals.
The MACD filter, as I understand it, is as follows:
- Do not enter long unless the MACD is above 0.4
- Do not enter short unless the MACD is below -0.4
I have not posted the revised code - I will if I ever figure out the MACD mistake.