Hi,
I created an EA for study perpous on the base of ADX, which take a long +DI > -DI and Short when -DI>+DI, but the EA which i created is not trading at all, need help from
the programers or some one who familiar with this.
i am posting my ea here
Thanks in advance
Suresh
India
Your EA is trading with immediate execution, but not with market execution. See documentation.
Did you check the necessary options to allow trading?
Hi,
I created an EA for study perpous on the base of ADX, which take a long +DI > -DI and Short when -DI>+DI, but the EA which i created is not trading at all, need help from
the programers or some one who familiar with this.
i am posting my ea here
Thanks in advance
Suresh
India
The error from Check invalid handle on OnInit()
You must replace yellow mark :
int OnInit() { //--- Do we have sufficient bars to work if(Bars(_Symbol,_Period)<60) // total number of bars is less than 60? { Alert("We have less than 60 bars on the chart, an Expert Advisor terminated!!"); return(-1); } //--- get handle of the Bollinger Bands and DEMA indicators iADXWilder_handle=iADXWilder(NULL,0,iADXWilder_Period); //--- Check for Invalid Handle if(CopyBuffer(iADXWilder_handle,0,0,3,Main) <0 || CopyBuffer(iADXWilder_handle,1,0,3,PlusDI)<0 || CopyBuffer(iADXWilder_handle,2,0,3,MinusDI)<0) { Alert("Error copying ADX indicator Buffers - error:",GetLastError(),"!!"); ResetLastError(); return(-1); } return(0); }
with this one :
int OnInit() { //--- Do we have sufficient bars to work if(Bars(_Symbol,_Period)<60) // total number of bars is less than 60? { Alert("We have less than 60 bars on the chart, an Expert Advisor terminated!!"); return(-1); } //--- get handle of the Bollinger Bands and DEMA indicators iADXWilder_handle=iADXWilder(NULL,0,iADXWilder_Period); //--- Check for Invalid Handle if(iADXWilder_handle<0) { Alert("Error copying ADX indicator Buffers - error:",GetLastError(),"!!"); ResetLastError(); return(-1); } return(0); }
So what should i do, there is nothing wrong with the order type when i looked at,
is there any problem with the buy and sell condition ?
Pleasae help.
- www.mql5.com
So what should i do, there is nothing wrong with the order type when i looked at,
is there any problem with the buy and sell condition ?
Pleasae help.
Do you understand what I mean?. Please look at the script at OnInit(), what you should to do is only REPLACE this line :
if(CopyBuffer(iADXWilder_handle,0,0,3,Main) <0 || CopyBuffer(iADXWilder_handle,1,0,3,PlusDI)<0 || CopyBuffer(iADXWilder_handle,2,0,3,MinusDI)<0)
with this one :
if(iADXWilder_handle<0)
So what should i do, there is nothing wrong with the order type when i looked at,
is there any problem with the buy and sell condition ?
Pleasae help.
- Do not send 3 times same comment.
- You can't simply copy and paste code, change indicator and hope that works. You have to understand what you do.
- What you should do is to begin to learn to code by reading documentation.
- Check journal and experts tabs to see error messages.
- Do the modification that achidayat show you.
- Verify that your broker allow "immediate execution" of order, if not, modify your code consequently.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I created an EA for study perpous on the base of ADX, which take a long +DI > -DI and Short when -DI>+DI, but the EA which i created is not trading at all, need help from
the programers or some one who familiar with this.
i am posting my ea here
Thanks in advance
Suresh
India