Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Help Painting in Bar

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

    Help Painting in Bar

    Hey Guys, I'm new to Ninja so please excuse me if this is a newbie question. I've switched over from TradeStation where I was used to easylanguage so I'm just getting aquainted with ninjascripts.

    Please see the attached photo for what I am looking for interms of coding help.

    As you can see I've managed to get my indicator to plot the high and the low of the calculated formula. The white dot is the high and the red is the low. But what I'd like to see is a line (a bar) that is similar to price's OHLC bar, one that's pained in solid in the entire range. I'd also like to add a Close to this bar if possible.
    Is this possible in Ninja?
    Here's what I've got to plot the High:
    Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Dot, "Hi"));

    And then Hi.set to finish it off.

    Any help would be appreciated.
    Thanks
    JJ
    Attached Files

    #2
    Off the top of my head, you likely will want to use the DrawVerticalLine() method.



    You could play around with other drawing methods to try and get some marker for the close price. If you plan on have individual lines for each bar, keep in mind that managing many draw objects can become performance intensive. You may consider limiting how many lines are drawn such as --> Only draw lines on the last 200 bars etc...
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks for the pointer.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Belfortbucks, Today, 09:29 PM
      0 responses
      6 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      151 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      6 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Working...
      X