Strategy Tester showing different figures then the currency figures

 

Dear Forum Members

I have issue with Strategy Tester, which I noticed recently while running the tester. It shows Balance 5200 Pips Profit 0 Equity 5200. Now even my Max SL (USD 50) calculated using Optimum Lot size is also showing very high figure of (USD -401). I have checked my code and it still it is calculating the figures correctly as below:

2022.06.11 18:49:42.702 2022.03.01 01:05:00   CStrategyBase::GetFiboLevelByRatio: Price1[33915.4] Price2[33850.4] Ratio[1.600] Result[33954.4]
2022.06.11 18:49:42.702 2022.03.01 01:05:00   CMoneyManagement::GetOptimumLot: capitalToRisk[50.0] pRiskPerTrade[0.010] slPoints[482] optimumLot[1.0]
2022.06.11 18:49:42.702 2022.03.01 01:05:00   market buy 1 US30 sl: 33846.1 tp: 33954.4 (33889.5 / 33894.3 / 33889.5)
2022.06.11 18:49:42.702 2022.03.01 01:05:00   deal performed [#2 buy 1 US30 at 33894.3]
2022.06.11 18:49:42.702 2022.03.01 01:05:00   order performed buy 1 at 33894.3 [#2 buy 1 US30 at 33894.3]
2022.06.11 18:49:42.705 2022.03.01 01:05:00   CTradeMy::OrderSend: TradeExecutionMarket BUY 1.00 US30 sl: 33846.1 tp: 33954.4 [done at 33894.3]
2022.06.11 18:53:32.847 2022.03.01 01:53:40   take profit triggered #2 buy 1 US30 33894.3 sl: 33869.7 tp: 33954.4 [#3 sell 1 US30 at 33954.4]
2022.06.11 18:53:32.847 2022.03.01 01:53:40   deal #3 sell 1 US30 at 33954.4 done (based on order #3)
2022.06.11 18:53:32.847 2022.03.01 01:53:40   deal performed [#3 sell 1 US30 at 33954.4]
2022.06.11 18:53:32.847 2022.03.01 01:53:40   order performed sell 1 at 33954.4 [#3 sell 1 US30 at 33954.4]
2022.06.11 18:53:46.340 2022.03.01 03:15:00   CMoneyManagement::GetOptimumLot: capitalToRisk[56.0] pRiskPerTrade[0.010] slPoints[558] optimumLot[1.0]

where as as per screen shot attached it is showing as -401.00 as shown in the attached screen shot of Strategy Tester as well as ST Options Settings.

Please help me, if I need to tweak some settings, as these figures are really confusing about how much money strategy is making or loosing.

If I look at Equity it started with 5000 + profit on 1st Trade 601 - loss on 2nd Trade -401 Balance 5200. This makes me believe it is showing in USD, the deposit currency.

2022.06.11 18:53:46.340 2022.03.01 03:15:00   market buy 1 US30 sl: 33874.0 tp: 34052.7 (33925.0 / 33929.8 / 33925.0)
2022.06.11 18:53:46.340 2022.03.01 03:15:00   deal #4 buy 1 US30 at 33929.8 done (based on order #4)
2022.06.11 18:53:46.340 2022.03.01 03:15:00   order performed buy 1 at 33929.8 [#4 buy 1 US30 at 33929.8]
2022.06.11 18:53:46.342 2022.03.01 03:15:00   CTradeMy::OrderSend: TradeExecutionMarket BUY 1.00 US30 sl: 33874.0 tp: 34052.7 [done at 33929.8] Diff 55.8 Pips or 558 points
2022.06.11 18:53:53.081 2022.03.01 03:55:00   CTradeMy::OrderSend: Modify Position US30 (sl: 33889.7, tp: 34052.7) [done]
2022.06.11 18:53:53.081 2022.03.01 03:55:00   [US30] #999111 SL Modified from posSL[33883.2] to iSAR[33889.7]
2022.06.11 18:53:53.605 2022.03.01 03:58:20   stop loss triggered #4 buy 1 US30 33929.8 sl: 33889.7 tp: 34052.7 [#5 sell 1 US30 at 33889.7]

Thanks in advance for the support.

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
What are the differences between the three modes of testing in MetaTrader 5, and what should be particularly looked for? How does the testing of an EA, trading simultaneously on multiple instruments, take place? When and how are the indicator values calculated during testing, and how are the events handled? How to synchronize the bars from different instruments during testing in an "open prices only" mode? This article aims to provide answers to these and many other questions.
Files:
 

Check this checkbox:

 

Time    Deal    Symbol  Type    Direction       Volume  Price   Order   Commission      Swap    Profit  Balance Comment 
2022.03.01 00:00:00     1               balance                                 0.00    0.00    5 000.00        5 000.00                
2022.03.01 10:33:00     2       US30    sell    in      1.8     33 979.1        2       0.00    0.00    0.00    5 000.00        #333111 S061 DTS_ZB A11 
2022.03.01 10:35:20     3       US30    buy     out     1.8     34 007.3        3       0.00    0.00    - 50.76 4 949.24        sl 34007.3      
2022.03.01 10:36:00     4       US30    sell    in      1.9     33 987.1        4       0.00    0.00    0.00    4 949.24        #333111 S01 DTS_ZB A11  
2022.03.01 12:08:40     5       US30    buy     out     1.9     33 667.9        5       0.00    0.00     606.48 5 555.72        tp 33667.9      
2022.03.01 17:00:00     6       US30    sell    in      0.6     33 660.2        6       0.00    0.00    0.00    5 555.72        #333111 S061 DTS_ZB A11 
2022.03.01 17:00:40     7       US30    buy     out     0.6     33 755.3        7       0.00    0.00    - 57.06 5 498.66        sl 33755.3      
2022.03.01 17:01:00     8       US30    sell    in      1.3     33 713.2        8       0.00    0.00    0.00    5 498.66        #333111 S061 DTS_ZB A11 
2022.03.01 18:47:40     9       US30    buy     out     1.3     33 230.1        9       0.00    0.00     628.03 6 126.69        tp 33230.1      
2022.03.02 10:11:00     10      US30    buy     in      1.7     33 285.2        10      0.00    0.00    0.00    6 126.69        #333111 L0311 DBL_ZS B1 
2022.03.02 11:00:40     11      US30    sell    out     1.7     33 249.3        11      0.00    0.00    - 61.03 6 065.66        sl 33249.3      
2022.03.02 11:15:00     12      US30    buy     in      0.5     33 364.2        12      0.00    0.00    0.00    6 065.66        #333111 L023 DTS_ZR A2  
2022.03.02 12:45:00     13      US30    sell    out     0.5     33 527.1        13      0.00    0.00     81.45  6 147.11        CLOSE#12 BuildUpAroundPivot     
2022.03.02 16:00:00     14      US30    buy     in      1.2     33 450.7        14      0.00    0.00    0.00    6 147.11        #333111 L021 DBL_ZS A212        
2022.03.02 17:04:40     15      US30    sell    out     1.2     33 679.1        15      0.00    0.00     274.08 6 421.19        tp 33679.1      
2022.03.02 17:45:00     16      US30    buy     in      0.8     33 712.5        16      0.00    0.00    0.00    6 421.19        #333111 L061 DBL_ZB B1  
2022.03.02 17:54:40     17      US30    sell    out     0.8     33 636.4        17      0.00    0.00    - 60.88 6 360.31        sl 33636.4      
2022.03.02 18:14:00     18      US30    buy     in      0.4     33 864.5        18      0.00    0.00    0.00    6 360.31        #333111 L061 DBL_ZB B1  
2022.03.02 21:27:40     19      US30    sell    out     0.4     33 899.9        19      0.00    0.00     14.16  6 374.47        sl 33899.9      
2022.03.03 17:00:00     20      US30    sell    in      2       34 077.5        20      0.00    0.00    0.00    6 374.47        #333111 S061 DTS_ZB A12 
2022.03.03 18:30:00     21      US30    buy     out     2       33 765.1        21      0.00    0.00     624.80 6 999.27        CLOSE#20 M15 BearLW TagPivot    
                                                                0.00    0.00    1 999.27        6 999.27                

Thanks Vladimir for your reply.

I have changed per your suggestion, still the same figures. And I realized that it is actually USD Values for Profit and Loss on each trade. I am unable to figure out why my Stop Loss is going beyond set limits, yet the calculations are correct.

Earlier while I was running another strategy it was showing correctly at 1% or USD 50 as loss. See above table from an Excel Sheet taken from Backtest Report.

regards.


Vladimir Karputov #:

Check this checkbox: