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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      66 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X