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 elirion, Today, 01:36 AM
    0 responses
    3 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by gentlebenthebear, Today, 01:30 AM
    0 responses
    4 views
    0 likes
    Last Post gentlebenthebear  
    Started by samish18, Yesterday, 08:31 AM
    2 responses
    9 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by Mestor, 03-10-2023, 01:50 AM
    16 responses
    389 views
    0 likes
    Last Post z.franck  
    Started by rtwave, 04-12-2024, 09:30 AM
    4 responses
    34 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Working...
    X