Discussion of article "The checks a trading robot must pass before publication in the Market" - page 27

 
Aleh Sasonka #:

This check is not enough when using pending orders!

There is no guarantee to pass the check:

test on EURUSD,H1 2023.04.28 17:00:38 Tester: not enough money to buy 0.60 EURUSD at 1.10395 sl: 0.00000 tp: 0.00000 [2023.04.28 17:00] 2023.04.28 17:00:38 Tester: PrevBalance: 10272.11, PrevPL: -4308.04, PrevEquity 5964.07, PrevMargin: 6271.62, NewMargin: 6293, FreeMargin: -328.50 2023.04.28 17:00:38 Tester: pending order is deleted [no enough money] strategy tester report 360 total trades

We will have to check the margin on every tick.... And what do we achieve by this? Additional load on the server?

Well, before setting all orders, do an OrderCheck for real buy/sell on the volume of all orders, as if the orders were immediately executed. Let's write off the error due to price changes for the potential time before triggering, because in any case we need to leave some reserve in the margin.