Please help me to solve my problem

 
HI,I wrote an Ea which work with volumeMA indicator signals but it didnt work properely i attached it, please Lead me where is the problem .Best Regards
Files:
 
1350 wrote >>
HI,I wrote an Ea which work with volumeMA indicator signals but it didnt work properely i attached it, please Lead me where is the problem .Best Regards

can't test yr EA without the volumeMA indicator as this indicator is non-standard in the metatrader platform

 
ronaldosim wrote >>

can't test yr EA without the volumeMA indicator as this indicator is non-standard in the metatrader platform

Dear Ronaldosim, hereby i attached volumeMA indicator

Files:
volumema.mq4  7 kb
 
1350 wrote >>
HI,I wrote an Ea which work with volumeMA indicator signals but it didnt work properely i attached it, please Lead me where is the problem .Best Regards

you need to declare a size for all your arrays.

After this, when your EA starts firing orders, u get ordersend error - yr TP are close to yr openprice - u trying to scalp? but one loss (Stoploss 120 pips) kills all the gains (2pips each time?)

 
ronaldosim wrote >>

you need to declare a size for all your arrays.

After this, when your EA starts firing orders, u get ordersend error - yr TP are close to yr openprice - u trying to scalp? but one loss (Stoploss 120 pips) kills all the gains (2pips each time?)

ordersend errors is not because of TP too close to Openprice but u use, for example, c1 as your TP which is the same value for buy orders and sell orders

 
ronaldosim wrote >>

ordersend errors is not because of TP too close to Openprice but u use, for example, c1 as your TP which is the same value for buy orders and sell orders

Dear Ronaldosim, i changed some codes but it not work properely yet i attached new version, please check it out

Files:
 
1350 wrote >>

Dear Ronaldosim, i changed some codes but it not work properely yet i attached new version, please check it out

I dont know what you changed but it is still not working.

this is what I did

ArrayResize(nearest_Array1,3);
ArrayResize(nearest_Array2,3);
ArrayResize(nearest_Array3,3);

 
1350 wrote >>

Dear Ronaldosim, i changed some codes but it not work properely yet i attached new version, please check it out

I think its better to explain this EA logic, This EA when time reach to 00 & 08 & 16 is looking backward to find close of the candle which have max volume MA in each last three zone(for example when time is 00,three last zone is 24 to 16 yesterday& 16 to 8 yesterday& 16 to 00 yesterday) & keep it in c1 to c5 then put an order with target to nearest one we can change the stoploss upon our next experiments, if it possible, please change my code to fulfill this purpose.Thanks

 
1350 wrote >>

I think its better to explain this EA logic, This EA when time reach to 00 & 08 & 16 is looking backward to find close of the candle which have max volume MA in each last three zone(for example when time is 00,three last zone is 24 to 16 yesterday& 16 to 8 yesterday& 16 to 00 yesterday) & keep it in c1 to c5 then put an order with target to nearest one we can change the stoploss upon our next experiments, if it possible, please change my code to fulfill this purpose.Thanks

I'm awaiting yet

 
1350 wrote >>

I think its better to explain this EA logic, This EA when time reach to 00 & 08 & 16 is looking backward to find close of the candle which have max volume MA in each last three zone(for example when time is 00,three last zone is24 to 16 yesterday& 16 to 8 yesterday& 16 to 00 yesterday) & keep it in c1 to c5 then put an order with target to nearest one we can change the stoploss upon our next experiments, if it possible, please change my code to fulfill this purpose.Thanks

Quite difficult to understand your strategy. Could u try to explain again? eg what is those highlighted in red? what is yesterday?

so there are 3 time zones 00 to 08 and 08 to 16 and 16 to 24?

 
ronaldosim:

Quite difficult to understand your strategy. Could u try to explain again? eg what is those highlighted in red? what is yesterday?

so there are 3 time zones 00 to 08 and 08 to 16 and 16 to 24?

Dear Ronaldosim,

Thanks for your prompt answers. when current time reaches to 00,08 & 16 in each day this expert should look backward to last 24 hours which devided to three 8 hours zone, then find the max volumeMA in each range & store the price of the candle which have max Volume MA in each range, then compare this three prices with current candles price & put an order with target to nearest price, if current candles open price was under nearest price it puts a buy order & vice versa.

Regards.

Reason: