Quote from elindydotcom:
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
Okay you are in the ball park now.
I have not posted the revised code - I will if I ever figure out the MACD mistake.
-eLindy
Okay you are in the ball park now. You will see in the journal that I just want to establish a trend as being there. This means the market is no longer flat. I am using, on the 5 min, a range of MACD (5, 13 ,6) between +.4 and -.4 as the flat zone on the histogram.
This is a fine point but I was capturing the magnitude of the initial divergence of the MACD as an indication that a trend is under way. The histogram is just a measure of divergence at all times. As a trend romps along the divergence gets smaller and often varies between plus and minus as the A/D changes during the parts of a trend.
If you look at what you are doing it is this. you ignored the "momentarily" which is my obtuse, to some, word for not continually. Since you have made the MACD a continuing requirement along with the Stoc stuff there won't be many trades.
So just put it in, momentarily, before or after the one or both lines (14, 1, 3) come into the picture. Once you have entry at the time of the arrival of the second line, then kill the need for the MACD because we have met the momentariness which defines "not flat".
I am speculating, since you didn't say, that there were some profits on the ten trades you logged. I bet greenspan helped out on a few of them... be interesting to see the news on those ten trends.
you might want to work ahead a little and pick up the Wash trade sequence on back testing so we can see the extent of really doing it often and well when a trend goes no where and we need to exit before losses begin.
Once we put stop logs on the table and begin to use them, then we will be watching for the point when no new stops are required. this is going to be our signal to go to the other side of the channel to start to max our exits as far away from stops as possible.
These two things will help show how the back testing changes as you emerge from being a beginner.
I hope you hang in here with this. It is not often that either maths people or software programmers can get into making money.