Questions from Beginners MQL5 MT5 MetaTrader 5 - page 569

 
edutak:
At what price do the stop orders open?
To buy at Asc, to sell at Bid
 
Aleksandr Prishenko:
To buy at Asc, to sell at Bid
 if(bs>=1)
     {
      if(Ask>=priceb+Step*_Point)
         if(MarketInfo(Symbol(),MODE_FREEZELEVEL)==0)
            if(OrderSend(Symbol(),OP_BUYSTOP,Lot,Ask,Slippage,0,0,"",Magic,0,Blue)>0)
               pricebs=Ask;
     }
   if(ss>=1)
     {
      if(Bid<=prices-Step*_Point)
         if(MarketInfo(Symbol(),MODE_FREEZELEVEL)==0)
            if(OrderSend(Symbol(),OP_SELLSTOP,Lot,Bid,Slippage,0,0,"",Magic,0,Red)>0)
               pricess=Bid;
     }
Do not open, you have to go the specified distance.
 
edutak:
They don't open, you have to go through the specified distance.
Do you want to set two stop orders next to the price? If I understand correctly. Don't, at least at the distance of the spread.
 
Aleksandr Prishenko:
Do you want to set two stop orders next to the price? If I understand correctly.
No, there are already Buy and Sell orders in the market, at some distance from them.
 
edutak:
They do not open, they need to open at a specified distance.
OP_BUYSTOP and OP_SELLSTOP orders are not opened by Ask and Bid, but by the set price.
 
Alexey Viktorov:
Orders OP_BUYSTOP and OP_SELLSTOP are not opened by Ask and Bid, but by the set price.
They are activated by these prices.
 
Artyom Trishkin:
Activated by these prices.
Artyom, well look carefully at the code...
 
Alexey Viktorov:
Artyom, look at the code carefully...
I'm using my mobile phone. It's not convenient.
 

Hello.

Please advise how to calculate the lot using MT4 tools for the following example.

A position with 0.1 lot was closed with a loss of -$15.

How much should I open a position with, if I reach 20 pips T/P = 20, the profit will be 20$ + 15$.

That is, how to calculate that the lot should be 0.175 and round up?

 
mila.com:

Hello.

Please advise how to calculate the lot using MT4 tools for the following example.

A position with 0.1 lot was closed with a loss of -$15.

How much should I open a position with, if I reach 20 pips T/P = 20, the profit will be 20$ + 15$.

That is, how to calculate that the lot should be 0.175 and round up?

There was such a question some time ago:

How to calculate, based on available funds and lot, how many points (in points) the price can pass in minus?

And there was already such an answer:

link formula: Lot=Money/(Stoplos*Tick)
Money - earned/lost
Stoplos - in broker points
Tick - MarketInfo(MODE_TICKVALUE), or SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE);
From here, spin as you like:
Stoplos=Money/(Lot*Tick)
Money=Lot*Stoplos*Tick