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

How to Plot a Dot 50 BarsAgo

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

    How to Plot a Dot 50 BarsAgo

    I’m new to NT & haven’t done any programming for a long time. Any assistance would be greatly appreciated on how to get a Dot plot on a chart 50bars ago. I’ve searched the forum & below is the best bit of code I’ve been able to come up with so far - which still only puts a dot below the most recently completed bar instead of 50 bars ago.

    {
    DrawDot("tag1", 50, Low[50] - TickSize, Color.Red);
    }


    From the draw DrawDot reference Page I thought putting 50, Low[50] would move the Dot back 50 bars but that doesn’t it.


    I also tried: DrawDot(CurentBar.ToString() +"tag1", 0, - TickSize, Colre.Red); which put a dot under every bar.

    (I won’t mention all the many other things I tried that didn’t work )

    Thanks for any suggestions.

    Rob.

    #2
    That will work. Make sure you do something more like:

    if (CurrentBar > 50)
    DrawDot("Tag1", 50, Low[50], Color.Red);
    RayNinjaTrader Customer Service

    Comment


      #3
      Adding the "If (CurrentBar > 50)" makes it work fine.

      Thanks for the quick reply Ray,

      Rob

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,610 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      9 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      19 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      6 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      16 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X