Announcement

Collapse
No announcement yet.

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 sjsj2732, 03-23-2026, 04:31 AM
    0 responses
    77 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    313 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    314 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    149 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    114 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X