Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Edit @Indicator

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

    Edit @Indicator

    How do I open the @Indicator.cs file in the NinjaScript Editor?

    #2
    Hello wbennettjr,

    Thank you for writing in. You should not be modifying the @Indicator.cs file. Could you please let me know why you are trying to open it in the editor? If you need a partial class, you will want to write a partial class and place it in the Add Ons folder (to prevent the NinjaScript generated code from triggering).

    Thank you in advance.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      In NT7, I modified UserDefinedMethods to add properties and methods that I wanted available on all indicators. If I understand correctly, you're saying this should work if I add these properties and methods in a partial Indicator class in the Add Ons folder?

      Comment


        #4
        Hello wbennettjr,

        This is correct. By placing the file inside the AddOns folder, it will not automatically generate the NinjaScript code like what would happen if you placed it inside the Indicators or Strategies folder. For example:
        Code:
        namespace NinjaTrader.NinjaScript.Indicators
        {
        	partial class MyClass : Indicator
        	{
        		public void doSomething()
        		{
        			
        		}
        	}
        }
        Please let me know if I may be of further assistance.
        Michael M.NinjaTrader Quality Assurance

        Comment


          #5
          That's not exactly what I needed. What I want is:

          Code:
           
           public partial class [B][COLOR=blue]Indicator[/COLOR][/B] : IndicatorRenderBase
           {
               public int SomeValue { get; set; }
            
               public void SomeMethod()
               {
               }
           }
          Tried it and it works like a charm.

          Thanks!

          Comment


            #6
            Hello wbennettjr,

            Thank you for the update. I am glad to hear you were able to reach a resolution.

            Please let me know if I may be of further assistance anytime.
            Michael M.NinjaTrader Quality Assurance

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by burtoninlondon, Today, 12:38 AM
            0 responses
            5 views
            0 likes
            Last Post burtoninlondon  
            Started by AaronKoRn, Yesterday, 09:49 PM
            0 responses
            14 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Yesterday, 08:42 PM
            0 responses
            11 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Yesterday, 07:51 PM
            0 responses
            13 views
            0 likes
            Last Post strategist007  
            Started by StockTrader88, 03-06-2021, 08:58 AM
            44 responses
            3,983 views
            3 likes
            Last Post jhudas88  
            Working...
            X