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 proptrade13, Today, 11:06 AM
      0 responses
      2 views
      0 likes
      Last Post proptrade13  
      Started by kulwinder73, Today, 10:31 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by RookieTrader, Today, 09:37 AM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by terofs, Yesterday, 04:18 PM
      1 response
      24 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by CommonWhale, Today, 09:55 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Erick  
      Working...
      X