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

ChartControl.GetXByTime() returns negative value

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

    ChartControl.GetXByTime() returns negative value

    Hi,

    I call ChartControl.GetXByTime() in an indicator. When the indicator is running on a chart with live data, the function call returns a negative value. I have the indicator calculated to update tick by tick (CalculateOnBarClose = false) and I use an index value of 1 to look one bar back.

    Has anyone seen this behavior and does anyone know of a fix?

    Thanks,

    Gordon

    #2
    Hello Gordon,

    As a heads up, ChartControl.GetXByTime() is not documented in the NinjaTrader help guide.

    If you are printing in OnBarUpdate and allowing for prints to be made historically, this will print for each historical bar on the chart (including the ones not visible to the left of the chart).

    For any bars that are to the left of the chart, these will have a negative value.

    For any bars visible on the chart, these will have a positive value.

    Are you viewing multiple prints?
    If so, are all of the prints producing negative values, or are the most recent prints at the bottom with positive values?
    Last edited by NinjaTrader_ChelseaB; 10-18-2016, 10:47 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thanks for your answer. I realized this was happening if the chart was minimized, and that makes sense. It was tough at first to see the connection and then it hit me. It appears the window can't be minimized and of course the bar referenced has to be visible on the chart (if the referenced bar has been scrolled out of view, then the x coordinate won't be on the visible chart either). Hopefully all of this will help someone down the road with the function and the values it returns.

      Regards,

      Gordon

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by algospoke, Today, 06:40 PM
      0 responses
      2 views
      0 likes
      Last Post algospoke  
      Started by maybeimnotrader, Today, 05:46 PM
      0 responses
      6 views
      0 likes
      Last Post maybeimnotrader  
      Started by quantismo, Today, 05:13 PM
      0 responses
      6 views
      0 likes
      Last Post quantismo  
      Started by AttiM, 02-14-2024, 05:20 PM
      8 responses
      168 views
      0 likes
      Last Post jeronymite  
      Started by cre8able, Today, 04:22 PM
      0 responses
      8 views
      0 likes
      Last Post cre8able  
      Working...
      X