Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

simple indicator

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

    simple indicator

    Good morning, I need to create a simple indicator to draw a dot if six consecutive closing prices are higher / lower than the previous bar.

    can you give me a few pointers to create this indi??

    Thx

    #2
    Hello futuros,

    Thanks for your post.

    I would suggest using the Ninjascript wizard to create the indicator framework. Please see the help guide here: https://ninjatrader.com/support/help...?ns_wizard.htm

    Once you have run through the wizard, it will leave the code open in the Ninjascript editor.

    In the OnBarUpdate() you would need to create your logic for the 6 consecutive closes and when true, you can use the Draw.Dot() method: https://ninjatrader.com/support/help.../?draw_dot.htm

    Because you are looking at the last 6 bars at any time, you need to prevent a bar access error at the beginning of your code by preventing your code from running until it has loaded at least 6 bars (this is not the same as bars on the chart) You can do this by checking if the system bar counter (CurrentBar) is less than 6, like this:

    if (CurrentBar < 6) return; // do not process below this code line until 6 bars loaded.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    599 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    344 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    558 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    557 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X