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

referencing enum syntax in strategy

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

    referencing enum syntax in strategy

    HI i have indicator that uses enum and i cant find a syntax how to rerence enum in strategy. I place "one" as enum but its not recognizing it.
    Click image for larger version

Name:	image.png
Views:	77
Size:	137.0 KB
ID:	1251629Click image for larger version

Name:	image.png
Views:	73
Size:	11.4 KB
ID:	1251630
    Click image for larger version

Name:	image.png
Views:	65
Size:	293.0 KB
ID:	1251631​​

    #2
    Hello tkaboris,

    Thank you for your post.

    I suggest checking out the following reference sample which demonstrates the use of an enum in the property grid as use case #4:


    Based on your screenshots, you may need to type in dpEnum. and then after the period the intelliprompt should pop up with a list of the options you could use.

    Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Tnothign is showing after i hit the dot.. In the example i didnt see what needs to be done.
      I used stochastics colored version
      Attached Files

      Comment


        #4
        Hello tkaboris,

        Thank you for your reply.

        I found the following in line 166 of the script you provided:


        You should be able to type in Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum . followed by the selection for the enum that you'd like to choose. Enums are a general C# concept and are not specific to NinjaTrader. More information may be found via publicly available resources, such as the Microsoft documentation at the following link:Please let us know if we may be of further assistance.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Thank you i was able to get it to work, it uses addon and price formatter had to be referenced via addon as well.

          I am trying to access those reversals up and down but i just cant, there is no error in compilation but in prints its always 0s, even though there are signals on the chart. What am i doing wrong?

          Code:
          private Series<double> sRevUp;
                  private Series<double> sRevDown;​
          
          myStochInd = Sim22_Stochastics_Colored_AnyInputGLV1(Close,Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum.SameAsInstrument, true,7,14,3,true,true,true,30,false,0);
                      AddChartIndicator(myStochInd);
                          sRevUp = myStochInd.DReversalUp;
                          sRevDown = myStochInd.DReversalDown;
          
                          sRevUp = new Series<double>(this);
                          sRevDown = new Series<double>(this);​
          
          Print("d rev up" + sRevUp[0]);
                      Print("d rev down" + sRevDown[0]);  ​

          Comment


            #6
            You are obtaining the sRevUp series from your indicator and then immediately replacing that series with a new, empty one two lines later. You need to remove those two new Series lines.
            Bruce DeVault
            QuantKey Trading Vendor Services
            NinjaTrader Ecosystem Vendor - QuantKey

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,404 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            95 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            8 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            159 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            8 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X