Announcement

Collapse
No announcement yet.

Moving ave of highs & lows that "flips"

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

  • Moving ave of highs & lows that "flips"

    Hi

    I am trying to create two Weighted 6-bar MAs - one MA of the highs and one MA of the lows - that "flip" every time the high crosses above the MA of the highs and when the low crosses below the MA of lows.

    So what it would look like is that when the high crosses up through the 6ma (highs) the 6maLow would appear on the chart as a sort of stair below the pricebars. And then when the low of a bar crosses down through the 6ma (lows) the 6maHigh would appear as a line above the pricebars. It would appear on the chart as just one MA that "flips" above and below the price bars when conditions are met.

    One possible workaround would be to have the MAs as a white or background color (ie invisible) until the the high crosses up through the 6ma(highs). Then this turns the Low average Black (or green) so you can see it below the pricebars.

    Similarly if the low crosses down through the lower ma the color of the 6maHighs changes from background/white to Black (or red) visible above the pricebars.

    Is this doable?

    Many thanks in advance for any help on this!!

    Veda

  • #2
    Hi Veda,

    Try the attached efs to see if it does what you want. It should at least give you a start.

    Steve
    Attached Files

    Comment


    • #3
      Steve

      That's terrific - thank you so much.

      It looks great. I'll play around with it some more.

      Veda

      Comment


      • #4
        HiLoStairsFlip

        Veda,

        is this similar to anything that you're looking for?
        Attached Files

        Comment


        • #5
          great job Steve,
          Mine leaves alot to be desired!

          What would you do when price is between the hi and low WMA lines?

          kz
          Last edited by zeller4; 10-11-2007, 07:39 PM.

          Comment


          • #6
            Thanks Zeller

            - this is very interesting. Yes, it does a lot of what I was looking for.

            The problem I am noticing with both of these formulas is that when the stairs actually "flip" they draw the MA line across the bars creating a confusing pattern.

            It may not be possible but it would be cleaner if we could just have the "flip" go blank for a bar so we don't see the line drawn between them

            Thanks to both you and Steve for your efforts...

            Veda

            Comment


            • #7
              You're both welcome.

              zeller4, yours looks like it works fine except for the spikes when you switch.

              Steve

              Comment


              • #8
                Veda,

                You can try using the FLATLINES plot method instead of the stairstep.

                Uncomment line 29 and comment out line 30 to see what this does.

                That's the only way to get rid of the connecting line when the flip occurs.

                You could also blank the line for one entire bar, but that would require code changes to keep track of where you crossed.

                Steve

                Comment

                Working...
                X