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

enumeration difference between 7 and 8

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

    enumeration difference between 7 and 8

    I am trying to initialize an enum in 8 but I am having difficulties. what is the change in 8.
    here is 7

    [Description("Pivot Type (Swing/ZigZag)")]
    [GridCategory("Pivot Type")]
    [Gui.Design.DisplayName("Pivot Type (Points/Percent)")]
    public NinjaTrader.Indicator.myEnum.eZigZagDeviation ZigZagType
    {
    get { return eZigZagType; }
    set { eZigZagType = value; }
    }

    here is 8

    [NinjaScriptProperty]
    [Display(Name = "Pivot Type (Swing/ZigZag)", Description = "", GroupName = "Pivot Type", Order = 3)]
    public NinjaTrader.Indicator.myEnum.eZigZagDeviation ZigZagType
    {
    get { return ePivotType; }
    set { ePivotType = value; }
    }

    I presume it is the Ninjatrader.Indicator line but what is the change?

    public NinjaTrader.Indicator.myEnum.eZigZagDeviation ZigZagType


    I did encapsulate in 7 and made my enum not global and I want to do this in 8

    #2
    Hello,

    Thank you for the post.

    As the namespaces have changed between NT7 and NT8, you would need to look at where you defined the enum and copy the namespace from there and replace the NT7 namespace.

    By default indicators in nt8 reside in NinjaTrader.NinjaScript.Indicators

    If the enum is defined inside of your indicator, you would need to use the namespace you see at the top of your indicator followed by the indicator name as you did with 7.

    Also from our conversation yesterday, if you plan to make a shared enum, rather than creating a separate indicator file with the enum as noted in my post from yesterday, you can use an Addon type if you want to add the enum into a separate file.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thankyou I understand now just copy the namespace

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by gemify, 11-11-2022, 11:52 AM
      6 responses
      803 views
      2 likes
      Last Post ultls
      by ultls
       
      Started by ScottWalsh, Today, 04:52 PM
      0 responses
      3 views
      0 likes
      Last Post ScottWalsh  
      Started by ScottWalsh, Today, 04:29 PM
      0 responses
      7 views
      0 likes
      Last Post ScottWalsh  
      Started by rtwave, 04-12-2024, 09:30 AM
      2 responses
      22 views
      0 likes
      Last Post rtwave
      by rtwave
       
      Started by tsantospinto, 04-12-2024, 07:04 PM
      5 responses
      70 views
      0 likes
      Last Post tsantospinto  
      Working...
      X