I serched their site but could not find anything related to pairs trading.
btw most demo code for pairs are for daily movements while i am trying to built something for an intraday use based on my 1 min. files.
also, demos are all in daily. Probably due to easy access to replicatable data sets (yahoo/google finance) and quick execution in order to see functionality. But that is irrelevant as quantstrat can handle tick data and BBO series. So it can get as granular as you want. Its just up to you to modify the code in order to do so.
The following user says Thank You to treydog999 for this post:
I would like to post my code which is set for intraday pair. I am new to R but I am trading for many years many different instruments and would like to expand into the pair trading in intraday futures.
Pls notice you can choose both IQfeed or read from file to load the data (which is what i was strangeling when open this post). It's not yet complited and I would like to get the crowd's feedback as much as you can expose.
Since I didn't want to create new thread I will post my question here.
I have recently created a very simple trend-following strategy(double MA crossover) that trades on short and long side. I learned everything until now from IlyaKipnis webinar and blog, however, his ATR position sizing method is not appropriate in my case, because this method assumes that I can access leverage for my system. To address that I tried to use osFUN=osDollarMax approach, but new problem arose. This method increases position size if the price of underlying asset decreases and more of it can be bought. Therefore, when the system has profitable short trade it just keeps scaling up the position until the trend reverses. Can you give me any advice how to remove this scaling in/pyramiding thing entirely from the system? (I mean, that I want my system to open trade and keep the position size constant until it is closed in both, long and short side).
Well, I really don't want to start inventing bicycle (thats why I started using quantstrat instead of creating my own trading platform), so I was just wondering, if there is any position sizing function that buys maximum quantity of stock that can be bought with equity that is available at the moment of order execution instead of initial equity.
Of course, if that doesn't exist, I will have to create my own function.
While that sounds simple to implement, it actually involves recomputing your equity to that point, which is an operation with a non-negligible computing time. Quantstrat operates in cash P&L space, and is a tool to evaluate the efficacy of your signal, not performing return computations. To me, it sounds like you would be better served by writing your strategy in returns space as I have on my blog with some volatility-based strategies, and then evaluating it using PerformanceAnalytics.