NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 11-09-2011, 06:13 AM   #1
hbmiles2000
Junior Member
 
Join Date: Aug 2011
Posts: 25
Thanks: 9
Thanked 0 times in 0 posts
Default Trade Alternate Instrument from Strategy Conditions

Greetings,

I am wondering how I could use one of my existing strategies, developed to be used on 1 particular instrument but have it trigger entries/exits on a completely different instrument, hopefully without changing too much. Is there a way to specify the instrument in the entry/exit methods?

Thank you,
hbmiles2000
hbmiles2000 is offline  
Reply With Quote
Old 11-09-2011, 06:44 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

hbmiles2000, yes what you look for here is a MultiInstrument strategy, a working example is preinstalled with NT and it's named 'SampleMultiInstrument' strategy.

The framework used is explained in depth here in our helpguide :

http://www.ninjatrader.com/support/h...nstruments.htm
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-09-2011, 06:57 AM   #3
hbmiles2000
Junior Member
 
Join Date: Aug 2011
Posts: 25
Thanks: 9
Thanked 0 times in 0 posts
Default

Thanks Bertrand-one more question that I cannot find the answer to in the documentation - where & how do you define the signal name you can use to enter/exit various instruments within the context of bars updates for other instruments?
Thx again,
hbmiles2000
hbmiles2000 is offline  
Reply With Quote
Old 11-09-2011, 07:08 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Please take as example this Market order entry overload we have :

EnterLong(int barsInProgressIndex, int quantity, string signalName)

The barsInProgressIndex is the bars series you submit to, if you Add() for example MSFT to your strategy and enter 1 as the index (the second instrument, it starts counting from 0) then you would submit to MSFT instead. The signalName is just a string you could configure to your liking and potentially add the instrument name here as well to differentiate.
NinjaTrader_Bertrand is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Bertrand for this post:
Reply

Tags
instrument

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
Strategy Session template = <Use instrument settings> but fired trade in pre-market shodson Strategy Development 6 03-03-2011 11:42 AM
Entering trade on instrument not in Strategy spinalwiz Version 7 Beta General Questions & Bug Reports 5 02-12-2010 10:35 AM
conditions and action for 1 trade a day tradmech General Programming 3 01-03-2010 08:05 PM
strategy executes trade when conditions are wrong paschall Strategy Development 1 10-30-2009 03:02 PM
Strategy: Halting a Strategy Once User Defined Conditions Are Met NinjaTrader_Josh Reference Samples 0 01-04-2008 12:09 AM


All times are GMT -6. The time now is 02:14 AM.