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

Name not displayed

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

    Name not displayed

    Hello.
    I'm getting strange behavior for which I can't find an explanation.
    Variable initialization "Name" of the strategy in the default block.
    Code:
        if (State == State.SetDefaults)
                {
                    Name = "B.strategy_58";
                    .....
                }​
    then in the History block, I try to call this "Name", but it always prints an empty string.
    Also, when activating the strategy, I see that only the strategy's random ID is printed in the output window, and the name is not displayed.

    Click image for larger version

Name:	Q_11.png
Views:	99
Size:	7.2 KB
ID:	1216709
    Do you have any idea how to explain this?​

    #2
    Hello Danila,

    Thanks for your post.

    When a strategy is enabled with the Label property left blank, the strategy name will not appear in the NinjaScript Output window.

    If you want the strategy name to appear in the Output window, you would need to make sure that the Label field is not left blank when enabling your strategy.

    See this video demonstrating this behavior: https://brandonh-ninjatrader.tinytak...NV8yMDI1MzUyMA

    Let me know if I may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello Brandon.
      Thank you for your quick response and video.
      Yes, you are right, my label is empty. this fixed the output.

      Although I confess, for me it does not look logical.
      Since I write code by hand and as a result I expect some kind of behavior.
      I initialize the Name and expect to receive this Name in the code for some logic.
      but it turns out I'm dependent on filling some kind of strategy window.​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by DJ888, 04-16-2024, 06:09 PM
      4 responses
      12 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by terofs, Today, 04:18 PM
      0 responses
      11 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by nandhumca, Today, 03:41 PM
      0 responses
      7 views
      0 likes
      Last Post nandhumca  
      Started by The_Sec, Today, 03:37 PM
      0 responses
      3 views
      0 likes
      Last Post The_Sec
      by The_Sec
       
      Started by GwFutures1988, Today, 02:48 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Working...
      X