Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pivots Calculation

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

    Pivots Calculation

    Hello,

    I was wondering for a long time, why S3 and R3 levels have so big values usually, in other words the distance between S2 and S3 and between R2 and R3 is quite wide, until I found out in the NinjaScript Editor, that calculation for S3 and R3 is different from commonly used:

    Forex Pivot Points, Live Update - Accurate, Reliable, Free and Best, Hourly, 4 Hour, Daily, Weekly, Monthly. We provide accurate forex pivots on Hourly, 4 Hour, Daily, Weekly, Monthly time frames. Updated throughout the day.


    Please press on Explanations to see the formulas.


    I'm not expecting from NT team to change it, so how can I change the formulas in the build in indicator by myself? I tried, but it says I can't modify a system indicator, then I tried to copy it in the Indicators folder without "@" and rename it, then modify it, but I'm getting some errors I don't understand completely.
    Last edited by Botan626; 04-13-2019, 05:33 AM.

    #2
    But still will be interesting to know why NT uses that formulas for S3 and R3.

    Comment


      #3
      Originally posted by Botan626 View Post
      Hello,

      I was wondering for a long time, why S3 and R3 levels have so big values usually, in other words the distance between S2 and S3 and between R2 and R3 is quite wide, until I found out in the NinjaScript Editor, that calculation for S3 and R3 is different from commonly used:

      Forex Pivot Points, Live Update - Accurate, Reliable, Free and Best, Hourly, 4 Hour, Daily, Weekly, Monthly. We provide accurate forex pivots on Hourly, 4 Hour, Daily, Weekly, Monthly time frames. Updated throughout the day.


      Please press on Explanations to see the formulas.

      I'm not expecting from NT team to change it, so how can I change the formulas in the build in indicator by myself? I tried, but it says I can't modify a system indicator, then I tried to copy it in the Indicators folder without "@" and rename it, then modify it, but I'm getting some errors I don't understand completely.
      That s because you are going about in the hardest possible way. Whereas it can certainly be done that way, it is error-prone and time-consuming.

      Do it in the recommended, much easier, more reliable, manner instead. Just right click in the indicator code and select 'Save as', enter a fresh name to which to save the indicator, and you have a copy for modifications, with all references correctly amended before you start writing any code.

      Comment


        #4
        Originally posted by koganam View Post

        That s because you are going about in the hardest possible way. Whereas it can certainly be done that way, it is error-prone and time-consuming.

        Do it in the recommended, much easier, more reliable, manner instead. Just right click in the indicator code and select 'Save as', enter a fresh name to which to save the indicator, and you have a copy for modifications, with all references correctly amended before you start writing any code.

        Sorry to disappoint you, but I tried your way, and there are still 3 errors, something about global names and definitions...

        Comment


          #5
          Originally posted by Botan626 View Post


          Sorry to disappoint you, but I tried your way, and there are still 3 errors, something about global names and definitions...
          It might help if you would paste in the exact error messages, so that we know where to look?

          Comment


            #6
            Originally posted by koganam View Post

            It might help if you would paste in the exact error messages, so that we know where to look?
            I thought about it, but the thing is, that I'm using rus version of Windows, and script editor gives me errors in rus too. Still, maybe line references will help, so here you go, thanks for your help:

            Comment


              #7
              Originally posted by Botan626 View Post

              I thought about it, but the thing is, that I'm using rus version of Windows, and script editor gives me errors in rus too. Still, maybe line references will help, so here you go, thanks for your help:
              That error refers to duplicate type identifiers. I think that maybe you have not removed the file that you created on your first attempt (as per your original post), where you tried to copy and rename the file directly from the file system? Did you delete that file?

              Comment


                #8
                Originally posted by koganam View Post

                That error refers to duplicate type identifiers. I think that maybe you have not removed the file that you created on your first attempt (as per your original post), where you tried to copy and rename the file directly from the file system? Did you delete that file?
                Yes, I did delete it.

                Comment


                  #9
                  You tried to do the same things you suggested me and you had no errors?

                  I called new one PivotPoints and I'm modifying lines 191, 192 to this:

                  s3 = currentLow - 2 * (currentHigh - pp);
                  r3 = currentHigh + 2 * (pp - currentLow);

                  Comment


                    #10
                    Originally posted by Botan626 View Post
                    You tried to do the same things you suggested me and you had no errors?

                    I called new one PivotPoints and I'm modifying lines 191, 192 to this:

                    s3 = currentLow - 2 * (currentHigh - pp);
                    r3 = currentHigh + 2 * (pp - currentLow);
                    I gave you the general correct method used to clone and modify an indicator in NT. I have not done it with that particular indicator.

                    Now looking into that particular indicator, I can see some public types declared in the Global namespace. I know generally how to handle that, but as you suggest, I will have to do it first, so that we have no more erratic instructions from me. I apologize, but as this was not an issue in NT7, it was not something that I took into account.

                    Comment


                      #11
                      Originally posted by Botan626 View Post
                      You tried to do the same things you suggested me and you had no errors?

                      I called new one PivotPoints and I'm modifying lines 191, 192 to this:

                      s3 = currentLow - 2 * (currentHigh - pp);
                      r3 = currentHigh + 2 * (pp - currentLow);
                      As my earlier responses somewhat misled you, I decided that I should just modify/create the indicator for you. I have made notes in there as to what I did, so you can follow along and see how I resolved the issue. Once again, apologies.
                      Attached Files

                      Comment


                        #12
                        Originally posted by koganam View Post

                        As my earlier responses somewhat misled you, I decided that I should just modify/create the indicator for you. I have made notes in there as to what I did, so you can follow along and see how I resolved the issue. Once again, apologies.
                        Hi, koganam!

                        Yes, I just successfully compiled your version of indicator, and all is good, S3 and R3 lines now make sense.

                        Thanks a lot for your help, and no need to apologize, we all make mistakes while doing something

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Stanfillirenfro, Yesterday, 09:19 AM
                        7 responses
                        51 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by TraderCro, 04-12-2024, 11:36 AM
                        4 responses
                        69 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Mindset, Yesterday, 02:04 AM
                        1 response
                        15 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by agclub, 04-21-2024, 08:57 PM
                        4 responses
                        18 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by Irukandji, Today, 04:58 AM
                        0 responses
                        6 views
                        0 likes
                        Last Post Irukandji  
                        Working...
                        X