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

Bug: Keyboard strokes to create new line in a multiline string property does not work

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

    Bug: Keyboard strokes to create new line in a multiline string property does not work

    My custom indicator and strategies requires multiline string input from the user. NT has limited documentation on how to achieve this, but I found that I use code below. There are some mentions of this in other posts here on NT forum such as here, here and here.

    Code:
    [PropertyEditor("NinjaTrader.Gui.Tools.MultilineEditor")]
    Problem: Use of the MultilineEditor allows the string to be multiline. However, the the GUI window where user would enter the text does NOT capture key strokes that create a new line. There are mentions of using Shift + Enter or Alt + Enter to create a new line. However, neither of these key strokes create a new line. After pressing Shift + Enter, the indicator/strategy editor window is closed. I have include example code to replicate the issue.


    Click image for larger version

Name:	image.png
Views:	65
Size:	37.8 KB
ID:	1283797




    Code:
    namespace NinjaTrader.NinjaScript.Indicators.MyTroubleshoot
    {
        public class MultilinePropertyStringIssue : Indicator
        {
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Enter the description for your new custom Indicator here.";
                    Name                                        = "MultilinePropertyStringIssue";
                    Calculate                                    = Calculate.OnBarClose;
                    IsOverlay                                    = false;
                    DisplayInDataBox                            = true;
                    DrawOnPricePanel                            = true;
                    DrawHorizontalGridLines                        = true;
                    DrawVerticalGridLines                        = true;
                    PaintPriceMarkers                            = true;
                    ScaleJustification                            = NinjaTrader.Gui.Chart.ScaleJustification.Right;
                    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
                    //See Help Guide for additional information.
                    IsSuspendedWhileInactive                    = true;
                }
                else if (State == State.Configure)
                {
                }
            }
    
            protected override void OnBarUpdate()
            {
                //Add your custom indicator logic here.
            }
    
            #region Properties
            [PropertyEditor("NinjaTrader.Gui.Tools.MultilineEditor")]
            [Display(Name="DisplayText", Description="This is supposed to be a multiline string text", Order=1, GroupName="Parameters")]
            public string DisplayText
            { get; set; }
            #endregion
        }
    }​

    #2
    Hello wzgy0920,

    Unfortunately in this case there is nothing else I could recommend for a multiline editor use in other types besides a drawing object. The drawing object menu has special handling for the text tool where other types like indicators and strategies do not have that type of handling in the menus. As this is an undocumented property editor that is not documented for use with all types I can only inform development that this does not work with types other than drawing objects. I would suggest using a comma delimited string instead if you needed to enter multiple items or use multiple string properties.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse,

      Can you please submit this issue to the dev team.. Also I would like to submit a feature request to document and support the use of MultilineEditor

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pibrew, Today, 06:37 AM
      0 responses
      4 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Started by rbeckmann05, Yesterday, 06:48 PM
      1 response
      14 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, Today, 03:53 AM
      0 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      11 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      16 views
      0 likes
      Last Post AaronKoRn  
      Working...
      X