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 Waxavi, Today, 02:10 AM
      0 responses
      2 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by TradeForge, Today, 02:09 AM
      0 responses
      2 views
      0 likes
      Last Post TradeForge  
      Started by Waxavi, Today, 02:00 AM
      0 responses
      2 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by elirion, Today, 01:36 AM
      0 responses
      4 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by gentlebenthebear, Today, 01:30 AM
      0 responses
      4 views
      0 likes
      Last Post gentlebenthebear  
      Working...
      X