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

userdefinedvalues

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

    userdefinedvalues

    hi

    I want to adjust the pivotindicator. The adjustment is nearly finished i have just one problem.

    In the pivotsindicator it is possible to enter user defined values for close, high and low.

    Now I dont want to enter user defined values I want to type in numbers that are then added to the current close, high and low. can someone help me in that matter?

    this is what i have:

    currentClose = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedClose : close;
    currentHigh = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedHigh : high;
    currentLow = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedLow : low;
    }
    else
    {
    currentClose = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedClose : close;
    currentHigh = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedHigh : Math.Max(currentHigh, high);
    currentLow = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedLow : Math.Min(currentLow, low);


    i think there are just small changes to implement.

    thx in advance

    ragga

    #2
    Hello,

    Thank you for your note.

    Try something like this:
    currentClose = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? close + my_tick_addition*TickSize : close;

    Where my_tick_addition is an integer type variable that you added to the program.

    I have not tested this, but give it a try, try to debug it if there are issues, and if all else fails post what you are doing and we'll try to help again.
    DenNinjaTrader Customer Service

    Comment


      #3
      thanks, but:

      you wrote:

      Where my_tick_addition is an integer type variable that you added to the program.

      ? I am a newbee to that so dont know what you mean. is it the definition in the variables?

      private double userDefinedClose = 0;
      private double userDefinedHigh = 0;
      private double userDefinedLow = 0;

      or do i have to change also anything in the properties?

      /// <summary>
      /// close value for user defined pivots calculation
      /// </summary>
      [Description("User defined prior session close value used for pivots calculation.")]
      [Category("\rUser defined values")]
      public double UserDefinedClose
      {
      get { return userDefinedClose; }
      set { userDefinedClose = value; }
      }

      /// <summary>
      /// high value for user defined pivots calculation
      /// </summary>
      [Description("User defined prior session high value used for pivots calculation.")]
      [Category("\rUser defined values")]
      public double UserDefinedHigh
      {
      get { return userDefinedHigh; }
      set { userDefinedHigh = value; }
      }

      /// <summary>
      /// low value for user defined pivots calculation
      /// </summary>
      [Description("User defined prior session low value used for pivots calculation.")]
      [Category("\rUser defined values")]
      public double UserDefinedLow
      {
      get { return userDefinedLow; }
      set { userDefinedLow = value; }
      }

      thx a lot in advance

      lg
      ragga

      Comment


        #4
        Hello,

        Modifying the pivots indicator is fairly advanceds for a new user.

        Here is a referenece sample to get you started:


        Post questions that you might have.
        DenNinjaTrader Customer Service

        Comment


          #5
          thanks for help

          Comment


            #6
            Not possible to define user defined pivot values globally?

            Hi Ninja Support,
            I don't mind entering the user values for pivots to ensure they are absolutely correct, but the problem is, with say 8 charts open I can't possibly enter them 8 times for 8 different charts.

            Is there any way the values can be entered only once and applied globally to all charts open with the same instrument ??

            Cheers,

            Comment


              #7
              Hello,

              I assume you mean without programming it.
              Try saving it in a template: right click chart>templates
              Then apply that template to the other chart.
              DenNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,602 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              8 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              4 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              12 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X