• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Analyzer script name

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

    Market Analyzer script name

    Hello all,
    I have hard problem and I spent a lot of hours trying to resolve it. But without success Will you be so kind and try to help me somehow ?

    I have script for Market Analyzer, it shows what I need. But I need to show user-friendly name for this one in Columns window. I do that within Initialize() method.

    protected override void Initialize()
    {
    Name = "Trending Slope";
    }

    It works great for Indicators. It works for Market Analyzer too, but when I try to add next script again (use it moretimes - multiply), It has the same Name and it probably causes Market Analyzer stop working. OK Button of MA doesnt work any more. If I remove "Name = ..." row from code, everything starts working. So there is some problem with the same name.
    I have some 3d-party Columns which uses user-friendly name as well and they have no problem if I use it more times.
    Do U know how to solve it ? Any trick ??
    Thank you very much.
    Regards,
    Alex

    #2
    Hello Alexik30,

    Thank you for your post.

    May we test the script on our end. If so please attach the script to your response.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Hello Patrick,
      thank you very much for your answer. It is too complicated to post everythnig to my script. But you can try this easy code TestMA.cs:

      namespace NinjaTrader.MarketAnalyzer
      {
      public class TestMA : NinjaTrader.MarketAnalyzer.ColumnBase
      {
      protected override void Initialize()
      {
      CalculateOnBarCloseConfigurable = false;
      DataType = typeof(string);
      RequiresBars = false;
      Name = "* Trending Slope";
      }

      protected override void OnMarketData(MarketDataEventArgs e)
      {
      if (e.MarketDataType != MarketDataType.Last)
      return;

      Text = "Test: "+e.Time;
      }


      }
      }

      Alex

      Comment


        #4
        Hello Alexik30,

        Thank you for your response.
        The Market Analyzer will attempt to rename the Name if there are multiple columns of the same type and Name, but as we then set the Name in Initialize() it then overrides this and causing the following exception in the trace:
        Item has already been added. Key in dictionary: ' Trending Slope' Key being added: ' Trending Slope'
        What are you attempting to do? Make all duplicate column names the same name?
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Hello Patrick,
          Im attempting to do similar like on attached pic (in red circle). There are some Columns like "(c) Custom levels" with this Name. I can use them miltuple with no problem. They have different column head names in MA Window like:
          "(c) Custom levels", "(c) Custom levels_1", "(c) Custom levels_2"...
          But I dont know how to change my class name to "user-friendly" like Trending Slope as I send before.



          http://prntscr.com/chrsko

          If Im able to find if my Name already exists in collection of Names, I can add "_number" to it. Or overwrite Name property within different method - not witin Initialize.

          Comment


            #6
            Hello Patrick,

            issue resolved !!

            I set the Name within column class constructor (not in Initialize) and everything works great !
            Thank you for your assistance !

            Alex

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Oracletrades, Yesterday, 02:56 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Bbrandon5567, Today, 04:56 PM
            1 response
            5 views
            0 likes
            Last Post Bbrandon5567  
            Started by NeverDownMoney, Today, 11:05 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by NeverDownMoney, Today, 12:19 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by pstrusi, Today, 04:30 PM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Working...
            X