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:	10
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 futureszone, Today, 02:26 PM
      0 responses
      2 views
      0 likes
      Last Post futureszone  
      Started by ttodua, Today, 01:39 PM
      0 responses
      3 views
      0 likes
      Last Post ttodua
      by ttodua
       
      Started by carnitron, Today, 10:45 AM
      2 responses
      35 views
      0 likes
      Last Post carnitron  
      Started by dtaylor, Today, 01:13 PM
      0 responses
      6 views
      0 likes
      Last Post dtaylor
      by dtaylor
       
      Started by advgal, Today, 09:25 AM
      1 response
      17 views
      0 likes
      Last Post Soup Kitchen Jim  
      Working...
      X