Questions from Beginners MQL5 MT5 MetaTrader 5 - page 871

 

When running in the tester, the current price = 4843. the owls put a seizure limit on the price of 10.

How is this possible, how can this be avoided?

mrak

 
lil_lil:

When running in the tester, the current price = 4843. the owls put a seizure limit on the price of 10.

How is this possible, how to avoid it?


Issue the correct price to set the pending order.

 
Vladimir Karputov:

Issue the correct price to set the pending order.

Once this selimit becomes a position, further limit order setting goes smoothly.

               ExtStep=10*m_adjusted_point;
               m_trade.SellLimit(checkVolumeValue(loot),m_symbol.Bid()+ExtStep);
What is the wrong price?
 
lil_lil:

Once this selimit becomes a position, further limit order setting goes smoothly.

What is the wrong price?

m_symbol.Bid() - this explicitly contains either rubbish or old price.

We should refresh the price first:

   if(!RefreshRates())
      return;

and then we should issue a trade order to place a pending order.

 
Vladimir Karputov:

m_symbol.Bid() - this clearly contains either rubbish or the old price.

The price should be updated first:

and then issue a trade order to place a pending order.

There is

 if(!RefreshRates())
            return;

before sending an order

 
lil_lil:

There is

before sending the order

Before sending the order, print out the price you are sending.

 
Vladimir Karputov:

Print the price you are transmitting before sending the order.

m_symbol.Bid()4828.0


 
lil_lil:

m_symbol.Bid()4828.0


OK, on the other hand: check the logs in the Log tab - you should definitely see there that you have sent a Sell limit order at price 10.

 
Vladimir Karputov:

Ok, let's look at the other side: check the logs in the "Log" tab to see that you have sent a Sell limit order at price 10.

CTrade::OrderSend: modify #3 at 10.00000 (sl: 0.00000 tp: 0.00000) [done]

ok, this modifies at that price, will look for it.
 
lil_lil:

CTrade::OrderSend: modify #3 at 10.00000 (sl: 0.00000 tp: 0.00000) [done]


Check in terminal ticks for date in 00-00

Reason: