Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New Programmer, Plotting highs and lows

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

    New Programmer, Plotting highs and lows

    I an new to coding and looking for the best way to plot highs and lows on an intraday chart.

    Is something like this OK


    if (HighestBar(DefaultInput, 30))
    {
    DrawDot("My dot" + CurrentBar, false, 0, 0, Color.Blue);
    }


    Thanks for any help.

    #2
    Hello,

    The code here is not incorrect but it might not be exactly what you want.

    The above will take the default input (typically this will be the closing price unless modified by the user) and find the largest value over the pats 30 bars. When it finds this it will draw a dot. Currently you're drawing dots at 0 on the Y axis so you'll likely want to change this so that it shows in the visible region.

    I think you'll also find that there are indicators out there that might already do what you're looking for.

    This isn't the best indicator to start out with if you're just learning but consider taking a look at the CurrentDayOHL indicator that comes installed with NinjaTrader (tools -> edit NinjaScript -> indicator -> CurrentDayOHL)

    We also have classes for learning NinjaScript here: http://www.ninjatrader.com/PremiumEducation.php
    If you have questions about these classes please send them into suppor at ninjatrader dot com

    Let me know if I can further assist.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Course looks great, just booked it.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      152 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      87 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      131 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      127 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      106 views
      0 likes
      Last Post CarlTrading  
      Working...
      X