NexusFi: Find Your Edge


Home Menu

 





Pairs Trading Backtest as One Strategy?


Discussion in Platforms and Indicators

Updated
    1. trending_up 8,575 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 2 attachments




 
Search this Thread

Pairs Trading Backtest as One Strategy?

  #1 (permalink)
Transatlantic
Los Angeles, CA
 
Posts: 14 since Sep 2015
Thanks Given: 0
Thanks Received: 3

Hi,

Does anyone know which if any Retail Trading Platforms can backtest a Pairs Trading Strategy using only one chart and as only _one_ native strategy? (ie not two strategies with X and Y swapped in the second one)

1. Can Tradestation do this using Portfolio Maestro?
2. Can Multicharts do this using their Portfolio Trader?
3. Can Ninjatrader do this natively?

Importantly, I am looking for a platform that will natively shows the PnL total trading both legs in one report...ie dont want to have to add together two strategy reports outside of the platform. Also want to be able to optimize _one_ strategy and have it use the same parameters to trade both sides.

-S

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #2 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,049 since Dec 2013
Thanks Given: 4,386
Thanks Received: 10,206

The way I have done it in Tradestation before is as follows.

Assume we have two Instruments X and Y.
Chart 1 has X as data1, X as data2, Y as data3
Chart 2 has Y as data1, X as data2, Y as data3

Write a single strategy for the pairs trade. At the beginning of the strategy you have some simple code that detects whether data1 is equivalent to data2 or data3. Now the strategy knows which instrument the chart is trading. So when it comes to executing orders you do something like "if data1 is same as data2 then execute orders for X otherwise execute orders for Y".

As you state the problem with this is that you have two performance reports and two sets of trades and you need to do your own calculations to add them together, which is a major pain if you are doing optimizations.

In theory you should be able to do it in Maestro though, which should combine the results into a single performance chart for you.

Reply With Quote
  #3 (permalink)
jkepha
San Antonio, TX
 
Posts: 31 since Apr 2020
Thanks Given: 10
Thanks Received: 6


Hello!

1) Did you figure this out? Trying to run a pairs trading strat as well

2) What are you entry and exit points? I'm just not sure how to implement a pairs trading strat successfully. When I throw two instruments on tradingview, its seems apparent which to go long and short on. But when you move the time of the chart/zoom in and out, the relationship changes. Maybe I would just have a point in time that is the starting point and once the prices diverge open the trade and exit when applicable, and then just keep moving the start time of when to calculate percentage change?

Let me know if you have any ideas please sir/maam! Sorry if this is somewhat obscure.



Reply With Quote
  #4 (permalink)
Transatlantic
Los Angeles, CA
 
Posts: 14 since Sep 2015
Thanks Given: 0
Thanks Received: 3

SMCJB,

Thank you for your awesome idea - I have coded that up and will have it running in TS Portfolio Maestro shortly.

Jkepha, as you can see this is still an open issue. It is very frustrating that no retail platform offers a good Pairs trading solution (ie not having to use two charts).

My current plan:

1. TS Portfolio Maestro
2. Multicharts Portfolio Trader (but I have issues with their builtin Pairs Strategy - I dont like it)
3. Matlab

I have Matlab working but so maybe I should just run with that.

Transatlantic

Reply With Quote




Last Updated on March 13, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts