Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enter long and short orders for multiple instruments in a single strategy

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

    Enter long and short orders for multiple instruments in a single strategy

    Hi there. I'm having some difficultly trying to implement an idea. Basically I've added over 100 ETF Instruments in my strategy. What I'm looking to do is every 5 bars or so:

    -Run calculations on all instruments in the strategy
    -Buy the top 5 instruments
    -Short the bottom 5 instruments

    For some reason, I get long 1 instrument and short 1 instrument, but I can't get long or short the 5 instruments.

    I am using the method call

    IOrder order = EnterLong(key, tradeSize, entrySignal);

    where:
    -key is the index value in the BarsArray
    -tradeSize is = 1
    -entrySignal = "ETF" + key + "-" + CurrentBar

    So the first one works, but in Visual Studio I can see that every method call to EnterLong after that returns null. Any ideas why?

    #2
    Sigh.... so after posting I remembered I can set TraceOrders to true and then was able to see that my EntriesPerDirection was equal to 1. After setting EntryHandling to UniqueEntries, it is now working.

    My apologies. Please feel free to bill me for my waste of bandwidth. :-)

    Comment


      #3
      No worries, great to hear it works for you now. All the best.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      55 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      142 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      160 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      96 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      276 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X