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 Segwin, 05-07-2018, 02:15 PM
      12 responses
      1,785 views
      0 likes
      Last Post Leafcutter  
      Started by poplagelu, Today, 05:00 AM
      0 responses
      3 views
      0 likes
      Last Post poplagelu  
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,407 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      98 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      8 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Working...
      X