• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Open Multiple Simultaneous Trades?

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

    Open Multiple Simultaneous Trades?

    Is there a way to open multiple simultaneous trades in NinjaTrader? I have a strategy that pulls in multiple instruments using the ADD method, and I would like to be able to open multiple trades simultaneously. Is this possible?

    Code:
    protectedoverridevoid Initialize()
    {
    Add("GOOG", PeriodType.Day, 1);
    Add("EBAY", PeriodType.Day, 1);
     
    CalculateOnBarClose = true;
    }
    protectedoverridevoid OnBarUpdate()
    {
    if (SMA(Close,10)[0] > SMA(Close,50)[0] && SMA(Close,10)[1] < SMA(Close,50)[1])
    {
    EnterLong();
    }
    if (SMA(Close,10)[0] < SMA(Close,50)[0] && SMA(Close,10)[1] > SMA(Close,50)[1])
    {
    ExitLong();
    }
    }
    
    This is an example of the code I am using to open positions, and it is only allowing one open position at a time.

    Thanks

    #2
    I found something called "EntriesPerDirection" that I was able to set to some arbitrarily high number to remove the limit on the number of simultaneous open orders. This appears to have done the trick!

    Comment


      #3
      Correct, great. It goes 'hand in hand' with http://www.ninjatrader.com/support/h...=EntryHandling
      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by GussJ, Today, 01:30 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by GARZONJ, Today, 12:25 PM
      3 responses
      13 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by RandanAL, Today, 11:53 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by yeshujbp, 07-21-2019, 02:40 PM
      2 responses
      35 views
      0 likes
      Last Post omololu
      by omololu
       
      Started by seagraph, Yesterday, 03:27 PM
      1 response
      28 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X