The strategy in abstract form is simple. There are two equities ZOO and POO and I want to test 30 minute bar data.

Let X be the difference in price of POO and ZOO at a given time.

The trading order is going long ZOO and POO in an A:B ratio.

Let C be the cost of that order while ignoring market impact and only considering predicatable costs.

If X > C for the Slice :

execute the trade of going long POO and ZOO in an A:B ratio. 

If X = 0

Liquidiate net position.

Close all positions at market close.


Other things:

In the future, I intend to backtest this strategy comparing ZOO to a basket of POO's where the A:B ratio of the order depends on what POO actually is.

In my mind this is a toy example of pairs trading, so I imagine this is extremely simple to implementm, but I am having a hard understanding which modules I need to tweak and custom build.

Thanks in advance to anyone who even read all of this!