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 Stanfillirenfro, Today, 07:23 AM
      6 responses
      21 views
      0 likes
      Last Post Stanfillirenfro  
      Started by navyguy06, Today, 09:28 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by DayTradingDEMON, Today, 09:28 AM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      8 responses
      31 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by helpwanted, Today, 03:06 AM
      2 responses
      22 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X