Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No trades

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

    No trades

    If I use this code the strategy places a trade.
    Code:
            protected override void OnBarUpdate()
            {
               if (ParabolicSAR(0.02, 0.2, 0.02)[1] > Close[1]
                    && ParabolicSAR(0.02, 0.2, 0.02)[0] < Close[0]
                    && Position.MarketPosition == MarketPosition.Flat)
                {
                    EnterLong(Lots, "");
                }
            }
    If I use this code, no trades enter. What's wrong here?
    Code:
    protected override void OnBarUpdate()
            {
                double atr, stop;
                
                if (ParabolicSAR(0.02, 0.2, 0.02)[1] > Close[1]
                    && ParabolicSAR(0.02, 0.2, 0.02)[0] < Close[0]
                    && Position.MarketPosition == MarketPosition.Flat)
                {
                    EnterLong(Lots, "");
                    sdev = CalculateSDev(SDEV_LOOKBACK);
                    atr = ATR(14)[1] * ATR_MULTIPLIER;
                    stop = Close[0] - atr;
                 }
              }

    #2
    I suggest you check the Control Center log for errors. Please try using TraceOrders = true also to see what is happening with your orders.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks - it was a minbarsback issue.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      649 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      576 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X