Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple entries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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:
    [FONT=Courier New][SIZE=2]
    FuturesLongEntry=EnterLongLimit( [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],Contracts,GetCurrentAsk([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]),[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"Long"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);
    [/SIZE][/FONT]

    #2
    Please see this tip: http://www.ninjatrader-support.com/v...splay.php?f=31
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      There are several tips there and I don't know which you are referring to.

      Comment


        #4
        Incorrect link, here is the one you want.

        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        63 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        54 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        61 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        48 views
        0 likes
        Last Post CarlTrading  
        Working...
        X