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

an unusual variable

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

    an unusual variable

    Hi,

    I came across this type of variable from one of the indicators that came from the Indicators section of the Ninjascript File Sharing section. Could you please tell me what it means as I see it throughout the script and what purpose it serves? Thanks!

    private TDType _TDCountdownType = TDType.TDBuy;

    #2
    Kay, this creates a public enum which is then used as a user defined input in this indicator -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand, will take a look

      Comment


        #4
        Bertrand, the enum below allows me to use either TDBuy or TDSell but not TDBuy and TDSell together. What alternatives do I have if I want to use TDBuy and TDSell together?

        Comment


          #5
          Kay, this is expected as this is a user defined input allowing for either 'a' or 'b'. You could just run the indicator two times and then select Buy in the first one and Sell in the second one...
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Yes, Bertrand. But users of this indicator actually use buy and sell together not buy or sell. There would be some signals missing if a buy or sell were used...I'm quite happy to rewrite the code but would appreciate some guidance as to how to begin
            Last edited by kaywai; 02-03-2010, 08:48 AM.

            Comment


              #7
              Sorry, I don't follow you as I'm not intimately familiar with this custom code, best option might be to check with the author who created it.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                The indicator is known as TD Sequential. I want to rewrite the code (at my own risk of course) so that i can get TDBuy and TDSell at the same time.

                Currently the code requires that you choose either TDBuy or TDSell using the enum value.

                Hence I was wondering whether I could do away with the enum and have both TDBuy and TDSell runnning together. I need some guidance to start. I will try to figure out the rest. Below seems to be what he has:-

                private TDType _TDCountdownType = TDType.TDBuy;

                publicenum TDType
                {
                TDBuy,
                TDSell
                }

                Comment


                  #9
                  Kay, as noted it would be easiest to run two versions of it for you...to modify you would need to remove the code 'splitting' via the user enum and then rework the logic so it plots both sides of the signals.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Bertrand, I have actually spent a few days on it already. The enum portion is where I am stuck. Could I use "private bool TDBuy = false;" or something to that effect instead of enum values?

                    Comment


                      #11
                      Kay, changing this simply would not be enough, as the code logic would run depending on this setting, so you would need essentially double the calculations and plots for both sides.

                      As noted I'm not familiar the complete custom code you're using and can't getting into it 'deeply' for bandwith reasons...if you like this modifcation done professionally for you, please consider a NinjaScript consultant -

                      BertrandNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by cls71, Today, 04:45 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post cls71
                      by cls71
                       
                      Started by mjairg, 07-20-2023, 11:57 PM
                      3 responses
                      213 views
                      1 like
                      Last Post PaulMohn  
                      Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                      4 responses
                      544 views
                      0 likes
                      Last Post PaulMohn  
                      Started by GLFX005, Today, 03:23 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post GLFX005
                      by GLFX005
                       
                      Started by XXtrader, Yesterday, 11:30 PM
                      2 responses
                      12 views
                      0 likes
                      Last Post XXtrader  
                      Working...
                      X