Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawFibonacciRetracements fib line length

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

    DrawFibonacciRetracements fib line length

    Is there a way to have the fib lines draw for just x bars instead of infinity on draw command like DrawFibonacciRetracements?

    I use a strategy to draw my fibs. I can have only the last one to draw or all them to draw by adding currentbar to the drawing name. Sometimes I like to reference an earlier drawing and would be nice if the fib lines only went x bars.

    Thanks,

    ct

    #2
    Hello,

    Thanks for your forum post.

    If I understand correctly your looking for to turn the extend right off correct?

    If this is the case you will need to use the following to do this.



    Instead of printing fibRetracements.StartBarsAgo you would instead change this to fibRetracements.ExtendRight = false;

    Let me know if I can be of further assistance.

    Comment


      #3
      Brett

      So I can change the one I drew before to not extend and set the new one to extend. I assume I can then change this default on the properties manually?

      I didn't even know those overloads existed.

      Cheers

      CT

      Comment


        #4
        Hello,

        Yes this is correct on both questions.

        Let me know if I can be of further assistance.

        Comment


          #5
          Brett

          Tell Ray you get a gold star for the day!

          Cheers

          CT

          Comment


            #6
            I can't seem to get access to those additional properties.

            Here is what I have currently that works:

            IFibonacciRetracements fibRetracements = DrawFibonacciRetracements("fibs_up", false, 5 , Highs[1][0], 4, Lows[1] [0]);

            If I try to add an additional property is says "No overload for method".

            IFibonacciRetracements fibRetracements = DrawFibonacciRetracements("fibs_up", false, 5 , Highs[1][0], 4, Lows[1] [0], false);

            can you help the blind?

            Cheers

            CT

            Comment


              #7
              ct, there's unfortunately no overload to set those from code (overloads are the 2 Intellisense offers) - you can would change them like the below snippet does it -

              Code:
              IFibonacciRetracements fibRetracements = DrawFibonacciRetracements("tag1", true, 10, Low[10], 0, High[0]);
              		
              fibRetracements.ExtendRight = false;
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Bertrand

                Thanks a lot. I added the code then change my default template back to draw the lines by default. It works like a champ. Just wish I could specify the template but I am good!

                Happy camper.

                Is there way I can save the IFibonacciRetracements pointer/value? I want to draw them initially with the template defaults - Lines on, but change them to off if I am about to draw a new fib retracement. In the code I am using I can't use the variable in a line of code before it is created/defined. I want the newest/latest retracement to be extended but the previous retracement to be non extended.

                I want to in essence move the code below the IFibonacciRetracements line to above it.
                IFibonacciRetracements fibRetracements2 = DrawFibonacciRetracements("fibs2"+ CurrentBars[1], false, 7, Lows[2] [0], 6, Lows[2][0] - TickSize * 2);
                fibRetracements2.ExtendRight = false;
                fibRetracements2.ExtendLeft = false;
                fibRetracements2.ShowText = false;
                Last edited by ct; 12-28-2010, 12:32 AM.

                Comment


                  #9
                  I would then draw 2 retracements, one using a non unique tag so it's in essence always updated > this is your latest one then with extensions etc on...for the historical ones just use the approach you had and don't set any of the properties then...I believe that should do it.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Bertrand

                    I understand the technique. I think i can make that work. I actually drew 2, 1 up and 1 down, but can draw 4 just as easy. I just need to use a different offset so I can select it if need be.

                    Thanks.

                    ps: So the most recent will have 4 (2 expanded, 2 non expanded) but as soon as there is another it will only have 2.
                    Last edited by ct; 12-28-2010, 10:19 AM.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by RubenCazorla, Today, 09:07 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post RubenCazorla  
                    Started by BarzTrading, Today, 07:25 AM
                    2 responses
                    28 views
                    1 like
                    Last Post BarzTrading  
                    Started by devatechnologies, 04-14-2024, 02:58 PM
                    3 responses
                    20 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by tkaboris, Today, 08:01 AM
                    0 responses
                    6 views
                    0 likes
                    Last Post tkaboris  
                    Started by EB Worx, 04-04-2023, 02:34 AM
                    7 responses
                    165 views
                    0 likes
                    Last Post VFI26
                    by VFI26
                     
                    Working...
                    X