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,
    BertrandNinjaTrader Customer Service

    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);
                }
                BertrandNinjaTrader Customer Service

                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
                    BertrandNinjaTrader Customer Service

                    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?
                        BertrandNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by bmartz, 03-12-2024, 06:12 AM
                        4 responses
                        31 views
                        0 likes
                        Last Post bmartz
                        by bmartz
                         
                        Started by Aviram Y, Today, 05:29 AM
                        4 responses
                        12 views
                        0 likes
                        Last Post Aviram Y  
                        Started by algospoke, 04-17-2024, 06:40 PM
                        3 responses
                        28 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by gentlebenthebear, Today, 01:30 AM
                        1 response
                        8 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by cls71, Today, 04:45 AM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Working...
                        X