Mulitple assets to test in a strategy

Posted By: sdelatorre

Mulitple assets to test in a strategy - 04/22/18 21:05

Hello,

I have an strategy and I would like test it with some assets.

Any idea ? is it psosible ?

I wan't select every time in Zorro the asset, can do it automatic?
I know that i can choice asset with zorro but i want to test in some assets..

Thanks in advance
Posted By: kujo

Re: Mulitple assets to test in a strategy - 04/23/18 02:04

Hi, use asset() function to select an asset in the script. See examples here:
http://zorro-trader.com/manual/en/asset.htm
http://zorro-trader.com/manual/en/tutorial_kelly.htm

There is a good Zorro tutorial in the manual. I'd recommend to start with it.
Posted By: sdelatorre

Re: Mulitple assets to test in a strategy - 04/23/18 08:23


Thanks,I saw it but I want for every asset shows profits and not all in general.
Posted By: Brax

Re: Mulitple assets to test in a strategy - 04/23/18 09:44

In the performance report you can search for the "Wgt%" field, that's the profit contribution of every asset to the whole portfolio.

http://www.zorro-trader.com/manual/en/performance.htm

If you want to plot individual equity curves, apply to every asset the code showed here in "Plot equity curves of single assets in a multi-asset strategy".

http://www.zorro-trader.com/manual/en/tips.htm
Posted By: sdelatorre

Re: Mulitple assets to test in a strategy - 07/01/18 19:34


Thanks brax but the code doesn't work correctly because only plot when the select asset is the same that the asset select in the box.


Any idea ?

Thanks in advance
Posted By: Sphin

Re: Mulitple assets to test in a strategy - 07/01/18 19:40

Did you try:

Code:
setf(PlotMode,PL_ALL);

Posted By: sdelatorre

Re: Mulitple assets to test in a strategy - 07/05/18 20:34

Thanks, with setf(plotMode,PL_ALL) and the trick of plot equity is good but the lines are discontinuous.

There is strange because :

while(Name = (loop(Assets)))
{
asset(Name);
plot(Name,priceClose(),NEW,CYAN);

--> The lines are discontinuos too but if I plot at the end of my code there is no problema with:

asset("EUR/USD);
plot("EUR/USD",priceClose(),NEW,CYAN)

--> The line is correct, No problem.
© 2024 lite-C Forums