my first personal ea open a lot of position
i'm not expert and i write my 1 ea , but when it run it open a lot of position and no only one
the logic are that :
cheak for open condition or true => i use a while ( if cheak are ok open) , but it open a lot of position a no only one
i use the total = order total() if is < 2 open and it open if condition buy are ok 2 position
This might help: Orders, Positions and Deals in MetaTrader 5
try this way
try this way
This is the mql5 forum . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
i'm not expert and i write my 1 ea , but when it run it open a lot of position and no only one
the logic are that :
cheak for open condition or true => i use a while ( if cheak are ok open) , but it open a lot of position a no only one
i use the total = order total() if is < 2 open and it open if condition buy are ok 2 position
i use that solution but not work : while(A) ( if (cheak are true and condition A are true => open position, put A = false and put B = true t= time current
B are from other while (b) where: ( T = count second (t) and if T are> es 360 => put B= false (to interrup the cicle and put a true to have the possibility to open a new position )
what i can do for that ?