Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Short order not firing

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

    Short order not firing

    I have a simple code where I want to go short on 2 instruments at the start of session. Then cover the short on close. First short is getting submitted, but the 2nd one is not doing anything. (in Back test)

    **********************************
    protected override void Initialize()
    {
    Add(
    "FAZ", PeriodType.Minute, 1);
    CalculateOnBarClose =
    true;
    // Triggers the exit on close function 15 seconds prior to session end
    ExitOnClose = true;
    ExitOnCloseSeconds =
    15;
    }

    protected override void OnBarUpdate()
    {

    if (Bars.SessionBreak)
    {
    short1 = false;
    short2 = false;
    }


    if(BarsInProgress == 0 && !short1)
    {
    Print(Time[0].ToString() + "Entering FAS Short");
    entryOrder1 = EnterShort(0, 100, "FAS Short");
    Print(Time[0].ToString() + entryOrder1);
    short1 = true;
    }

    if(BarsInProgress == 1 && !short2)
    {
    Print(Time[0].ToString() + "Entering FAZ Short") ;
    entryOrder2 = EnterShort(1, 100, "FAZ Short");
    Print(Time[0].ToString() + entryOrder2);
    short2 = true;
    }
    }

    }
    }
    **************************************

    This is the out put -
    9/11/2009 6:32:00 AM Entering FAS Short
    9/11/2009 6:32:00 AM Order='NT-00000/Back101' Name='FAS Short' State=Working Instrument='FAS' Action=SellShort Limit price=0 Stop price=0 Quantity=100 Strategy='ShortBoth' Type=Market Tif=Gtc Oco='' Filled=0 Fill price=0 Token='dd581c614c594640be9564095f9fe9c1' Gtd='12/1/2099 12:00:00 AM'
    9/11/2009 6:32:00 AM Entering FAZ Short
    9/11/2009 6:32:00 AM

    As you can see the 2nd order shows null....

    #2
    Please ensure that when you run the strategy you actually increase the EntriesPerDirection setting before you start it.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Great. That fixed the issue. Thanks a lot.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cmoran13, Yesterday, 01:02 PM
      0 responses
      30 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      22 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      160 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      95 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      148 views
      2 likes
      Last Post CaptainJack  
      Working...
      X