Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (wandaluciaia, AndrewAMD, 1 invisible), 765 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
creating an Asset list from control panel #473668
08/02/18 22:40
08/02/18 22:40
Joined: May 2018
Posts: 134
S
SBGuy Offline OP
Member
SBGuy  Offline OP
Member
S

Joined: May 2018
Posts: 134
I currently hardcoded my multi-asset strategy like this:

while (asset(loop("AAPL", "MSFT", GOOG")))
{
strategy....
}

What's the best way to get a user-defined list of assets from a control panel(), so I can change the asset list on the fly?

Do I simply make a string array from the panel inputs, then use a for loop like this?

Code:
void run()
{
    get panel asset entries into MyAssets[N] array;

    for (i=0; MyAssets[i]; i++)
    {
        asset(MyAssets[i]);
        strategy..
    } 
}








Last edited by SBGuy; 08/02/18 22:40.
Re: creating an Asset list from control panel [Re: SBGuy] #473674
08/03/18 14:57
08/03/18 14:57
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes. Make sure that you do that in the first run, because assets can't be added in later runs.

Re: creating an Asset list from control panel [Re: jcl] #473678
08/03/18 18:26
08/03/18 18:26
Joined: May 2018
Posts: 134
S
SBGuy Offline OP
Member
SBGuy  Offline OP
Member
S

Joined: May 2018
Posts: 134
Oh.. so in live trading, I have to Stop, change the assets list, then Train, and Trade again? Maybe this doesn't work in a way that I was envisioning.

I was thinking of writing a multi-asset portfolio strategy, with the ability to swap out assets on the fly using a control panel, without resetting the portfolio performance metrics like P&L, win rate, etc.

Is this possible? Or am I just better off running a single asset strategy on multiple instances of Zorro S, then doing portfolio analysis manually an offline?

Re: creating an Asset list from control panel [Re: SBGuy] #473680
08/03/18 20:30
08/03/18 20:30
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
You can also have a complete Asset list and train them all, and then cherry-pick your Assets with the GUI.

How you program this depends on your goals.

Re: creating an Asset list from control panel [Re: AndrewAMD] #473684
08/03/18 23:45
08/03/18 23:45
Joined: May 2018
Posts: 134
S
SBGuy Offline OP
Member
SBGuy  Offline OP
Member
S

Joined: May 2018
Posts: 134
The only way to do this is put all 4,000+ US stocks into the AssetList, and create indicators for them on every run() :-) As soon as I like one stock that isn't one my AssetList, I'm back to the same problem :-(

But you're right, if my asset list is like 20, but only cherry pick 4-5 at a time, then its probably doable.


Moderated by  Petra 

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

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

Powered by UBB.threads™ PHP Forum Software 7.7.1