I've so far had total failure getting a strategy to even function - never mind make a profit - using MACD. I think I must be doing something wrong.
The MACD indicator has three outputs: the two lines and the difference graph. I was wanting to reference the difference in a strategy, but I couldn't seem to get it to make any trades when there was an 'IF ALL' condition that included comparing the MACD diff to a threshold value as a parameter, even when I set it to 0. When I set it 'IF ANY', when I looked at the graph of transactions after optimising, the only transactions were from the other criteria, not MACD.
I THINK I'm doing it correctly. In the strategy builder, when I've selected MACD, I have three user parameters for the fast, slow and smooth parameters, which are set to the same values as on a graph I'm displaying outside the strategy. Under 'plots', I've selected 'diff', as that's the value I want to compare to my threshold value as I couldn't see any other way of selecting that particular output, which is set to zero in the strategy analyser. But even though the MACD difference clearly oscillates around zero in the graph I'm displaying on a separate screen, even when the conditions and actions screen is set to 'if any', it never chooses to do any transactions based on MACD. So I'm wondering if I'm specifying the MACD correctly in the strategy.
In the strategy builder, the line that defines the MACD strategy comes out like this:
CrossAbove(MACD(Close, Convert.ToInt32(MACDfast), Convert.ToInt32(MACDslow), Convert.ToInt32(MACDsignal)).Diff, MACDthreshold, 0)
I don't know why there is 'convert.toint32(MACDfast)' as those parameters are all defined as integers anyway, whereas the MACDthreshold is defined as a Double.
Any light shed would be gratefully received.
Comment