Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Builder, Fib drawing, set End Y at 50% between two bars

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

    Builder, Fib drawing, set End Y at 50% between two bars

    On three consecutive bars there is sometimes a gap between the 1st & 3rd one. I would like the End Y of the Fib Retracement tool to be at 50% between the high of bar 3 & low of bar 1.

    I made a rectangle tool to highlight this gap in my first set, the 2nd set is the fib tool. For now I only have End Y at -1 tick below bar 1, which is wrong but I started there.
    I see the percent box for one bar be it whatever bar but not two bars, for between them. I probably have to unlock the code to do this?

    Please help me figure this out, most of the time the instruction go right over my head.
    Attached Files

    #2
    Hello trdninstyle,

    Thank you for your post.

    Yes, it would be simpler to unlock the code to accomplish this. This will require more complicated math than the builder is capable of doing in the EndY parameter.

    You'd need to calculate your End Y value using code something like:

    Code:
    double myEndY = (High[3] + Low[1]) * 0.5

    Comment


      #3
      Thank you Gaby,

      I will unlock it and try this. I was able to understand the various operations in the builder by watching u-tube videos.

      Comment


        #4
        Hello,

        If you want to keep your builder version of the script just in case, you can save a copy and then unlock the copy.

        When selecting your script in the Builder, hover over the name and you'll see 'Save As'.

        Comment


          #5
          Did I place the double in the correct place? And I did also place the math Draw section.
          Attached Files

          Comment


            #6
            I saved the builder version but in a different way, I added fibs in the name & compiled it so I had two, unlocked one of them.

            I don't seem to get the updated messages until I post then I see them.

            Comment


              #7
              Hello,

              Take a look at the Help Guide page for Draw.FibonacciRetracements for the proper syntax.



              Draw.FibonacciRetracements(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY)

              You don't need to declare the endY variable and do the math again in the endY parameter - you can do either-or (supply the calculated endY variable to the Draw method, or simply supply the calculation to the endY parameter).

              Comment


                #8
                I tried placing the double in various places in the script, but those examples didn't exactly show where to place it on the script itself.
                Tomorrow I'll ask a buddy where to place that to make it work, his platform isn't NT but knows enough to get me closer. I was trying not to call on him.
                Thank you for helping me this far.
                Attached Files

                Comment


                  #9
                  I tried supplying the calculated endY variable in the draw method skipping the endY parameter because I couldn't figure out where to place the parameter.
                  Please show me in the draw method how to apply this math (High[3] + Low[1]) * 0.5. I did try but was doing it incorrect.

                  Comment


                    #10
                    You need to supply it to the endY parameter. If you're using the syntax below, it is the last parameter.

                    Draw.FibonacciRetracements(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY)

                    Comment


                      #11
                      I'm getting * or -> operator must be applied to pointer

                      and Method name expected.

                      When I put in, double endY, I get more errors.

                      Is this part correct? Please, 3, 1, (High[3] + Low[1](* 0.5)) ,

                      I noticed I have *0.5 in () where the sample doesn't, also in first two pics I had High(1) but I fixed that by 3rd pic.
                      On the *0.5 am I suppose to have a period after the 5? Like, *0.5.
                      Attached Files
                      Last edited by trdninstyle; 10-23-2024, 05:25 PM.

                      Comment


                        #12
                        I removed the double endY and the extra ( ) on * 0.5 with no period after the 5 ; like * 0.5.

                        It came down to just one error, No overload for methods 'FibonacciRetracements' takes 6 arguments.
                        Attached Files

                        Comment


                          #13
                          You're missing the endBarsAgo value.

                          Please look at the syntax below.

                          Draw.FibonacciRetracements(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY)​

                          Comment


                            #14
                            I did put double endYin the 3rd pic, I'm not doing something right, I'm getting more errors.

                            This sample you show me is just a sample, right? or are you showing me exactly how to type it in? I don't think you are allowed to exactly show us just give us hints the way we should type stuff. Then that would be considered writing code for us.

                            I'll give you hints how to get to where you want to go but not really tell you though. Take a left at the street that has this tree on it at the corner.
                            sorry I can't explain to you exactly, that would be me driving you there.
                            Attached Files
                            Last edited by trdninstyle; 10-24-2024, 07:10 AM.

                            Comment


                              #15
                              You are supplying the endY but not the endBarsAgo. These are two separate arguments.

                              You're simply not supplying the correct amount of arguments, you keep giving it 5 when there are supposed to be 6.

                              There is no need to be sarcastic. While it is against our support policy to create logic for you, I am happy to give you a simple example of how to call the method. However you would need to give me information for what you want for each of the parameters in the following method call:

                              Draw.FibonacciRetracements(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY)

                              ​​

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              600 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              347 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              103 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              558 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              558 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X