Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stragegy Fails to Enter Multiple Orders

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

    Stragegy Fails to Enter Multiple Orders

    I generated a strategy using strategy wizard and am having problems with entering multiple orders in the same direction. It enters the first order, but not the second order in the same direction. I have tried setting the
    Entries per Direction to 2, but this didn't help. I tried submitting my all of code but it complained that my post was too long.

    Any help with this would be appreciated.

    Double Bogie

    // Condition set 1
    if (Variable0 == 1
    && Close[0] < Variable1)
    {
    EnterLong(
    100, "AgLong");
    Variable0 =
    2;
    Variable1 = Close[
    0];
    }
    // Condition set 2
    if (Close[0] > SMA(LongMA)[0]
    && Close[
    0] < SMA(ShortMA)[0]
    && Variable0 ==
    0)
    {
    EnterLong(
    100, "LongEn");
    Variable0 =
    1;
    }
    // Condition set 3
    if (Variable0 >= 1
    && Close[0] > SMA(ShortMA)[0])
    {
    ExitLong(
    "LongEx", "");
    Variable0 =
    0;
    }

    #2
    Found Problem

    Sorry but I found my problem. It was in the coding of vairables.

    Thanks
    Double Bogie

    Comment


      #3
      Hi Double Bogie,

      From your logic, I don't see how you could ever get a second entry...

      If set one is executed first, Variable0 == 2, so the conditions for neither set one or set two can be met.

      If set two is executed first, Variable0 == 1, set one may occur once more, but then no other set will occur until exit.

      You can use Print()'s to ensure you conditions are being met.
      More info at - http://www.ninjatrader.com/support/f...ead.php?t=3418
      TimNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      647 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X