NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 10-25-2007, 10:34 PM   #1
HelloHello
Member
 
Join Date: Aug 2007
Posts: 83
Thanks: 0
Thanked 0 times in 0 posts
Default Pair trading / Spread trading

Hi,

1) I'm wondering if you are able to in Ninja Script to Pair Trading / Spread Trading, where you have (2) data feeds of 2 different stocks and are able to say long one and short the other at the same time?


2) NTMarketPosition("") ---> okay say I have a trade station chart on. The symbol is INTC. In order to find out the marketposition of INTC I type NTMarketPosition(""), but say that while I'm on the INTC chart I want to find out the market position of CSCO, can I type NTMarketPosition("CSCO");

Thanks
HelloHello is offline  
Reply With Quote
Old 10-25-2007, 10:56 PM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

1) Yes, please see SampleMultiInstrument strategy and docs related: http://www.ninjatrader-support.com/H...struments.html
2) No. But you could code your own TS EL function to do that, please check out how NTMarketPosition function is implemented in TS EL and how the symbol is referenced. Note: This is beyond what we can support, you would need to try on your own.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 10-26-2007, 07:10 AM   #3
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

1) NT 6.5 due out shortly is better equipped to handle this since we will introduce an OnMarketData() method that is fired for every change in market data for the "pair" you are tracking.
NinjaTrader_Ray is offline  
Reply With Quote
Old 10-26-2007, 07:54 AM   #4
HelloHello
Member
 
Join Date: Aug 2007
Posts: 83
Thanks: 0
Thanked 0 times in 0 posts
Default

excellent,

also are you able to in ninja script run multiple strategies?

Thanks
HelloHello is offline  
Reply With Quote
Old 10-26-2007, 07:56 AM   #5
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

- you can run multiple NS strategies on different instruments concurrently
- you can not run a NS strategy within a NS strategy
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-12-2010, 06:36 PM   #6
nightriderx
Senior Member
 
Join Date: Jul 2010
Posts: 187
Thanks: 3
Thanked 0 times in 0 posts
Default

I am trying to convert a pair trading/spread strategy that I built in WealthLab. I am having a bit of a hard time, starting with the basic of how do I get the price of the second stock, then proceed to use the bar close price of both to go through my calculations. Can you please direct me. As I understand NT7, which is what im using, has some special features for this...can you please explain all.
Thx in advance!
nightriderx is offline  
Reply With Quote
Old 07-12-2010, 07:09 PM   #7
NinjaTrader_Tim
NinjaTrader Customer Service
 
NinjaTrader_Tim's Avatar
 
Join Date: Nov 2009
Location: Denver, CO
Posts: 1,424
Thanks: 0
Thanked 3 times in 3 posts
Default

Hi nightriderx,

I have implemented something very similar here - http://www.ninjatrader.com/support/f...d=1&linkid=293

Using a multi-series script - http://www.ninjatrader-support.com/H...ameInstruments
NinjaTrader_Tim is offline  
Reply With Quote
Old 09-17-2010, 03:53 PM   #8
artov
Junior Member
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 times in 0 posts
Default

The first link does not seem to be working
artov is offline  
Reply With Quote
Old 09-18-2010, 08:55 PM   #9
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

artov,

Thanks. It has likely been moved to a different location.

Believe it is this one: http://www.ninjatrader.com/support/f...d=4&linkid=363
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MB Trading Question woodside Connecting 1 10-20-2007 09:05 AM
Futures spread trading flyingeagle Miscellaneous Support 1 11-21-2006 08:57 AM
Orders not going through to MB Trading rbrow Connecting 41 05-01-2006 04:59 AM
Trading through TradeStation MtkaTrader Miscellaneous Support 2 04-07-2006 01:56 PM
Clueless at MB Trading Savage1701 Miscellaneous Support 1 12-22-2005 07:34 PM


All times are GMT -6. The time now is 08:47 PM.