MACD Sample Expert Advisor in MetaTrader4 doesn't work

927 Views Asked by At

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.

0

There are 0 best solutions below