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.ArrowLine

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

    Draw.ArrowLine

    Hi, I have a function which draws an arrow in left top corner of chart
    Code:
    barsPainted = ChartBars.ToIndex - ChartBars.FromIndex;
    height = chartScale.Height/16;
    width = chartScale.Width/32;
    
    Draw.ArrowLine(this, "myArrow", CurrentBar-ChartBars.FromIndex-(barsPainted/32), chartScale.GetValueByY((float)(height+height/64)), CurrentBar-ChartBars.FromIndex-(barsPainted/32), chartScale.GetValueByY((float)(height+height*2)), Brushes.Red,DashStyleHelper.Solid, 7);
    On my first PC it works perfectly but on my second PC it throws an "object reference not set to an instance of an object". I can't find why does this exception occures only o second PC.

    Update: PC which does not work has windows 7 OS

    Update 2: Error looks like: "Error on calling 'OnRender' method on bar 5546: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart."
    while currentBar = 5545, why does OnRender method trying to recive non exist bar
    Last edited by dv926844; 05-25-2017, 04:04 AM. Reason: Investigation

    #2
    What is the OS on the working version ?
    Not that this has fixed it in my Case but Have you updated your video
    card drivers on the Win7 version ?

    Comment


      #3
      Hello dv926844,

      Could you please send an email to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and attach the log and trace files for the day in subject which you can find in My Documents>NinjaTrader8>Log and My Documents>NinjaTrader8/Trace folders.

      I look forward to your email.
      Alan P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by briansaul, Today, 05:31 AM
      0 responses
      1 view
      0 likes
      Last Post briansaul  
      Started by fwendolynlpxz, Today, 05:19 AM
      0 responses
      4 views
      0 likes
      Last Post fwendolynlpxz  
      Started by traderqz, Yesterday, 12:06 AM
      11 responses
      28 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by PaulMohn, Today, 03:49 AM
      0 responses
      8 views
      0 likes
      Last Post PaulMohn  
      Started by inanazsocial, Today, 01:15 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Jason  
      Working...
      X