Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enum in Input parameters

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

    Enum in Input parameters

    Hi,

    I have a cusom enum. Let's assume it is:

    Code:
            public enum SignalType{
                Buy,
                Sell,
                No,
                Both
            }
    ​

    I know how to add this enum in the input parameters. However, in the input parameters I want to see not just 'Buy', 'Sell', etc options, but 'Type Buy', 'Type Sell', etc. I want to see it with spaces (not 'TypeBuy', 'TypeSell').
    Something like this. We see 'On bar close', and not 'OnBarClose':
    Click image for larger version

Name:	image.png
Views:	338
Size:	10.0 KB
ID:	1274148

    How can I do this?

    #2
    Hello webus,

    Thanks for your post.

    A public user-defined NinjaScript property would need to be created in your script to display the user-defined enum in the Properties section of the UI when adding the script to a chart.

    Here is a reference sample demonstrating how to accomplish this with a custom enum.

    SampleUniversalMovingAverage: https://ninjatrader.com/support/help...ned_parame.htm

    A custom type converter would be necessary to have custom display attributes in the properties menu. However, custom type converters are not supported by NinjaTrader Support.

    See this forum thread for more information on this topic: https://forum.ninjatrader.com/forum/...710#post772710
    Last edited by NinjaTrader_BrandonH; 10-22-2023, 02:07 PM.
    <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

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    591 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    553 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X