[Build 135] Walk Forward Optimzation is failing when reading a null periods.get(0).runStatData



The Walk Forward Optimzation is failing when reading a null periods.get(0).runStatData.


maxDD = periods.isEmpty() ? 0 : periods.get(0).runStatData.getDouble(StatsKey.DRAWDOWN);



The Code Fix is to check if the runStatData is not null before reading the value. I've done the fixes but SQX is overwriting the code to the original version.


double maxDD = 0;

if (periods.get(0).runStatData != null)
maxDD = periods.isEmpty() ? 0 : periods.get(0).runStatData.getDouble(StatsKey.DRAWDOWN);




I've attached the fixes for all Walk Forward data columns. Could you please apply this to 


Log


10:05:47.364 [Thread-7515] INFO  c.s.t.project.ProgressEngine - Pre-Validation : Strategy 4.3.193 Error Cannot invoke "com.strategyquant.tradinglib.SQStats.getDouble(String)" because "java.util.ArrayList.get(int).runStatData" is null
10:05:47.365 [Thread-7515] ERROR OptimizeTask - Optimization error in strategy Strategy 4.3.193
java.lang.NullPointerException: Cannot invoke "com.strategyquant.tradinglib.SQStats.getDouble(String)" because "java.util.ArrayList.get(int).runStatData" is null
at SQ.Columns.WalkForward.WFMaxDDbyRun.compute(WFMaxDDbyRun.java:19) ~[na:na]
at com.strategyquant.tradinglib.WalkForwardColumn.compute(Unknown Source) ~[SQTradingLib.jar:na]
at com.strategyquant.tradinglib.WalkForwardResult.computeStats(Unknown Source) ~[SQTradingLib.jar:na]
at com.strategyquant.tradinglib.WalkForwardResult.computeRobustnessScore(Unknown Source) ~[SQTradingLib.jar:na]
at com.strategyquant.tradinglib.optimization.WalkForwardMatrixResult.computeRobustnessResults(Unknown Source) ~[SQTradingLib.jar:na]
at com.strategyquant.tradinglib.optimization.OptimizationEngineWF.optimizeWF(Unknown Source) ~[SQTradingLib.jar:na]
at com.strategyquant.tradinglib.optimization.OptimizationEngine.optimize(Unknown Source) ~[SQTradingLib.jar:na]
at com.strategyquant.plugin.Task.impl.Optimize.OptimizeTask.runStandardOptimization(Unknown Source) ~[na:na]
at com.strategyquant.plugin.Task.impl.Optimize.OptimizeTask.optimizeStrategy(Unknown Source) ~[na:na]
at com.strategyquant.plugin.Task.impl.Optimize.OptimizeTask.start(Unknown Source) ~[na:na]
at com.strategyquant.tradinglib.project.SQProject$1.run(Unknown Source) ~[SQTradingLib.jar:na]

Attachments
WFScore.java
(563 B)
WFMaxProfitByRunInPct.java
(1.34 KiB)
WFMaxPctDDbyRun.java
(1.00 KiB)
WFMaxDDbyRun.java
(987 B)
WFMaxStagnationInPct.java
(1.05 KiB)
WFPctOfProfitableRuns.java
(1014 B)
WFMaxProfitByRun.java
(1.01 KiB)
WFMinTradesInRun.java
(1.01 KiB)
  • Votes +4
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

Cc
#1

Cyber

21.06.2022 02:52

Task created

Cc
#2

Cyber

21.06.2022 06:53
Voted for this task.
Bt
#3

beetrader

21.06.2022 17:06
Voted for this task.
Cc
#4

Cyber

22.06.2022 01:09
The big issue is I’m not even using that WF metric so why SQX is raising an error. I'm using my custom WF metrics. It does not make sense. 


Also, given the slow turnaround of fixing the defects, can you remove the logic of overwriting any code fixes on the SQX Code snippets?

E
#5

Emmanuel

22.06.2022 15:10
Voted for this task.
4
#6

Jordan

02.07.2022 15:39
Voted for this task.
Cc
#7

Cyber

04.07.2022 23:20
I believe that this issue occurs if there are no OOS trades. I suggest the SQX team to investigate why there is no OOS trade. If there is no OOS trade, SQX should be able to handle any error/exception.
TT
#8

Tamas

30.08.2022 15:35

Status changed from New to Fixed

Attachment image-0.png added

image-0.png
(268.33 KiB)
This was already fixed in build SQX 135.


Please download the latest stable version of SQX from our site here  https://strategyquant.com/download/


Votes: +4

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please