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.

    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?

        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 AttiM, 02-14-2024, 05:20 PM
            11 responses
            184 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by fernandobr, Today, 09:11 AM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by timmbbo, Today, 08:59 AM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by KennyK, 05-29-2017, 02:02 AM
            2 responses
            1,281 views
            0 likes
            Last Post marcus2300  
            Started by itrader46, Today, 09:04 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Working...
            X