NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


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 08-28-2008, 04:58 PM   #1
SystemTrading
Senior Member
 
Join Date: Aug 2008
Location: Orlando, Florida
Posts: 166
Thanks: 0
Thanked 0 times in 0 posts
Default Multiple entries

My code is trading 2 instruments. When instrument #1 is filled on an order, my code immediately sends an order on instrument #2. Upon sending the order, I get the error "Error calling 'OnBarUpdate' method for strategy 'MyStrategy'. Object reference not set to an instance of an object. I have narrowed down the problem to the following line of code. Using TraceOrders I get no information on the problem. My strategy would be either long both instruments or short both, so my problem could be related to EntriesPerDirection or Entry Handling. Currently I am using EntriesPerDirection=1 and
EntryHandling = EntryHandling.UniqueEntries. Any help is greatly appreciated.

Code:

FuturesLongEntry=EnterLongLimit( 0,true,Contracts,GetCurrentAsk(0),"Long");
SystemTrading is offline  
Reply With Quote
Old 08-28-2008, 11:05 PM   #2
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

Please see this tip: http://www.ninjatrader-support.com/v...splay.php?f=31
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-29-2008, 07:48 AM   #3
SystemTrading
Senior Member
 
Join Date: Aug 2008
Location: Orlando, Florida
Posts: 166
Thanks: 0
Thanked 0 times in 0 posts
Default

There are several tips there and I don't know which you are referring to.
SystemTrading is offline  
Reply With Quote
Old 08-29-2008, 08:18 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Incorrect link, here is the one you want.

http://www.ninjatrader-support.com/v...ead.php?t=4226
NinjaTrader_Ray 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
Coordinate Multiple strategy entries maninjapan General Programming 7 06-04-2008 02:04 AM
Wrong dates of the entries chobotnice Strategy Development 2 04-25-2008 01:25 AM
Entries: 1 Bar Slower when backtesting samuelg Strategy Development 2 04-13-2008 07:01 PM
Entries per direction latkinso General Programming 4 02-12-2008 09:27 AM
EMA Entries and Exits gygraham Strategy Development 3 01-25-2008 12:30 PM


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