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 chbruno, Today, 04:10 PM
      0 responses
      1 view
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      6 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by frslvr, 04-11-2024, 07:26 AM
      9 responses
      127 views
      1 like
      Last Post caryc123  
      Working...
      X