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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X