Tracking Price Series in Stock Rotation Strategy

Posted By: aelagha

Tracking Price Series in Stock Rotation Strategy - 09/29/23 14:29

Hi there,

I am working on a stock rotation strategy. In between rotations, I want to monitor the current price and make calculations on price history for the assets that have open trades. So, for every bar, I cycle trhough open_trades, and attempt to create a series, but Zorro erros out as I am switching and chaning the series between "run function" calls, e.g. Error 041.

One way is to create a sereis for each asset in the assetList (all_assets) rather than only for open trades. Is there a better / more efficient way since I have 100's of assets.

Thanks,
-Alaa
Posted By: AndrewAMD

Re: Tracking Price Series in Stock Rotation Strategy - 09/29/23 15:00

It is required that you have the same exact number of series() calls for every run() call so that Zorro can identify each individual series.

Now if you want to optimize it, you can specify a smaller series length. This would consume less memory.

I run a trading system with about 150-200 stock tickers, each with its own series(). It's not a problem because Zorro is quite fast.
Posted By: aelagha

Re: Tracking Price Series in Stock Rotation Strategy - 09/30/23 02:47

Thanks Andrew, and yes zorro is awesome. I really love it.
Posted By: Nightmarek

Re: Tracking Price Series in Stock Rotation Strategy - 10/10/23 16:24

You can take a look of my thread as an example, appreciate if you can share your thoughts as well as I am encountering an obstacle in ensuring the correct execution of rebalancing with that loop function
© 2024 lite-C Forums