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 llanqui, Today, 10:32 AM
    0 responses
    1 view
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by StockTrader88, 03-06-2021, 08:58 AM
    45 responses
    3,992 views
    3 likes
    Last Post johntraderuser2  
    Started by TAJTrades, Today, 09:46 AM
    0 responses
    7 views
    0 likes
    Last Post TAJTrades  
    Started by rhyminkevin, Yesterday, 04:58 PM
    5 responses
    62 views
    0 likes
    Last Post dp8282
    by dp8282
     
    Started by realblubb, Today, 09:28 AM
    0 responses
    8 views
    0 likes
    Last Post realblubb  
    Working...
    X