Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Strategy name

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

    Strategy name

    Is there a way for my indicator/strategy to know their names? For example, if my strategy is called "MyCustomStrategy", I want to know it by code.

    Thanks

    #2
    Hello kiss987,

    Thanks for the question.

    I wanted to clarify with you, are you trying to make MyCustomStrategy so that an indicator can see this strategy?

    Or are you trying to access a indicator by name from the Strategy similar to how you would access any of the stock indicators from a strategy?

    If you are trying to accomplish the first option there is not really a documented way to do this.

    If you are trying to access a indicator by name from a strategy, you don’t have to do anything additional because as soon as you save the indicator it would be able to be called from another indicator or strategy.

    When you create a indicator you have this line of code at the top:
    Code:
    [Description("")]
        public class MyCustomIndicator: Indicator
        {
    By giving it a unique name "MyCustomIndicator" you could then call this from another indicator or strategy by using its name MyCustomIndicator() followed by ( )

    Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by kiss987 View Post
      Is there a way for my indicator/strategy to know their names? For example, if my strategy is called "MyCustomStrategy", I want to know it by code.

      Thanks
      this.Name identifies the class to itself.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by andrewtrades, Today, 04:57 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      6 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      9 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X