1

The simple question is: Why doesn't MACD Sample work?

I wanted to use MACD sample EA (I mean the one which is provided by default in MetaTrader) to see if a MACD parameter works or not. I put my desired parameter in this part, instead of 12,26,9:

MacdCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
MacdPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);
SignalCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);
SignalPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);

But I encounter a problem. When I started to backtest using 'Strategy Center', I found out the trade orders don't execute where I expect. Actually, I expect them to be executed in 'crossovers' between Signal line and MACD line. But it's not happening. I have tried to use 0MQ for sending trade orders from Python to MetaTrader, and I am desperate if I have to learn MQL for writing an expert advisor. I believe there is a quick solution to this problem. Thank you for your attention, and thanks in advance a lot, for your kind answers.

  • If you don't provide the full code, then at least provide links to it. It's impossible to answer this question otherwise. That said, the defualt MACD indicator in MT4 sucks, since it doesn't show the MAIN line, only SIGNAL. There are plenty of add-on indicators you can download or compile yourself. – not2qubit Jun 04 '18 at 07:27
  • 1
    Thanks man. I have completely gotten raid of mql and I linked the MT4 to a python developed strategy. – Mohammad Mortaji Jul 11 '18 at 20:23

0 Answers0