Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi entries

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

    Multi entries

    This only puts in an order for 2 contracts and ignores the second order for 1 more. Here is a snipit of the code.. Must be something else I have to do?

    protected override void Initialize()
    {
    CalculateOnBarClose = true;
    TraceOrders = true;
    EntriesPerDirection = 3;
    EntryHandling = EntryHandling.UniqueEntries;
    }

    protected override void OnBarUpdate()
    {
    entryOrder = EnterLongLimit(0,true,2, Close[1] , "Enter Long");
    EnterLongLimit(0,true,1, Close[1] , "Enter Long Trail");
    }

    #2
    Hello gg80108,

    I'm using your code and it's submitting both orders. Add TraceOrders = true; to your initialize statement to see what might be going on.

    One thing you could change is EntriesPerDirection set to 1. It will then submit 1 entry for each unique rule. It might make debugging easier.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ok got all 3 entries now,,
      Here is my second issue.. I named the entries two different names so I could manage them separately,, and I can see different tokens for each entry order.. When the first profit target is hit all ( 2 contracts and for 1 contract) of the stop orders are being cancelled , which is not good. since I still have one long position, the target order for the 1 contract trail also cancels.. I need the "trail" orders for the trail position to to still be there..

      Here is a snipit: (this fires ok and places the orders)
      protected override void OnOrderUpdate(IOrder order)
      {
      if (entryOrder != null && entryOrder.Token == order.Token)
      {
      Print( "*****" + order.ToString());
      Print("Primary position is " + Position.MarketPosition);
      Print("OrderState is " + order.OrderState + entryOrder);

      if (order.OrderState == OrderState.Filled)
      {
      //stops for long
      ExitLongStop(0,true,2,entryprice - 12 * TickSize, "IO1", "Enter Long");//
      ExitLongStop(0,true,1,entryprice - 12 * TickSize, "IO1", "Enter Long Trail");
      // profit targets for longs
      ExitLongLimit(0,true,2,entryprice + 9 * TickSize, "IT2", "Enter Long");
      ExitLongLimit(0,true,1,entryprice + 19 * TickSize, "IT3", "Enter Long Trail");
      }

      Comment


        #4
        Hello gg88018,

        There is a known issue in this area, related to scaling out positions. This issue can be seen with version 6.5 but has been fixed with version 7. Please email [email protected] for a beta download.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X