new market orders [SL and TP]

 

so now, instead of including SL and TP in the ordersend() function, our EAs must first send out an ordersend() with SL and TP being 0, and after the orders are opened, the orders must be modified with Ordermodify() where the SL and TP can now be inserted.


- Here is the issue, the EA's i have open orders and then try to modify the orders and insert SL and TP.
- There are times when i get an error 130, where the STOPS are not valid, and the orders are wide open with no SL or TP.

Is there anyway to check if the SL or TP are valid prior to opening orders?

 

MarketInfo(Symbol(),MODE_STOPLEVEL);

if (sl>Bid-MarketInfo(Symbol(),MODE_STOPLEVEL)*Point)             // check stop is allowed, if not, set to min allowable
   {
   sl=Bid-MarketInfo(Symbol(),MODE_STOPLEVEL)*Point;
   } 

V

 
Viffer:

MarketInfo(Symbol(),MODE_STOPLEVEL);

V



thanks, i knew it was possible with STOPLEVEL.



Thanks Viffer!!!!!!!!!