Change Color of Hull Moving Average when flat


Tags:
Category:
0
0

Hello!

Is there a way to change the color of the Hull MA to light-gray (or selectable) when the slope is between a certain range (i.e., not trending or “flat”), instead of always being red or green when the market is chopping? Can this slope range also be selectable?

Thank you, Jeff 🙂

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on July 24, 2022 11:00 am
92 views
0
Private answer

Great idea. But the solution is more complex than what I can address free of charge in the Q&A Forum. I only allocate 15 minutes for each free solution I provide in this forum.

But I will at least take some time to explain to you what is missing from your description.

  1. No screenshot showing an example of this pattern
  2. I don't see any description of how you want to measure the degree of "flatness" (this is not a simple thing to describe and it is even more difficult to write into the code
  3. "Slopes" as it pertains to measuring specific angles on the chart are not feasible. Exact angles do not really exist on the chart. A 45 degree angle on a chart can be adjusted to nearly flat if you zoom in on the chart.
  4. And the slope of the moving average itself is a lagging metric. By the time the slope changes from flat to trending you have already missed most of the change in the price action.
  5. Which means the best solution would be to measure the price action directly. For that you would need to have several adjustable parameters and the code would need to measure percent change in price over a specified number of bars.
    1. If you to see an example of how complex this can be check the solution here:

https://www.hahn-tech.com/ans/scan-for-flatbase-breakout-to-the-short-side/

 

Marked as spam
Posted by (Questions: 37, Answers: 4073)
Answered on July 24, 2022 3:52 pm