![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Aug 2008
Location: Orlando, Florida
Posts: 166
Thanks: 0
Thanked 0 times in 0 posts
|
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"); |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Please see this tip: http://www.ninjatrader-support.com/v...splay.php?f=31
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2008
Location: Orlando, Florida
Posts: 166
Thanks: 0
Thanked 0 times in 0 posts
|
There are several tips there and I don't know which you are referring to.
|
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |