EA stops out extremely early, can't find cause

Hello
When backtesting my EA, it stops out after two transactions, which should have netted a loss of $-561.48. I’m testing it with a balance of $10000, so there should be $9438.52 left, however the advisor reports only $90 left and so stops out. I cannot find the cause, the orders seem to be being placed correctly, just the balance is completely out of sync with the transactions.
Here is a log of the run:

GP  0  00:43:52.645  127.0.0.1           login (build 2835)
NN  0  00:43:52.651  Tester              account info found with currency USD
LI  0  00:43:52.656  Tester              expert file added: Experts\Advisors\CustomExpert.ex5. 114347 bytes loaded
HG  0  00:43:52.656  Tester              program file added: Indicators\Exit.ex5. 17384 bytes loaded
IE  0  00:43:52.656  Tester              program file added: Indicators\Entry.ex5. 25891 bytes loaded
FQ  0  00:43:53.370  Tester              initial deposit 10000.00 USD, leverage 1:1
LI  0  00:43:53.370  Tester              successfully initialized
QS  0  00:43:53.370  Network             252 Kb of total initialization data received
RK  0  00:43:53.370  Tester              AMD Ryzen 5 3600 6-Core, 36215 MB
HM  0  00:43:53.427  Symbols             BTCUSD: symbol to be synchronized
QI  0  00:43:53.428  Symbols             BTCUSD: symbol synchronized already, 18 bytes received
DD  0  00:43:53.428  History             BTCUSD: history synchronization started
QO  0  00:43:53.432  History             BTCUSD: load 27 bytes of history data to synchronize in 0:00:00.003
FE  0  00:43:53.432  History             BTCUSD: history synchronized from 2012.01.01 to 2021.03.21
DM  0  00:43:53.502  History             BTCUSD,Daily: history cache allocated for 2020 bars and contains 478 bars from 2014.01.01 00:00 to 2015.04.23 00:00
PI  0  00:43:53.502  History             BTCUSD,Daily: history begins from 2014.01.01 00:00
PL  0  00:43:53.502  Tester              BTCUSD,Daily (EvolveMarkets-MT5 Demo Server): every tick generating
OH  0  00:43:53.502  Tester              testing with execution random delay
FL  0  00:43:53.503  Tester              BTCUSD,Daily: testing of Experts\Advisors\CustomExpert.ex5 from 2015.04.24 00:00 to 2021.03.21 00:00 started with inputs:
DK  0  00:43:53.503  Tester              StopLoss=0.05
OD  0  00:43:53.503  Tester              TakeProfit=0.2
FJ  0  00:43:53.526  Tester              program file added: \Indicators\Entry.ex5. 25892 bytes loaded
GH  0  00:43:53.532  Tester              program file added: \Indicators\Exit.ex5. 17385 bytes loaded
MH  0  00:53:30.665  Trade               2015.05.09 00:00:04   market buy 40.08 BTCUSD sl: 235 tp: 296 (245 / 247 / 245)
GI  0  00:53:30.665  Trades              2015.05.09 00:00:04   deal #2 buy 40.08 BTCUSD at 247 done (based on order #2)
LR  0  00:53:30.665  Trade               2015.05.09 00:00:04   deal performed [#2 buy 40.08 BTCUSD at 247]
IO  0  00:53:30.665  Trade               2015.05.09 00:00:04   order performed buy 40.08 at 247 [#2 buy 40.08 BTCUSD at 247]
EF  0  00:53:30.666  Expert (BTCUSD,D1)  2015.05.09 00:00:04   CTrade::OrderSend: market buy 40.08 BTCUSD sl: 235 tp: 296 [done at 247]
QJ  0  00:53:30.795  Trade               2015.05.13 21:52:42   stop loss triggered #2 buy 40.08 BTCUSD 247 sl: 235 tp: 296 [#3 sell 40.08 BTCUSD at 235]
DS  0  00:53:30.795  Trades              2015.05.13 21:52:42   deal #3 sell 40.08 BTCUSD at 235 done (based on order #3)
HF  0  00:53:30.795  Trade               2015.05.13 21:52:42   deal performed [#3 sell 40.08 BTCUSD at 235]
ID  0  00:53:30.795  Trade               2015.05.13 21:52:42   order performed sell 40.08 at 235 [#3 sell 40.08 BTCUSD at 235]
GS  0  00:53:32.059  Trade               2015.05.23 00:00:34   market buy 13.42 BTCUSD sl: 231 tp: 292 (241 / 243 / 241)
GN  0  00:53:32.059  Trades              2015.05.23 00:00:34   deal #4 buy 13.42 BTCUSD at 243 done (based on order #4)
JS  0  00:53:32.059  Trade               2015.05.23 00:00:34   deal performed [#4 buy 13.42 BTCUSD at 243]
ID  0  00:53:32.059  Trade               2015.05.23 00:00:34   order performed buy 13.42 at 243 [#4 buy 13.42 BTCUSD at 243]
DJ  0  00:53:32.060  Expert (BTCUSD,D1)  2015.05.23 00:00:34   CTrade::OrderSend: market buy 13.42 BTCUSD sl: 231 tp: 292 [done at 243]
OI  3  00:53:32.141  Trade               2015.05.28 00:00:01   position stop out triggered at 2.86% [#4 buy 13.42 BTCUSD 243 sl: 231 tp: 292]
EJ  0  00:53:32.141  Trades              2015.05.28 00:00:01   deal #5 sell 13.42 BTCUSD at 237 done (based on order #5)
ND  0  00:53:32.141  Trade               2015.05.28 00:00:01   deal performed [#5 sell 13.42 BTCUSD at 237]
HS  0  00:53:32.141  Trade               2015.05.28 00:00:01   order performed sell 13.42 at 237 [#5 sell 13.42 BTCUSD at 237]
PS  0  00:53:32.141  Tester              final balance 90.88 USD
JF  3  00:53:32.151  Tester              stop out occurred on 1% of testing interval
KL  0  00:53:32.151  Tester              BTCUSD,Daily: 197528 ticks, 35 bars generated. Environment synchronized in 0:00:00.758. Test passed in 0:09:38.736 (including ticks preprocessing 0:00:57.286).
II  0  00:53:32.151  Tester              BTCUSD,Daily: total time from login to stop testing 0:09:39.494 (including 0:00:00.758 for history data synchronization)
QI  0  00:53:32.153  Tester              17170 Mb memory used including 0.47 Mb of history data, 16960 Mb of cached tick data (total memory for tick data 21759 Mb)
OK  0  00:53:32.153  Tester              log file "C:\Program Files\Evolve Markets MetaTrader 5\Tester\Agent-127.0.0.1-3000\logs\20210324.log" written
EG  0  00:53:32.153  test                Experts\Advisors\CustomExpert.ex5 on BTCUSD,Daily thread finished
QF  0  00:53:32.225  127.0.0.1           prepare for shutdown

Any help would be much appreciated