Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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