Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compare Current Bars Price to SMA

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

    Compare Current Bars Price to SMA

    What's the syntax for something like this?:

    If the current bar's price <= to the Simple Moving Average, enter a long position


    I don't want to wait for the bar to close to place the order and I only want 1 position at a time.

    Thanks!

    #2
    Hello,

    Try something like this:

    if(GetCurrentAsk() <= SMA(10)[0])
    {
    //order here
    }

    These links may help:


    DenNinjaTrader Customer Service

    Comment


      #3
      Thanks

      Thanks for the quick turnaround! I also discovered the Strategy Wizard and that helped a lot.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      635 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
      106 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
      571 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X