Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug causes NT8 B6 to crash when opening indicators in a chart

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

    Bug causes NT8 B6 to crash when opening indicators in a chart

    I found this bug when opening the indicators window in a chart. It seems that a few of my custom indicators used the format:

    bwCombo().Calculate = Calculate.OnPriceChange;

    (in the SetDefaults code of OnStatChange)

    to set Calculate to OnPriceChange for the indicator bwCombo. This compiles without issue, but caused NT8 to crash if open the indicator dialog in a chart.

    Changing the code to the below fixes the issue.

    Calculate = Calculate.OnBarClose;

    Please let me know if any further details are needed.
    daqu40
    NinjaTrader Ecosystem Vendor - QTradez

    #2
    Hello,

    Thank you for reporting this to us. When you set the property the first way, was bwCombo the name of the indicator you were working with, or was bwCombo being hosted within a second indicator? In other words, were you trying to set the Calculate property for the indicator in question, or for a separate indicator being added in code?
    Last edited by NinjaTrader_DaveI; 11-02-2015, 04:10 PM.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      bwCombo is the name of the indicator. This was probably a poor example as it does use other indicators. However as proof I had several custom indicators that each caused the crash due to the format indicatorname().Calculate = Calculate.OnPriceChange; until I fixed them.
      daqu40
      NinjaTrader Ecosystem Vendor - QTradez

      Comment


        #4
        Hello daqu40,

        The proper method of specifying an indicator's Calculate property is just by specifying Calculate in State.SetDefaults rather than IndicatorName().Calculate.

        So:
        Code:
        // indicator's name is TheIndicator in this example
        
        if (State == State.SetDefaults)
        {
             Calculate = Calculate.OnPriceChange; // proper
             TheIndicator().Calculate = Calculate.OnPriceChange // improper
        }
        More information about Calculate can be found here: http://ninjatrader.com/support/helpG...?calculate.htm

        Please, let us know if we may be of further assistance.
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          You got it.

          The incorrect code was created by the NT7 to NT8 conversion and the NT8 compiler accepted it.
          daqu40
          NinjaTrader Ecosystem Vendor - QTradez

          Comment


            #6
            Hello daqu40,

            The recommended method of converting scripts from NinjaTrader 7 to NinjaTrader 8 would be utilizing the Code Breaking Changes from the NinjaTrader 8 help guide to manually convert scripts over: http://ninjatrader.com/support/helpG...ng_changes.htm

            There are no official automated code converters for NinjaTrader 8. The incorrect syntax generated by the converter causes a stack overflow exception.
            Zachary G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by mattbsea, Today, 05:44 PM
            0 responses
            3 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            31 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            2 views
            0 likes
            Last Post tkaboris  
            Started by GussJ, 03-04-2020, 03:11 PM
            16 responses
            3,282 views
            0 likes
            Last Post Leafcutter  
            Started by WHICKED, Today, 12:45 PM
            2 responses
            20 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Working...
            X