Announcement

Collapse
No announcement yet.

BW Fractal Signals

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

  • BW Fractal Signals

    Hi,

    Could someone please help me out with the following formula so that I can identify fractal formations on my charts? The definition of a fractal is as follows:

    A fractal must have two preceding and two following bars with lower highs ( higher lows in a down move). In a buy fractal, we are interested only in the bars' high. In a sell fractal, we are interested only in the bars' low. This is a five or more bar sequence where the center bar (or group of bars) is preceded and followed by two lower bar HIGHS for LONG signals OR, Two higher LOWS for SHORT signals.

    I need to have a green up arrow or upward triangle just above the center bar or bars for a buy fractal, and a red down arrow or downward triangle below the center bar or bars for a sell fractal.

    Thank you for your help, and let me know if this is enough information to do what I need to do. I appreciate all the help!

    Troy

  • #2
    Hi,

    I can't personally help with the coding but out of curiosity, I did a search on these boards and our partner's knowledge base. Found quite a few references to "fractal", like this thread. Maybe you'll get lucky and find something on the money or close to what you're looking for.

    Thanks.

    Comment


    • #3
      Hi,

      Could someone please help me out with the following formula so that I can identify fractal formations on my charts? The definition of a fractal is as follows:

      A fractal must have two preceding and two following bars with lower highs ( higher lows in a down move). In a buy fractal, we are interested only in the bars' high. In a sell fractal, we are interested only in the bars' low. This is a five or more bar sequence where the center bar (or group of bars) is preceded and followed by two lower bar HIGHS for LONG signals OR, Two higher LOWS for SHORT signals.

      I need to have a green up arrow or upward triangle just above the center bar or bars for a buy fractal, and a red down arrow or downward triangle below the center bar or bars for a sell fractal.

      Thank you for your help, and let me know if this is enough information to do what I need to do. I appreciate all the help!

      Troy
      Attached Files

      Comment


      • #4
        This should get you started

        function preMain(){
        var x=0;
        setPriceStudy(true);
        }

        function main(){
        if(low(-4) < low(-3) && low(-3) < low(-2) && high(-2) > high(-1) && high(-1) > high(0)){
        x=x+1
        drawShapeAbsolute(-2, high(-2), Shape.UPARROW, "", Color.red, Shape.ONTOP,x)
        }

        }

        Comment


        • #5
          Hi,

          I did some more searching and found the attached formula. It has the fractal formula included in it. I only need the fractal part of the formula, I already have everything else. The fractal formula is listed at the bottom. I tried to take just that part and run it and got error messages. Could you please remove it so that it will run on its own? Thanks alot for all of your help!

          Troy
          Attached Files

          Comment


          • #6
            what color is the fractal formula when it plots on your chart.

            Comment


            • #7
              Troy
              I think this should do it
              Alex

              PHP Code:
              function preMain() {
                  
              setPriceStudy(true);
                  
              setStudyTitle("");

              }

              var 
              distance null;

              function 
              main() {
               
                      if ( 
              distance == null )
                          
              distance = ((high(-4) - low(-4)) + (high(-3) - low(-3)) + (high(-2) - low(-2)) + (high(-1) - low(-1)) + (high() - low())) / 20;
                          
                      if ((
              high(-4) < high(-2)) && (high(-3) < high(-2)) && (high(-1) < high(-2)) && (high() < high(-2)))  
                          
              drawShapeRelative(-2high(-2) + distanceShape.UPARROW,""Color.limeShape.TOP"");
                      if ((
              low(-4) > low(-2)) && (low(-3) > low(-2)) && (low(-1) > low(-2)) && (low() > low(-2)))  
                          
              drawShapeRelative(-2low(-2) - distanceShape.DOWNARROW,""Color.redShape.BOTTOM"");
                  
                  return ;


              Comment


              • #8
                If Alex' suggestion works, let me know and I'll see what can be done to check for ..

                Once I have the fractal as a stand alone formula, will it be easy to add the variations to it, so that it will mark fractal formations that consist of more than 5 price bars?

                Comment


                • #9
                  Hi Alex and David,

                  Alex, the formula works great, I just have a couple of questions for you both. First, can the formula be altered so that the arrows appear just above/below the price bars, instead of actually touching the highs/lows? Also, some fractals consist of more than 5 price bars. As long as the center bar or bars are preceded and followed by two lower bar highs for long signals, or two higher lows for short signals, the center can be comprised of multiple bars of the exact same high, or low. I have attached a picture that is marked where there should be arrows marking fractals. If, for example, there are three exact highs for the middle of a long fractal, the most recent of the three bars would get the arrow above it. Thank you very much Alex and David for all of your help!

                  Troy
                  Attached Files

                  Comment


                  • #10
                    Need Help!

                    Hi,

                    I am also trying to set up the fractals correctly, and have been waiting for a few days, as has tcp for a follow up response from someone. Please, will one of the programming experts please help with the completion of this fractal formula. I emailed tech support for some programming help and they told me to just be patient and wait for the question to be answered on the bulletin board. Thank you for all of your help!

                    Nicholle

                    Comment


                    • #11
                      Troy

                      First, can the formula be altered so that the arrows appear just above/below the price bars, instead of actually touching the highs/lows?

                      If you are using the last formula I posted without having deleted or modified anything then it already does that (see image below)



                      As to the additional conditions for fractals (ie two or more equal highs/lows surrounded by lower highs or higher lows) here is what you would need to do.
                      Assume as an example that you want to identify a high bar surrounded by a bar each side with lower highs (the reverse for lows)
                      if (high(-2)<high(-1)&&high(-1)>high())
                      Notice in the following image the result. Also notice where the arrows are pointing that there are patterns with two equal highs/lows.



                      Now here is the same code with the provision for two equal highs surrounded by lower highs
                      if(high(-3)<high(-2)&&high(-2)<=high(-1)&&high(-1)>high())
                      which now identifies those equal high/low pairs



                      This is essentially the same construct you need to implement in the fractal script you already have.
                      Alex
                      Last edited by ACM; 09-23-2003, 07:42 AM.

                      Comment


                      • #12
                        Thank you very much for all of your help!

                        Comment


                        • #13
                          I was ckecking out the oscillator below, not sure what the whole topic is in here, but I would really like the efs or code for the oscillator only. .. being able to change times too.

                          Thanks,


                          Realm

                          Comment


                          • #14
                            Hi,

                            Here is the code. Not sure what you mean by being able to change the times.
                            Attached Files

                            Comment


                            • #15
                              Has anyone thought of putting a divergence indicator in the AO.efs? Good I dea I think! Just not a good programmer

                              Realm

                              Comment

                              Working...
                              X