1 registered members (AndrewAMD),
1,323
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
RINA 3D optimization charts
#435429
01/08/14 07:14
01/08/14 07:14
|
liftoff
Unregistered
|
liftoff
Unregistered
|
Is it possible to run an optimization on two parameters in a system like a slow moving MA and a fast moving MA and produce a 3D chart similar to the one produced by RINA in tradestation in Zorro? If we can get Zorro to run optimization across all the selected parameter values and dump the numbers to a .txt file we can simply open it up in excel and analysis it in 3D mode or however best we see fit. As far as I know current optimization in Zorro, takes the default value you selected for B when optimizing A and after that produce a 2D chart of Profit factor based on the steps from min to max of A giving the default value of B. But it would also be nice if we can get 3 values in a sense. Starting with the min of B, Zorro does the current form of optimization for A, then steps up one, runs the same optimization for A giving the new value of B, steps up B one more runs the current form of optimization for A. So in the end we get 3 values, 1 for A, one for B and the profit factor and this gets written to a .txt file, we can import it into excel and do plateau analysis and similar stuff.
|
|
|
Re: RINA 3D optimization charts
[Re: jcl]
#435446
01/08/14 09:35
01/08/14 09:35
|
liftoff
Unregistered
|
liftoff
Unregistered
|
Thanks @jcl , funny enough I understand exactly what you said, but getting Zorro to it will be headache, low programming skills on my part. I am guessing it will follow a structure similar to tutorial 8? Can I get a sample code based on two simple moving averages, so I can build on from there?
|
|
|
Re: RINA 3D optimization charts
[Re: ]
#435450
01/08/14 09:48
01/08/14 09:48
|
acidburn
Unregistered
|
acidburn
Unregistered
|
I think your programming skills are more than adequate for this task, liftoff. But visualization will be a bitch. I'm not even sure API currently would allow for a custom 2D visualization (for example a scatter plot with both axis user defined), let alone some nice 3D surface plots. This is not to say that advsofteng's library that Zorro uses is not up to the task, it's actually very powerful. But probably some of it's API is not currently exposed to scripts. I agree that exhaustive parameter search with simple 2D/3D visualization would be very helpful in the strategy research stage.
|
|
|
Re: RINA 3D optimization charts
[Re: jcl]
#435455
01/08/14 10:00
01/08/14 10:00
|
acidburn
Unregistered
|
acidburn
Unregistered
|
Yes, external visualization is probably the best way, atm. Although I would prefer that Zorro in the future can be used even for such tasks. The library it is linked with already supports all kinds of funky charts http://www.advsofteng.com/gallery.html
|
|
|
Re: RINA 3D optimization charts
[Re: ]
#435458
01/08/14 10:03
01/08/14 10:03
|
liftoff
Unregistered
|
liftoff
Unregistered
|
LoL ... I feel so overwhelmed right now... But I am sure I will get there in a couple of months. I should be done with Jaekle and Tomasini's book by tomorrow so I will have some spare time to see if I can get zorro to spit out the needed figures in a csv file so I can do all the hunky punky stuff on excel. Thanks a lot for the input guys@jcl & @acidburn, your efforts are well recognized.
Last edited by liftoff; 01/08/14 10:04.
|
|
|
Re: RINA 3D optimization charts
[Re: ]
#435464
01/08/14 10:22
01/08/14 10:22
|
liftoff
Unregistered
|
liftoff
Unregistered
|
I should be reading the manual a lot more. I think I just found some sample codes in there about how to write test results to csv files. I think a little tinkering around should lead me down the right path. I will post my sample code here when I manage to put together one, soon.
|
|
|
Re: RINA 3D optimization charts
[Re: ]
#435466
01/08/14 10:26
01/08/14 10:26
|
acidburn
Unregistered
|
acidburn
Unregistered
|
See, already "will get there in a couple of months" shrunk to "soon". If we don't get it by the end of the day...
|
|
|
Re: RINA 3D optimization charts
[Re: ]
#435481
01/08/14 12:52
01/08/14 12:52
|
liftoff
Unregistered
|
liftoff
Unregistered
|
I tried using the Luxor script to generate the csv file with the value of the slow moving MA, fast moving MA, Gross Profit and Gross Loss. I failed miserably it seems. Can anyone help point me where I am making mistakes?
function run()
{
StartDate = 2003;
EndDate = 2008;
BarPeriod = 30;
LookBack = 30;
asset("GBP/USD");
int Slow = 20;
int Fast = 1;
int MaxSlow = 60;
int MaxFast = 10;
// no trade costs...
Spread = 0;
Slippage = 0;
RollLong = RollShort = 0;
for(Slow; Slow<=MaxSlow;++Slow){
for(Fast; Fast<=MaxFast;++Fast){
vars Price = series(priceClose()),
Fast = series(SMA(Price,Fast)),
Slow = series(SMA(Price,Slow));
static var BuyLimit,SellLimit,BuyStop,SellStop;
if(crossOver(Fast,Slow)) {
BuyStop = priceHigh() + 1*PIP;
BuyLimit = priceHigh() + 5*PIP;
}
if(crossUnder(Fast,Slow)) {
SellStop = priceLow() - 1*PIP;
SellLimit = priceLow() - 5*PIP;
}
if(!NumOpenLong && Fast[0] > Slow[0] && Price[0] < BuyLimit)
enterLong(1,BuyStop);
if(!NumOpenShort && Fast[0] < Slow[0] && Price[0] > SellLimit)
enterShort(1,SellStop);
if(is(EXITRUN)){
char line[100];
sprintf(line,
"%i,%i,%i,%i\n",
Slow,Fast,WinTotal,LossTotal);
file_append("Data\\NetProfit.csv",line);
}
}
}
}
|
|
|
|