Gamestudio Links
Zorro Links
Newest Posts
Can't plot daily high & low
by Junker. 10/13/19 23:51
Imgui Lite-c Development
by txesmi. 10/13/19 09:40
by Dooley. 10/11/19 18:53
Need Help Finding Cause of Crash
by Dooley. 10/11/19 18:51
What algorithm is used for BALANCED?
by JamesHH. 10/11/19 17:32
Votes for future features
by AndrewAMD. 10/11/19 14:12
Price not shown correctly via MT4 bridge
by gamadeus. 10/10/19 05:48
Loading Keybindings from a File
by Dooley. 10/10/19 03:44
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
5 registered members (Michael_Schwarz, YG8, kvm, JamesHH, 1 invisible), 637 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
FrankW, TedMar, raimucuk, vivaldi2, filip
18304 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Optimisation results different when combining assets #477951
08/19/19 09:50
08/19/19 09:50
Joined: Feb 2019
Posts: 14
j45p41 Offline OP
j45p41  Offline OP

Joined: Feb 2019
Posts: 14

i am trying to maintain different parameter values for each asset. When I train my algo with a single asset the parameter values are different to when I run the assets as a loop combined.

When trained as a loop of assets:

COP.US/USD +1.667 10.63=> 1.118
APA.US/USD +1.667 +5=> 99.999

Trained individually:
APA.US/USD +1.667 +15=> 0.398

COP.US/USD +1.667 10.63=> 1.118

I have looked at the manual and it states that you should make your optimisation calls outside of the loop:

so my code is:

TakeProfit = optimize(0.01, 1, 5, 1, 0); //Parameter 1
Stop = optimize(0.01, 5, 15, 5, 0); //Parameter 2 - need to imcrease 15 to 30

// Testing - 1
while (stock=(loop((char*)"COP.US/USD"))){

//string algo = Algo;

algomain(stock, HLIMIT);


It looks like parameters are being shared between the loop - how do I get the same results as if ran individually pls?

i can see:

For optimizing asset- or algo-independent parameters in a portfolio system, call optimize outside the loop, but select an asset before calling optimize. The global parameters are then assigned to this asset. If individual optimization is not desired, don't use loop, but enumerate the assets in a simple for loop, f.i. for(used_assets) ..., and optimize the parameters outside the for loop. Make sure in that case to select all assets before the first optimize call; otherwise the optimizier will assume a single-asset strategy.

however the asset is only selected after the loop has started execution, so how do you select the asset outside of the loop?

Last edited by j45p41; 08/19/19 12:46.
Re: Optimisation results different when combining assets [Re: j45p41] #477966
08/20/19 08:42
08/20/19 08:42
Joined: Jul 2000
Posts: 27,024
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,024
Asset order matters - read here why and when:

You select an asset with the asset() function.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at)

Powered by UBB.threads™ PHP Forum Software 7.7.1