//--- check for long position (BUY) possibility if(ma25>ma100 && MACD_H1>0 && AC>0)
i think AC can never be > 0
Print("Error opening BUY order : ",GetLastError());
u have to ResetLastError() first & then check what err u get
qjol:
Why are you thinking that, AC being the difference between main and signal buffer it can be positive or negative, not ?
i think AC can never be > 0
...
angevoyageur:
Why are you thinking that, AC being the difference between main and signal buffer it can be positive or negative, not ?
Why are you thinking that, AC being the difference between main and signal buffer it can be positive or negative, not ?
u right my mistake, (i didn't notice it's a double, i thought it's n int)
deVries:
MACD_H1=iMA(NULL,60,FastPeriod2,0,MODE_EMA,PRICE_CLOSE,1)- iMA(NULL,60,SlowPeriod2,0,MODE_EMA,PRICE_CLOSE,1);I don't see you coded a MACD....
Perhaps you should look at the MACD code Moving Average Convergence/Divergence, MACD - MQL4 Code Base | for(int i=0; i<limit; i++) I see a MACD coded.MacdBuffer[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i); //---- signal line counted in the 2-nd buffer for(i=0; i<limit; i++) SignalBuffer[i]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i); |
WHRoeder:
Perhaps you should look at the MACD code Moving Average Convergence/Divergence, MACD - MQL4 Code Base | for(int i=0; i<limit; i++) I see a MACD coded.MacdBuffer[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i); //---- signal line counted in the 2-nd buffer for(i=0; i<limit; i++) SignalBuffer[i]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i); |
Allright i see now,thanks.
In tester it works
but on account it can fail if there are other trades not from this EA open
total=OrdersTotal(); if(total<1)
or if your broker is ECN then you're not allowed to open buy or sell with directly stoploss and/or takeprofit level
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"3Winners",MAGICMA,0,Green);
also slippage is not set to value of 5 digit account
did you check terminal to see
what this line
Print("Error opening BUY order : ",GetLastError());
was telling ??
deVries:
Is this true? I though it was something that was fixed in the MT4 terminal sometime last year?
or if your broker is ECN then you're not allowed to open buy or sell with directly stoploss and/or takeprofit level
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
MACD_H1 which is an MACD with a period=60 does'nt have any action in this EA .I need your help please
Here is my EA code :