Optimize Stop with multi Asset strategy

Posted By: sdelatorre

Optimize Stop with multi Asset strategy - 07/22/18 18:57

Hello,

Every barperiod I calculate some numbers and with them I build a pair (EUR/USD) or maybe another I don't know it.

Now I would like optimize Stop but when I write : stop=optimize(30,5,50,10)*PIP.

The result is only the first pair that the strategy builds and then stops the training.
I try get from the result something that:
EUR/USD:RSI:30
EUR/CAD:50
.....
.....
How I can train for every pair that strategy trades ?

Thanks in advance
Posted By: Dalla

Re: Optimize Stop with multi Asset strategy - 07/22/18 19:48

Did you put your optimize statement inside an asset loop?
Posted By: sdelatorre

Re: Optimize Stop with multi Asset strategy - 07/24/18 08:07


If I put inside gives me Error incosistence call.

I put out
Posted By: AndrewAMD

Re: Optimize Stop with multi Asset strategy - 07/24/18 13:58

Be careful with the uppercase.

Change stop to Stop.
Posted By: sdelatorre

Re: Optimize Stop with multi Asset strategy - 07/24/18 14:24


I put "Stop" my code:

while(Name = (loop(Assets)))

{
while(algo(loop("RSI")))
{
if(Algo == "RSI") {

if(assetType(Name) != FOREX)
continue; // Currency pairs only
asset(Name

Stop=optimize(30,10,50,10)*PIP;

int a=strcmp(Name,par2);
int b=strcmp(Name,par3);


if (a==0){short(par2); }

if (b==0){large(par3);}
}
}
}

And Zorro shows: 040:incosistence NZD/JPy:RSI optimize calls!

I think that NZD/JPY is the first pair that code builds.


ANy idea ? Thanks
© 2024 lite-C Forums