Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ChartControl/ChartBars access?

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

    ChartControl/ChartBars access?

    I am finding that access to the ChartControl and ChartBars object is different in NT 8 than 7.
    It appears that they are available to an indicator in OnStateChange=Historical when the indicator
    is loaded by itself on a chart.

    However, when that same indicator is loaded from a strategy, ChartControl and ChartBars are null.
    I think this is a bug (unless you have changed the rules for NT 8 on how/when they can be accessed).

    Please explain(document) the rules on when these objects can be safely and consistently accessed.

    To demonstrate this issue:
    Put the attached indicator(GTestChartControlAccess) on a chart with output window open.
    You will see one set of answers.
    Remove the indicator.
    Load the strategy(GTestStrategyUsingIndicator) on the same chart (which calls AddChartIndicator on the indicator)
    and you will see different output.


    Thanks,
    Gary
    Attached Files

    #2
    Originally posted by ElectronicLocal View Post
    I am finding that access to the ChartControl and ChartBars object is different in NT 8 than 7.
    It appears that they are available to an indicator in OnStateChange=Historical when the indicator
    is loaded by itself on a chart.

    However, when that same indicator is loaded from a strategy, ChartControl and ChartBars are null.
    I think this is a bug (unless you have changed the rules for NT 8 on how/when they can be accessed).

    Please explain(document) the rules on when these objects can be safely and consistently accessed.

    To demonstrate this issue:
    Put the attached indicator(GTestChartControlAccess) on a chart with output window open.
    You will see one set of answers.
    Remove the indicator.
    Load the strategy(GTestStrategyUsingIndicator) on the same chart (which calls AddChartIndicator on the indicator)
    and you will see different output.


    Thanks,
    Gary
    It was no different in NT7. You had to check for a null reference, so that you could escape it if you called the indicator from another class.

    We found this out when we a had customer came across it while testing the Osi_Ichimoku package. Look at the changelog entry, Osi_Ichimoku v1.21 modified Nov. 10, 2014, on this page: http://omegasigmaindicators.com/upda...okuupdate.html
    Attached Files
    Last edited by koganam; 07-26-2015, 12:52 PM. Reason: Corrected grammar.

    Comment


      #3
      Thank you for the answer koganam,

      This would be correct, the state can be null depending on how it was loaded. In a strategy states will report null as it is a different way of loading the indicator.

      There will be more documentation on this coming in the future to explain the state changes and processing in more detail.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,280 views
      0 likes
      Last Post Leafcutter  
      Started by WHICKED, Today, 12:45 PM
      2 responses
      19 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Tim-c, Today, 02:10 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      5 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      52 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Working...
      X