The code below compiles fine but the Strategy Parameter does not change Net Profit during Optimization. When I replace p.EntryPrice * ivSell with p.EntryPrice * (any number) it works fine. Both p.EntryPrice and ivSell are doubles so I'm not sure what's wrong.
CODE:
Please log in to see this code.
Size:
Color:
It does change Net Profit during Optimization. See for yourself:
Size:
Color:
Well, that's embarrassing. I spent hours on this problem.
Apparently, the period under test is not long enough (not enough bars...2 years Daily on Dow 30).
Or, the Particle Swarm (GPAC PSO) algorithm aborts because the variance between tests is below some threshold (that's a guess). Just tried Exhaustive with same result.
Size:
Color:
Embarrassing, yes. I optimized on 10 years.
Size:
Color: