Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT 7 MA is broken and crashes NT

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

    NT 7 MA is broken and crashes NT

    The ability to create your own column in MA vanished with NT 7.

    OnBarUpdate seems not firing anymore.
    RequiresBars = true; - crashes NT


    using System;
    using System.ComponentModel;

    namespace NinjaTrader.MarketAnalyzer
    {
    [Description("")]
    [Gui.Design.DisplayName(" ABC")]

    public class VolatilityMa : Column
    {
    private int period = 14;

    ///<summary>
    ///</summary>
    [Description("Numbers of bars used for calculations")]
    [Category("Parameters")]
    public int SMAPeriod
    {
    get { return period; }
    set { period = Math.Max(1, value); }
    }

    protected override void Initialize()
    {
    RequiresBars = true;
    }

    protected override void OnBarUpdate()
    {
    Value = SMA(SMAPeriod)[0];
    }

    }
    }The above code is stripped down to minimum and crashes NT
    Attached Files

    #2
    oops!, we will attempt reproducing here, however creating custom columns for the MA would not be supported and for proper working example please take a look into the default ones used (MyDocuments\NinjaTrader 7\bin\Custom\MarketAnalyzer).

    Thanks,

    Comment


      #3
      Any feedback on the issue?

      Comment


        #4
        I have a MA column with

        protectedoverridevoid Initialize()
        {
        DataType =
        typeof(string);
        RequiresBars =
        true;
        ShowInTotalRow =
        false;


        and it does not crash.

        Try setting the DataType to string. It could be that other DataTypes could crash MA.

        regards

        andreas , www.zweisteintrading.eu


        Comment


          #5
          Originally posted by oops! View Post
          Any feedback on the issue?
          I don't need string. I need double

          Comment


            #6
            Don't worry,

            I will not reply any more to threads

            andreas

            Comment


              #7
              Originally posted by zweistein View Post
              Don't worry,

              I will not reply any more to threads

              andreas
              What does that mean? Have I offended you in someway?

              Comment


                #8
                oops!, sorry for the late update - works for me without issues here when formatting the return as string -

                protected override string Format(double value)
                {
                return Instrument.MasterInstrument.FormatPrice(value);
                }

                Comment


                  #9
                  I am still having issues: the trace file entry:

                  2010-12-28 06:52:41:663 in OnUnhandledApplicationException
                  2010-12-28 06:52:41:671 ********* exception trapped *********
                  2010-12-28 06:52:41:671 Index and length must refer to a location within the string.
                  Parameter name: length
                  2010-12-28 06:52:41:671 System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
                  Parameter name: length
                  at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
                  at NinjaTrader.MarketAnalyzer.UI.MarketAnalyzerContro l.LoadBarsInWorkerThread(Object state)
                  at System.Threading._ThreadPoolWaitCallback.WaitCallb ack_Context(Object state)
                  at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
                  at System.Threading._ThreadPoolWaitCallback.PerformWa itCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
                  at System.Threading._ThreadPoolWaitCallback.PerformWa itCallback(Object state)
                  2010-12-28 06:52:41:896 in OnUnhandledApplicationException
                  2010-12-28 06:52:41:897 ********* exception trapped *********
                  2010-12-28 06:52:41:897 Index and length must refer to a location within the string.
                  Parameter name: length
                  2010-12-28 06:52:41:897 System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
                  Parameter name: length
                  at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
                  at NinjaTrader.MarketAnalyzer.UI.MarketAnalyzerContro l.LoadBarsInWorkerThread(Object state)
                  at System.Threading._ThreadPoolWaitCallback.WaitCallb ack_Context(Object state)
                  at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
                  at System.Threading._ThreadPoolWaitCallback.PerformWa itCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
                  at System.Threading._ThreadPoolWaitCallback.PerformWa itCallback(Object state)

                  Comment


                    #10
                    I'm not sure I follow you - are you able to reproduce this issue? If yes, which exact code would you use?

                    Thanks

                    Comment


                      #11
                      Originally posted by NinjaTrader_Bertrand View Post
                      I'm not sure I follow you - are you able to reproduce this issue? If yes, which exact code would you use?

                      Thanks
                      The attached code crashes every single time
                      Thanks for looking into the issue.
                      Attached Files

                      Comment


                        #12
                        Unfortunately I'm not able to reproduce the issue here on my end - which NT7 version (R1?) are you working with?

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by argusthome, 03-08-2026, 10:06 AM
                        0 responses
                        79 views
                        0 likes
                        Last Post argusthome  
                        Started by NabilKhattabi, 03-06-2026, 11:18 AM
                        0 responses
                        45 views
                        0 likes
                        Last Post NabilKhattabi  
                        Started by Deep42, 03-06-2026, 12:28 AM
                        0 responses
                        29 views
                        0 likes
                        Last Post Deep42
                        by Deep42
                         
                        Started by TheRealMorford, 03-05-2026, 06:15 PM
                        0 responses
                        32 views
                        0 likes
                        Last Post TheRealMorford  
                        Started by Mindset, 02-28-2026, 06:16 AM
                        0 responses
                        66 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Working...
                        X