- ago
When one selects "Run a backtest with these parameter values" in the right-click menu, it seems to randomly pick alternative parameters rather then using the parameter row highlighted. I'm running Build 14.

0
774
Solved
12 Replies

Reply

Bookmark

Sort
- ago
#1
How can we reproduce this?
0
- ago
#2
I don't understand. Can't you just add a WriteToDebugLog in the code (see below) to see the parameters don't match with the row highlighted? Are you saying your strategies don't have this problem? This was done in single-symbol mode without a dataset, if that matters.

CODE:
      public VossPredictStrategy0()       {          AddParameter("Voss period", ParameterTypes.Int32, 22, 10, 28, 3);          AddParameter("Voss predict", ParameterTypes.Int32, 5, 2, 6, 1);          AddParameter("Rank Confidence", ParameterTypes.Double, 0.60, 0.4, 0.9, 0.1);          AddParameter("DX period", ParameterTypes.Int32, 13, 5, 17, 4);          WLTradingExtras = new WLTrading(this as UserStrategyBase);       }              public override void Initialize(BarHistory bars) {          int paramVossPeriod = Parameters[0].AsInt;          int paramVossPredict = Parameters[1].AsInt;          double paramCenterConfidence = Parameters[2].AsDouble;          int paramDxPeriod = Parameters[3].AsInt;          int vossPeriod = Math.Max(paramVossPeriod, paramVossPredict+12);          SetChartDrawingOptions(WLUtil.HideVolume());          WriteToDebugLog(string.Format("{0},{1},{2},{3}",paramVossPeriod, paramVossPredict, paramCenterConfidence, paramDxPeriod));

---
Well, that's interesting. The problem appears to be strategy dependent. I tried it on a sample strategy without any problems. But with the above strategy, it fails. Interesting.

Let me dig a little deeper to see what might be going on.
1
- ago
#3
You must be running a Shrinking window optimization, right? (Like Monte Carlo in WL6, it uses randomized parameter values.)
0
- ago
#4
Yes, I'm running a shrinking window. But I tried reproducing this with a canned strategy (using a shrinking window) and it worked okay. So the problem is with my strategy itself. But I'm not sure what my strategy would be doing to cause such a problem. Very strange.
1
- ago
#5
I'm able to repro it with Shrinking opt. and your code. The parameter values aren't assigned randomly but the minValue is taken for each param in my case.
0
Glitch8
 ( 10.10% )
- ago
#6
So far it's working correctly for me. I ran a Shrinking Window optimization on Neo Master, then sorted by Profit for best and worst result. Using the right-click menu "Run Backtest using these Parameter Values" yielded exactly the same result.

0
- ago
#7
Please take the sample code attached to the issue.
0
Glitch8
 ( 10.10% )
- ago
#9
I'm seeing the same things with the specified code, taking a look!
0
Glitch8
 ( 10.10% )
- ago
#10
I found the issue, fixing it for Build 15. As a workaround, you can change the StepValues from 3 & 4 to 1 and it should work.
0
Best Answer
- ago
#11
QUOTE:
I found the issue, fixing it for Build 15.

So was there a buffer overrun issue with parameter arguments and Shrinking Window? When you compile with the "Debug" switch, doesn't the generated run-time object check for buffer overruns? (Maybe that run-time checking is a different compiler switch.)

I thought buffer overruns typically occurred with objects having length descriptors (such as strings). Are the strategy parameters passed as strings?

Well, I'm amazed you could find the problem from the tiny code segment I posted. That's impressive. And thanks for fixing it so fast!
0
Glitch8
 ( 10.10% )
- ago
#12
It wasn’t a buffer overrun. The issue was that the shrinking window was not assigning a value that aligns to the possible values as defined by the start, stop, step settings.
1

Reply

Bookmark

Sort