MT5 EA does not open position

Anas Almari  

Hello 

I made an EA (MT5) by EABUILDER site, it's conditions are very simple 

But does not open any positions 

can anybody help ?!

The EA is attached

Thanks

Files:
A_1.mq5  11 kb
Seng Joo Thio  
Anas Almari:

Hello 

I made an EA (MT5) by EABUILDER site, it's conditions are very simple 

But does not open any positions 

can anybody help ?!

The EA is attached

Thanks

It does open, but only after popping up a messagbox ( )... so if you run it in strategy tester, that step is skipped completely and mb_ret will never return IDYES - a condition necessary to open a position.

mb_ret = MessageBox("Open Buy Order "+TradeSize+" lots? [A_1 @ "+Symbol()+","+Period()+"]", "Manual Order Confirmation", MB_YESNO);

For your testing purpose, you can consider adding these lines right after the above, so as to mimic user action:

         if (MQLInfoInteger(MQL_TESTER))
            mb_ret = IDYES;

Do the same for sell.

Alain Verleyen  
I am wondering why people use a tool from an other site and then come here when it doesn't work as expected. Why not ask support on this "other site" ?
Anas Almari  
Seng Joo Thio:

It does open, but only after popping up a messagbox ( )... so if you run it in strategy tester, that step is skipped completely and mb_ret will never return IDYES - a condition necessary to open a position.

For your testing purpose, you can consider adding these lines right after the above, so as to mimic user action:

Do the same for sell.

Thank you Seng 

I will try 

Anas Almari  
Alain Verleyen:
I am wondering why people use a tool from an other site and then come here when it doesn't work as expected. Why not ask support on this "other site" ?

They don't have support, and i am a poor in programming so this site is good for me

Alain Verleyen  
Anas Almari:

They don't have support, and i am a poor in programming so this site is good for me

Ah ok. Thanks. You have what you pay for I guess.
ricardo nilson  
Seng Joo Thio:

It does open, but only after popping up a messagbox ( )... so if you run it in strategy tester, that step is skipped completely and mb_ret will never return IDYES - a condition necessary to open a position.

For your testing purpose, you can consider adding these lines right after the above, so as to mimic user action:

Do the same for sell.

Hello, I wrote my EA, but it only works in demo account. Under real account it does not close any position.

Files:
Vladimir Karputov  
ricardo nilson :

Hello, I wrote my EA, but it only works in demo account. Under real account it does not close any position.

Time is presented as seconds (seconds elapsed since 1970).

Therefore, you need the following code:

long diff=TimeCurrent()-PositionOpenTime;
ricardo nilson  
Vladimir Karputov:

Time is presented as seconds (seconds elapsed since 1970).

Therefore, you need the following code:

Thank you. I will try, but my concern is why it works ok in a demo account but in a real

Reason: