Hello all,

I have some problems with implementation of my strategy.

As I'm not experienced in programming and it's first time I deal with C#, could be that I've made some really basic mistakes.

Strategy description:

- filtering the stocks by coarse universe method (selecting stocks with price greater than 25 and volume greater than 500000),

- two indicators - simple moving average of highs and relative strength index,

- additional rolling window to store previous bar high and close values,

- all in minute bars resolution,

- long-only positions, investing 50% of capital per trade,

- going through stocks and buying when RSI lower than 5 AND previous bar high is under SMA of highs,

- sell when previous bar high crosses SMA of highs OR if 'take profit' 1% activated

Problems and questions:

1. Blocking point: I get the runtime error during backtest:

Runtime Error: Unable to create SPY Minute consolidator because SPY is registered for Daily data. Consolidators require higher resolution data to produce lower resolution data.

I guess that it's connected somehow with coarse universe selection, but I've no idea how to solve it.

2. Is my general approach for applying indicators for each of stocks from universe correct?

3. I didn't find anywhere definition of moving averages for highs, lows or volume.

Is my definition correct? How it will look like in case of volume - Field.Volume?

SMA(Stock.Symbol, hPeriods, Resolution.Minute, Field.High);

4. Is the rolling window the best option to get previous bar values?

RollingWindow lastMinute = new RollingWindow(1);

lastMinute.Add(data[Stock.Symbol]);

Or maybe would be better to implement History function.

5. If using rolling window, the last data from the window is the previous bar data or current bar data?

lastMinute[0].High

6. Regarding LimitOrder as it needs number of shares in integer argument - what is the best practice to get it automatically?

LimitOrder(Stock.Symbol, - Stock.Holdings.Quantity, takeProfit);

7. Is there search through codes published on forum possible? It's really hard to find any examples of some features implementation on forum. GitHub is working fine for that but there are not too many examples.

I will be really grateful for any help.

Some additional tips are also welcome.

Regards,

Andrzej Fudala

Author