• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawLine using DateTime

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

    DrawLine using DateTime

    I used the sample code below expecting to get two 'draw lines' on the chart, one in blue at the Low and one in Black at the high. I did not get that.....(not sure what is wrong). I attached the screengrab, which shows the Blue line drawn using barsago, but no black line using DateTime.


    PHP Code:

    private DateTime    holdDT    =    new DateTime();

    protected 
    override void OnBarUpdate()
    {
        if (
    CurrentBar == Bars.Count 20)
            
    holdDT Time[0];
                
        if (
    CurrentBar == Bars.Count 3)
        {
                
    int wwBackBarNum ChartBars.GetBarIdxByTime(ChartControlholdDT);
                
    int myBarsAgo     CurrentBar wwBackBarNum;
                
    Draw.Line(this"bars"+CurrentBar,true,  myBarsAgo,   Low[0],      0,   Low[0], Brushes.Blue,   DashStyleHelper.Dash,4);    
                
    Draw.Line(this"time"+CurrentBar,true,     holdDT,  High[0], Time[0], High[0], Brushes.Black,  DashStyleHelper.Dash,4);    
        }

    Attached Files

    #2
    Hi photog53,

    Are you getting any errors in the Log tab of the Control Center?

    On the bar where the blue line is drawn, what is the value of holdDT?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi photog53,

      Are you noticing that the line sometimes appears when you hit F5?

      This may be reported issue #NTEIGHT-9581 'Draw objects not drawn initially when using overload that accepts DateTime'.

      This item has been corrected for NinjaTrader 8 Beta 11.

      Once Beta 11, is available for download, please update and test for this behavior once more.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Chelsea,
        No errors in the log.....
        The value of HoldDT was 13:20.... which the NT8 code "ChartBars.GetBarIdxByTime(ChartControl, holdDT);"
        found quite well but the Draw.Line code could not find.
        This issue also seems to be happening for Draw.Ray....and perhaps others.... which implicates the Issue you noted.

        Glad to see this will be corrected in beta 10.

        Thanks....

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by aaadetos, Today, 08:39 PM
        0 responses
        3 views
        0 likes
        Last Post aaadetos  
        Started by Teebone21, Today, 03:57 PM
        0 responses
        5 views
        0 likes
        Last Post Teebone21  
        Started by GeoOrtiz, Today, 03:44 PM
        0 responses
        7 views
        0 likes
        Last Post GeoOrtiz  
        Started by ralett, Today, 03:41 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Tyler  
        Started by Walker DM, Today, 03:14 PM
        2 responses
        12 views
        0 likes
        Last Post Walker DM  
        Working...
        X