Announcement

Collapse
No announcement yet.

Swings trend colour efs

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

  • Swings trend colour efs

    Hello,

    I’m trying to modify the Real Times Swings efs to show the current trend by colouring the lines red or blue. (Please see picture)

    I thought the easiest way to do this would be to compare the values for y1a and y2b:

    y1a > y2b = down trend, line therefore should be red.
    y1a < y2b = up trend, line therefore should be blue.

    This seemed to give me some correct results and some incorrect results; I discovered that this was because the y2b value is the value at which the previous trend is confirmed (see pink highlighted lines on attached picture).

    A way I see of solving this would be to instead compare y1a from the last swing (Xx) to either y1b or y2a of the current swing.

    Does anyone have any suggestions on how to create a variable to capture the Xx value or perhaps another suggestion on how to solve this issue?

    Thanks
    Aengus
    Attached Files

  • #2
    Solution

    I have sorted it.

    If you look at the picture below.

    To get the colour of line ab, I compare points 3 and 1, as these are confirmed points.

    pt3 bigger than pt1 = down trend (red line)
    pt3 smaller than pt1 = up trend (blue line)

    As you can see my comparison rules may need adjusting as false reversals apear.

    Any ideas on how to fix this would be welcome.
    Attached Files

    Comment


    • #3
      code

      code attached
      Attached Files

      Comment

      Working...
      X