Announcement

Collapse
No announcement yet.

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:	183
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.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X