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

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:	72
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.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    11 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    10 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    11 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,981 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Yesterday, 06:48 PM
    0 responses
    9 views
    0 likes
    Last Post rbeckmann05  
    Working...
    X