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

Trying to draw vertical lines

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

    Trying to draw vertical lines

    I am trying to draw vertical lines at a certain interval starting from a certain bar.

    The 1st line in this section of the script works fine as long as the other 3 lines are not present.

    The 2nd line here is the calculation of the interval or the distance to the next bar in the future. I understand that we cant draw past the current bar but in this case we are not there yet and it still wont work.

    I would appreciate some help please



    DrawVerticalLine("Angle1",startBarsAgo,Color.Red,DashStyle.Dash,3);
    double i = Math.Round((Math.Sqrt(open))*(60/(360/angle))/Bars.Period.Value);
    int j = (int)i + startBarsAgo;

    DrawVerticalLine(
    "Angle2", j ,Color.Red,DashStyle.Dash,2);

    #2
    Someone will follow up on Monday.
    RayNinjaTrader Customer Service

    Comment


      #3
      richbois,

      What behavior are you seeing for the second line? I suggest you print out the "j" variable to see what it is evaluated as to determine where it should draw the line.
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Fran888, 02-16-2024, 10:48 AM
      3 responses
      44 views
      0 likes
      Last Post Sam2515
      by Sam2515
       
      Started by martin70, 03-24-2023, 04:58 AM
      15 responses
      114 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by The_Sec, Today, 02:29 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by jeronymite, 04-12-2024, 04:26 PM
      2 responses
      31 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by Mindset, 05-06-2023, 09:03 PM
      10 responses
      265 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X