AhmedMorra:
sorry, i am new to mql4 and programming , what do you mean by populating it? and the other part should i make it more? like 30 and only calculate 21 ema ? |
|
whroeder1:
|
I made the changes you said but still no order taken i increased the array size to double the amount of moving average and still no trades taken
double vol[42]; ArraySetAsSeries(vol, true ); for( int i=0;i<42;i++){ vol[i]=iVolume(NULL,0,i); } double _iVolc = iMAOnArray(vol,42,21,0,MODE_EMA,1); double _iVolp = iMAOnArray(vol,42,21,0,MODE_EMA,2); double volc = iVolume(NULL,0,1); double volp = iVolume(NULL,0,2);
There are no mind readers here
if(volc > volp && volc > _iVolc && volp > _iVolp &&......){ OrderSend(NULL,OP_BUY,.....);
- Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
- Use the debugger or print out your variables, including _LastError and find out why.
whroeder1:
There are no mind readers here
There are no mind readers here
- Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
- Use the debugger or print out your variables, including _LastError and find out why.
I am Sorry, here is the whole code for the ea
datetime Time0 = 0; void OnTick() { //--- if (Time0 != Time[0]) { double vol[42]; ArraySetAsSeries(vol, true ); for( int i=0;i<42;i++){ vol[i]=iVolume(NULL,0,i); } double _iVolc = iMAOnArray(vol,42,21,0,MODE_EMA,1); double _iVolp = iMAOnArray(vol,42,21,0,MODE_EMA,2); double volc = iVolume(NULL,0,1); double volp = iVolume(NULL,0,2); if(volc > volp && volc > _iVolc && volp > _iVolp && Close[1] > Open[1]){ OrderSend(NULL,OP_BUY,.01,Ask,3,Low[1],Ask+(Ask-Low[1]),NULL); } if(volc > volp && volc > _iVolc && volp > _iVolp && Close[1] < Open[1]){ OrderSend(NULL,OP_SELL,.01,Bid,3,Low[1],Bid-(High[1]-Bid),NULL); } Time0 = Time[0]; } }

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
i am making an ea that send orders if the volume is above the 21 moving average of the volume
buy when i put my conditions for the order and test nothing happen , 0 trades taken
what is wrong with my code?