I am trying to create a toggle switch to be used in optimizations. The idea is to test different exit/entry based systems and run them through an optimization w/ o having to compile a different code each time. So for example:
toggle = CreateParameter("toggle",0,0,1,1 )
toggle2 = CreateParameter("toggle2",0,0,1,1 )
so if toggle.ValueInt == 1
you run some code
and if toggle2.ValuInt == 1 while toggle.ValueInt == 0
you run some other code
and if code segment has optimizable parameters it only get optimized when that particular toggle is activated.
Size:
Color:
Yep, that's a popular design pattern. What's your question?
Size:
Color:
Can you point me to a sample?
Thanks
Size:
Color:
A sample of what? You already know how to do it, judging by the code lines. The only missing piece is an if{ ... } else { ... } filled with your trading system rules. It's C# 101.
Size:
Color:
The part that is missing is to get the optimizer to NOT run though variables in a toggle zeroed out.
So if toggle1 == 0 but it contains a ShortAtLimit(bar+1,limit.ValueInt,"SAL") I don't want the optimizer to cycle through the limit.ValueInt variable. I know the results will be zero but the optimizer cycles through and "wastes" time.
Thanks.
Size:
Color:
You can't influence the optimizer from a Strategy. There are other ways to speed it up (a more coarse optimization step, Monte Carlo and Genetic optimizers, a faster CPU...)
Size:
Color:
Thank you.
Size:
Color: