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 argusthome, Yesterday, 10:06 AM
      0 responses
      17 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      16 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      14 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      9 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      36 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X