Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Analyzer User Defined Methods

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

    Market Analyzer User Defined Methods

    I am trying to write several columns for the Market Analyzer that will print the date of various analysis events. I am finding this quite challenging, but I think not impossible. How do I create an analysis technique in the a Market Analyzer 'UserDefinedMethods' folder and then call it from a custom script in the Market Analyzer folder?

    #2
    Hello Hawk Arps,

    Thank you for your post.

    I would refer you to the documentation on User Defined Methods at the following link: http://ninjatrader.com/support/helpG...ed_methods.htm

    If you have any questions please let me know.

    Comment


      #3
      Thank you, PatrickH. However this doesn't seem to help me. I am coding in the MarketAnalyzer namespace because I cannot return dates to the MarketAnalyzer from the Indicator namespace (only numbers). Within the MarketAnalyzer namespace I am including the OnBarUpdate() method. Within that method I have:
      myValue=myMethod(input); where myMethod() is stored in the MarketAnalyzer/UserDefinedMethods folder. I get a compilation error stating "The name 'MyMethod' does not exist in the current context". My end goal is to identify a signal and print the date of that signal to the Market Analyzer.

      Comment


        #4
        Originally posted by Hawk Arps View Post
        Thank you, PatrickH. However this doesn't seem to help me. I am coding in the MarketAnalyzer namespace because I cannot return dates to the MarketAnalyzer from the Indicator namespace (only numbers). Within the MarketAnalyzer namespace I am including the OnBarUpdate() method. Within that method I have:
        myValue=myMethod(input); where myMethod() is stored in the MarketAnalyzer/UserDefinedMethods folder. I get a compilation error stating "The name 'MyMethod' does not exist in the current context". My end goal is to identify a signal and print the date of that signal to the Market Analyzer.
        You cannot declare a method directly in a namespace.

        ref: https://msdn.microsoft.com/en-us/lib...v=vs.120).aspx

        Comment


          #5
          Thank you PatrickH. If MyMethod() is declared in the MarketAnalyzer/UserDefinedMethods folder, how then, do I call it from an indicator coded in the MarketAnalyzer namespace?

          Comment


            #6
            Hello Hawk Arps,

            Thank you for your response.

            Here is a basic example:

            In your UserDefinedMethods:

            Code:
            namespace NinjaTrader.MarketAnalyzer
            {
                /// <summary>
                /// This file holds all user defined quoteboard column methods.
                /// </summary>
                partial class Column
                {
            		public void ShowPrint()
            		{
            			Print("User Defined Method called");
            		}
                }
            }
            In your custom column:
            Code:
            public class MyColumn : NinjaTrader.MarketAnalyzer.Column
            	{
            		/// <summary>
            		/// This method is used to configure the market analyzer column and is called once before any event mathod is called.
            		/// </summary>
            		protected override void Initialize()
            		{
            			CalculateOnBarCloseConfigurable	= false;
            			RequiresBars					= false;
            		}
            
            		/// <summary>
            		/// Called on each incoming market data tick.
            		/// </summary>
            		/// <param name="e"></param>
            		protected override void OnMarketData(MarketDataEventArgs e)
            		{
            			ShowPrint();
            		}

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by benmarkal, Yesterday, 12:52 PM
            3 responses
            23 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by helpwanted, Today, 03:06 AM
            1 response
            19 views
            0 likes
            Last Post sarafuenonly123  
            Started by Brevo, Today, 01:45 AM
            0 responses
            11 views
            0 likes
            Last Post Brevo
            by Brevo
             
            Started by pvincent, 06-23-2022, 12:53 PM
            14 responses
            244 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Working...
            X