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 Jonker, 04-27-2024, 01:19 PM
      3 responses
      22 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by businessman1929, 04-29-2024, 01:28 PM
      2 responses
      21 views
      0 likes
      Last Post businessman1929  
      Started by bltdavid, 03-27-2023, 05:32 AM
      18 responses
      347 views
      0 likes
      Last Post ETFVoyageur  
      Started by NM_eFe, Today, 05:15 PM
      0 responses
      5 views
      0 likes
      Last Post NM_eFe
      by NM_eFe
       
      Started by vitaly_p, Today, 05:09 PM
      0 responses
      4 views
      0 likes
      Last Post vitaly_p  
      Working...
      X