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 Ray based on time anchor points

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

    Draw Ray based on time anchor points

    Hi
    I am trying to create an IRay object but instead of using bars ago as x-axis points I need to use two time points. I see this could be possible from the help guide.

    What I have at the moment is :
    IRay ray = DrawRay("lows", time1, price1,time2, price2,Color.LimeGreen);

    For argument 2 and 4 it gives me the following error:

    "cannot convert from 'System.DateTime' to 'int'"

    so it looks like it is still looking for the bars ago.

    Could you perhaps let me know what tweaks I need to make to get it to work?

    Thanks very much in advance

    #2
    Hello fevs7,

    The syntax for the DrawRay that takes DateTime anchor points, takes 9 parameters.

    You should use the following syntax, passing values for all parameters below.
    Code:
    DrawRay(string tag, bool autoScale, DateTime anchor1Time, double anchor1Y, DateTime anchor2Time, double anchor2Y, Color color, DashStyle dashStyle, intwidth)
    You are passing 6 parameters, which would use the syntax that takes barsago for anchor points. You would need to add, bool autoScale, DashStyle dashStyle, and intwidth to your DrawRay method.

    See DrawRay section of our helpguide,


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,789 views
    0 likes
    Last Post aligator  
    Started by Jimmyk, 01-26-2018, 05:19 AM
    6 responses
    837 views
    0 likes
    Last Post emuns
    by emuns
     
    Started by jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,293 views
    1 like
    Last Post jgualdronc  
    Started by Touch-Ups, Today, 10:36 AM
    0 responses
    13 views
    0 likes
    Last Post Touch-Ups  
    Started by geddyisodin, 04-25-2024, 05:20 AM
    11 responses
    63 views
    0 likes
    Last Post halgo_boulder  
    Working...
    X