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

Draw.VerticalLine by time

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

    Draw.VerticalLine by time

    Hi ... this may be simple to do but didn't see it in NT8 docs.

    I need to convert NT7 "DrawVerticalLine("this",xTime, Color.Red, DashStyle.DashDot, 1);" to it's NT8 equivalent.The line draws a vertical line based on a timestamp. Any guidance is appreciated. tx

    #2
    Hello pman777,

    Thanks for your post.

    There are a few key items to look for when converting your scripts from NinjaTrader 7 format to NinjaTrader 8, and we keep a Code Breaking Changes table updated in the NinjaTrader 8 Help Guide to assist in identifying changes or new implementations of familiar methods and properties from NinjaTrader 7: http://ninjatrader.com/support/helpG...ng_changes.htm

    Some notable items to consider when converting your code will be the following:

    Initialization has changed significantly. Initialize() has been replaced with OnStateChange(), which can be used to filter out different stages of the entire life cycle of a script (SetDefaults, Configure, Historical, Realtime, Terminated, etc.) OnStateChange() is fully covered in the Help Guide.

    The names of many methods and properties have changed slightly, so you will need to refactor these in your code. The Code Breaking Changes table can make this task much easier, and there is also an alphabetical reference in the Help Guide that can help to find new method/property names: http://ninjatrader.com/support/helpG..._reference.htm

    In numerous instances, you now have direct access to objects, where in NinjaTrader 7 you had to work with interfaces. For example, rather than the IOrder interface, you now have direct access to an Order object and its related fields. This will require a change in the way items like this are handled in your code.
    As always, we are more than happy to help out with tips and advice in this area, although we do not offer full script conversion services.

    Here is a link to the helpguide for Draw.VerticalLine(): https://ninjatrader.com/support/help...rticalline.htm

    In taking a quick look at the NT8 indicators file sharing forum, it appears this has already been converted: https://ninjatrader.com/support/foru...d=7&linkid=888

    In addition, another indicator that can also perform the same (and more) is: https://ninjatrader.com/support/foru...d=7&linkid=680
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Draw.VerticalLine(this,"tagName",Time[0],Brushes.Red,DashStyleHelper.Dash,3,true);

      here is the basics where time[0] is there are other options

      NT8 uses Brushes.Red vs NT7 uses Color.Red

      DashStyle NT7
      DashStyleHelper NT8

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kevinenergy, 02-17-2023, 12:42 PM
      115 responses
      2,699 views
      1 like
      Last Post kevinenergy  
      Started by prdecast, Today, 06:07 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Christopher_R, Today, 12:29 AM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by chartchart, 05-19-2021, 04:14 PM
      3 responses
      577 views
      1 like
      Last Post NinjaTrader_Gaby  
      Started by bsbisme, Yesterday, 02:08 PM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X