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

Default PriceType

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

    Default PriceType

    Hi,

    Does anyone know if there is any way to set the PriceType default value in NT 7? Currently the PriceType defaults to Close. I would like to set it to something other than Close, say Median, yet still allow the user the option to change it. I have searched the forum and have not found any information on this. Thank you.

    #2
    Hi Zeos6,

    Yes, you can set the PriceType property for this:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      Thank you for your reply but I don't think that this will do what I need. First, I want the PriceType to apply to the Imput Data series, not any specific plot. Second, if I code the PriceType in the Initialize() as suggested, the user will never be able to change it,- it will always reset to the coded value. I would like to change the default PriceType for the Input Data series and still give the user the option to change it. So, I want the same behaviour we have now, except I want to change the PriceType default value from Close to Median.

      Comment


        #4
        Attached is a sample that shows how this works, which matches your description as far as I can tell.
        Attached Files
        Last edited by NinjaTrader_RyanM1; 03-15-2011, 10:28 AM.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Hi Ryan,

          Thank you very much, I really appreciate this.
          I have two quick questions if I may:

          1. The code states:

          // Use this method for calculating your indicator values. Assign a value to each
          // plot below by replacing 'Close[0]' with your own formula.
          Plot0.Set(Input[0]);

          What Close[0] are you referring to in here?

          2. On a sligtly different, yet related note, if I wanted to say multiply the INput series values by 3, would I use the same program construct? For example, replace

          Plot0.Set(Input[0]);

          with

          Plot0.Set(3*Input[0]);

          How would I access these new values elsewhere in the program?

          Thank you for your help. It is much appreciated.

          Comment


            #6
            Thanks for the reply. It does look like you are locked into the selection specified in Initialize() method for PriceType. Unfortunately there is currently no way to assign a default and allow user to change.

            You can make a new data series for your input. This sample can help with custom data series.


            #region Variables
            private DataSeries myDataSeries;
            #endregion

            protected override void Initialize()
            {
            myDataSeries = new DataSeries (this);
            }

            protected override void OnBarUpdate()
            {
            myDataSeries.Set(Input[0] * 3);
            }

            I also removed comments in the sample if they were confusing to you. Those are the standard comments that come whenever you create a new indicator.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Hi Ryan,

              Thank you very much for your help. Can this - i.e. setting your own default PriceType - be placed on a list of desired changes for the next update of NT? Thank you.

              Thank you for the custom data series clarification.

              Comment


                #8
                Yes, I have forwarded your suggestion to our development team. We appreciate your feedback and have assigned this feature request ID # 651 in our tracking system.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by ageeholdings, Today, 07:43 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post ageeholdings  
                  Started by pibrew, Today, 06:37 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post pibrew
                  by pibrew
                   
                  Started by rbeckmann05, Yesterday, 06:48 PM
                  1 response
                  14 views
                  0 likes
                  Last Post bltdavid  
                  Started by llanqui, Today, 03:53 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post llanqui
                  by llanqui
                   
                  Started by burtoninlondon, Today, 12:38 AM
                  0 responses
                  12 views
                  0 likes
                  Last Post burtoninlondon  
                  Working...
                  X