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

CPR indicator

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

    CPR indicator

    hello,
    Does dose anyone know about CPR (central pivot range) indicator for NT8?

    if not can someone help me in coding it for nt8?
    it requires 3line to draw
    with the formula::
    TC = (Pivot – BC) + Pivot
    Pivot = (High + Low + Close)/3 {its already avalible in nt8 ,so dont need this line}
    BC = (High + Low)/2

    #2
    Hello hir04068,

    I am not aware of this calculation myself, if any forum members are I am sure they will reply as well.

    You could certainly do these type of calculations in a script, what you provided could be written as:

    Code:
    TC = (Pivot – BC) + Pivot
    // this line does not provide enough detail on what data is needed, is this the prior bar values?  this is being checked before the value Pivot or BC are set

    Code:
    Pivot = (High + Low + Close)/3 {its already avalible in nt8 ,so dont need this line}
    would be:
    Code:
    Pivot[0] = Typical[0];


    and then
    Code:
    BC[0] = (High[0] + Low[0])/2;
    [I][/I]

    These are assuming you have added a plot for TC Pivot and BC, plots can be added using the steps in the following page: https://ninjatrader.com/support/help...ghtsub=addplot


    I look forward to being of further assistance.


    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello hir04068,

      I am not aware of this calculation myself, if any forum members are I am sure they will reply as well.

      You could certainly do these type of calculations in a script, what you provided could be written as:

      Code:
      TC = (Pivot – BC) + Pivot
      // this line does not provide enough detail on what data is needed, is this the prior bar values? this is being checked before the value Pivot or BC are set

      Code:
      Pivot = (High + Low + Close)/3 {its already avalible in nt8 ,so dont need this line}
      would be:
      Code:
      Pivot[0] = Typical[0];


      and then
      Code:
      BC[0] = (High[0] + Low[0])/2;
      [I][/I]

      These are assuming you have added a plot for TC Pivot and BC, plots can be added using the steps in the following page: https://ninjatrader.com/support/help...ghtsub=addplot


      I look forward to being of further assistance.

      hi,
      I have very low knowledge of coding so I will require more help from you. thanks in advance.
      can we add these levels in default pivot indicator provided in nt8? so it can draw this line also....
      TC = (Pivot – BC) + Pivot
      BC = (High + Low)/2

      Comment


        #4
        HELLO,
        I tried to edit the default pivot indicator by creating a new indicator and then added the new lines plot and formula. I am getting the error with this one, which I was expecting as I was just trying to create something I don't know. please, can you look into this code?
        Attached Files

        Comment


          #5
          Hello hir04068,

          The compile errors are letting you know that you are creating a duplicate PivotsTypeConverter and that HLCCalculationMode as well as PivotRange are duplicated. You will need to create unique versions of this TypeConverter and enums to get the script to work.

          It may be helpful if you compared a working modification to the Pivots indicator against the original to better understand what steps need to be taken to create a new version of this script. You could use an publicly available tool like DiffChecker to check for differences.

          Diffchecker will compare text to find the difference between two text files. Just paste your files and click Find Difference!


          SvePivots NT8 - https://ninjatraderecosystem.com/use...indicator-nt8/

          The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

          Please let us know if you have any questions.
          Last edited by NinjaTrader_Jim; 11-29-2019, 10:52 AM.
          JimNinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Jim View Post
            Hello hir04068,

            The compile errors are letting you know that you are creating a duplicate PivotsTypeConverter and that HLCCalculationMode as well as PivotRange are duplicated. You will need to create unique versions of this TypeConverter and enums to get the script to work.

            It may be helpful if you compared a working modification to the Pivots indicator against the original to better understand what steps need to be taken to create a new version of this script. You could use an publicly available tool like DiffChecker to check for differences.

            Diffchecker will compare text to find the difference between two text files. Just paste your files and click Find Difference!


            SvePivots NT8 - https://ninjatraderecosystem.com/use...indicator-nt8/

            The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

            Please let us know if you have any questions.
            hello,
            i installed 'ntsvepivots' inidicator and change some formula in that. i am using new formula for "pl" and "ph"


            pp = (currentHigh + currentLow + currentClose) / 3;
            s1 = 2 * pp - currentHigh;
            r1 = 2 * pp - currentLow;
            s2 = pp - (currentHigh - currentLow);
            r2 = pp + (currentHigh - currentLow);
            s3 = pp - 2 * (currentHigh - currentLow);
            r3 = pp + 2 * (currentHigh - currentLow);
            pl = pp + (pp - ph);
            s1m = (pp - s1) / 2 + s1;
            r1m = (r1 - pp) / 2 + pp;
            s2m = (s1 - s2) / 2 + s2;
            r2m = (r2 - r1) / 2 + r1;
            s3m = (s2 - s3) / 2 + s3;
            r3m = (r3 - r2) / 2 + r2;
            ph = (currentHigh + currentLow)/2;

            now i am geting "ph" value perfect but "pl" value is not coming correct.
            i dont see error when i am compiling the indicator.
            please help.
            thanks

            Comment


              #7
              Hello hir04068,

              You will want to check how the value is assigned and that proper order of operations have taken place. For example, if pl is supposed to be TC as described in post 3, then we must keep in mind that this value depends on BC/ph. BC/ph would then need to be set first in order for the pl/TC calculation to be correct.

              Ultimately, debugging steps should be taken to print out the values used to evaluate each variable so you can break down the math used for the calculation and ensure that the math is set up correctly.

              Debugging tips - https://ninjatrader.com/support/help...script_cod.htm

              We look forward to assisting.
              JimNinjaTrader Customer Service

              Comment


                #8
                BC/ph and pp value is coming out perfect.
                that is why I am confused why pl is not coming properly.

                Comment


                  #9
                  Hello hir04068,

                  Debugging steps will need to be taken to check the values used to calculate pl. If pl depends on ph being up to date, pl should be calculated after ph.

                  Please let us know if you have any questions.

                  JimNinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_Jim View Post
                    Hello hir04068,

                    Debugging steps will need to be taken to check the values used to calculate pl. If pl depends on ph being up to date, pl should be calculated after ph.

                    Please let us know if you have any questions.
                    I have interchanged the formula and its working perfect now.
                    thanks a ton for all the help you have provided.

                    if anyone wants CRP indicator then I hope this will help. I am posting the final indicator and template I use for the intraday chart.
                    Attached Files

                    Comment


                      #11
                      hello,
                      if I want to draw a normal line into ExtendLines then what should I add in this indicator?
                      thanks
                      Last edited by hir04068; 01-16-2020, 09:57 PM.

                      Comment


                        #12
                        Hello hir04068,

                        Drawing Tools are not used in this indicator. The indicator overrides the OnRender method and performs its own drawings with SharpDX. To get some further direction on using SharpDX for custom rendering, please see our SampleCustomRender example as well as the documentation below.

                        Using SharpDX for Custom Rendering - https://ninjatrader.com/support/help..._rendering.htm

                        The lines are drawn with RenderTarget.DrawLine. To recreate an extended line, you will want to modify how coordinates supplied to this method to create the same effect as an ExtendedLine. You may also reference the Lines Drawing Tool source code to see how the Drawing Tool draws ExtendedLines with SharpDX.

                        We look forward to being of further assistance.
                        JimNinjaTrader Customer Service

                        Comment


                          #13
                          hir04068

                          I tried your CPR, but looks like the file is not complete or it should be a Zip file which it is not...
                          Can you share the CPR indicator one more time...Thanks in Advance

                          Comment


                            #14
                            Originally posted by Wingo View Post
                            hir04068

                            I tried your CPR, but looks like the file is not complete or it should be a Zip file which it is not...
                            Can you share the CPR indicator one more time...Thanks in Advance
                            i hope this works
                            Attached Files

                            Comment


                              #15
                              Thanks Hir04068,
                              I did try NTSvePivots.cs (26.6 KB, 175 views), but it doesn't give CPR with Top CPR and Bottom CPR
                              All it give is PP and S1- S3 and R1 - R3
                              let me know if I'm wrong...

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by GussJ, 03-04-2020, 03:11 PM
                              11 responses
                              3,229 views
                              0 likes
                              Last Post xiinteractive  
                              Started by andrewtrades, Today, 04:57 PM
                              1 response
                              14 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by chbruno, Today, 04:10 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post chbruno
                              by chbruno
                               
                              Started by josh18955, 03-25-2023, 11:16 AM
                              6 responses
                              441 views
                              0 likes
                              Last Post Delerium  
                              Started by FAQtrader, Today, 03:35 PM
                              0 responses
                              12 views
                              0 likes
                              Last Post FAQtrader  
                              Working...
                              X