Reply To: news in AlgoQuant


Thanks for the help:
I have two more:
Lets suppose I have one minute data but I want my strategy (simple moving average crossover, for example) to run from 10:am- 16:00, for everyday in the back testing period.

This means I want a warm up period of 30 minutes. I also want the strategy to end at 16:00:
The moving average crossover strategy starts fresh everyday and ends the same day.

Is there an easy way to do it?
I was thinking in using the timer in such a way that i select one minute instants from 10:00 am to 16:00 pm as firing events.

Is this the correct way to do it?.


In the simple Tutorial Strategy that comes as example with Algoquant ,

I created the dummy dataset that can be produced with the the BloomberFactory(just to get used to and play with algoquant)

BloombergTickDataCacheFactory data = new BloombergTickDataCacheFactory(outDir);
SequentialCache loadedCache = data.newInstance(product, interval);

and I apply it to the stategy
DepthCaches depthCaches = new DepthCaches(product, loadedCache);
// construct an instance of the strategy to simulate
Strategy strategy = new TutorialStrategy(product) etc…

I get NAN results:

Since the cross over moving average strategy needs the bid and ask (buy at the ask and sell at the bid).

Why did you did not create the bid and ask (as in depth) for the class BloombergTickData

It sems you can define a type only.

The class
BloombergTickDataCacheFactory creates a new instance(…)
and it is not smart enough to figure out only one type was created
and therefore the results return NAN

wehen I change the isntruction
buffer.put(tick.time(), new Depth(product, bid, ask))

buffer.put(tick.time(), new Depth(product, bid, 3.1416));
I could also put
buffer.put(tick.time(), new Depth(product, bid, bid));

The strategy runs and plots sometihng that is ok.

I was wondering what could be the easiest way to transform BloombergTickData
to a proper Depth?

(StockEOD (data from Yahoo) was transformed to Depth without problem)