Download MetaTrader 5

set many ordersend as same time and only one time execute

To add comments, please log in or register
Mohammad Aghaali
1266
Mohammad Aghaali  

Hello

I try to have many ordersend at same time with same price but when use for or while loops it's not work properly ! and without loop when i use ordersend function on ontick set order with every thick with different price like photo


How can i do it ?

And other problem

How can i break EA after one time execute?(for example set 100 ordersend with same price at same time ''when i start EA' and after 100 order send break EA!)

I use break in my code but compiler say that should use break in loop !


Thanks

whroeder1
17063
whroeder1  
trader92:

I try to have many ordersend at same time with same price but when use for or while loops it's not work properly ! and without loop when i use ordersend function on ontick set order with every thick with different price like photo How can i do it ?

How can i break EA after one time execute?(

for example set 100 ordersend with same price at same time ''when i start EA' and after 100 order send break EA!)

    • "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
    • Can't be done, opening orders takes time and the market is always moving.
    • You must RefreshRates between server calls.
    • You can place pending orders but there is no guarantee that they will all open at the same price.
    • No need to open multiple orders, just open one an do partial closes.
  1. If the orders have been set, don't do it again.
  2. I hope you have a few million dollars in your account, because your margin will be completely used up after after opening about 10 minimum lot orders and the first negative tick will start closing the rest with margin calls..
    • You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
    • Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
    • Do NOT use TickValue by itself - DeltaPerLot
    • You must normalize lots properly and check against min and max.
    • You must also check FreeMargin to avoid stop out
To add comments, please log in or register