I have locally ingested the Index and equity data locally and have the bundle ready.
When I run a simple SMA strategy, I see that the index is also acting as equity and is getting traded.
def initialize(self, context):
pipeline_data = self.pipeline.pipe()
attach_pipeline(pipeline_data, 'backtest_pipeline')
set_benchmark(symbol('NSEI'))
How can we avoid NSEI as a tradable component??
Are you using zipline as your backtesting library? Zipline does not distinguish between tradeable or non-tradeable assets AFAIK. One way to make sure you do not end up trading indices is to assign 0 volumes while you are ingesting your data. If you are using standard slippage model, a zero volume will ensure no trades in that asset.
Yes, I am using zipline as a backtesting library.
that is a good idea to set the volume as 0 and ingest data. I am sure it will work.
Thanks for guiding.