I'm hoping to ask for some help please. My strategy runs against a basket of stocks each day, and each day the stocks within that basket change. E.g. on 12/27 the stocks may be ABST, ACB, AGC, while on 12/28 the stocks may be BCRX, BOWX, BRKL. Currently when I use the Strategy Analyzer to backtest the stocks, I am needing to run the test day by day, changing the date and instrument list each time (which is obviously a tedious exercise!).
I'm hoping to be able to make this smoother and hoping for some help please/be pointed in the right direction. I'm imagining something along the lines of:
1. Create an array (or list, or keypairs - not sure which is best) with date and stock symbols, akin to:
//Obviously not real code
private array myArray;
myArray = ({12-27-2021, ABST}, {12-27-2021, ACB}, {12-27-2021, AGC}, {12-28-2021, BCRX}, {12-28-2021, BOWX}, {12-28-2021, BRKL})
//Obviously not real code
protected override void OnBarUpdate()
{
if ( 'Instrument.FullName Not within Array[1]' || 'Date Not within Array[0]' ) return; //not sure yet how to reference the date for the current bar.
...
I'm fairly new to C# so happy to research to get the code running, but would really appreciate any pointers you could provide to set me in the right direction please.
Many thanks in advance
ChainsawDR

Comment