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:	347
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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    47 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X