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:	356
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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    93 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    138 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
    123 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    73 views
    0 likes
    Last Post PaulMohn  
    Working...
    X