Support Board
Date/Time: Wed, 15 Jan 2025 21:43:34 +0000
Post From: Color bar
[2017-09-04 14:36:07] |
Sawtooth - Posts: 4153 |
You'll need two instances of the Color Bar Based On Alert Condition study, one for each color/direction. Try this: Put these formulas on the alerts tab of the respective color bar study: Green bar: =OR(
Red bar:AND(ID1.SG1>ID1.SG1[-1],ID2.SG2[-2]>ID2.SG2[-1],ID2.SG2>ID2.SG2[-1]), AND(ID1.SG1[-2]>ID1.SG1[-1],ID1.SG1>ID1.SG1[-1],ID2.SG2>ID2.SG2[-1]) ) =OR(
where the EMA is ID1 and the MACD is ID2; edit as needed.AND(ID1.SG1<ID1.SG1[-1],ID2.SG2[-2]<ID2.SG2[-1],ID2.SG2<ID2.SG2[-1]), AND(ID1.SG1[-2]<ID1.SG1[-1],ID1.SG1<ID1.SG1[-1],ID2.SG2<ID2.SG2[-1]) ) These formulas will color the price bar at the first occurrence of both lines sloped in the same direction. Limitation: a missed coloring might occur if any line segments are equal to the previous. The solution to this is to use different formulas in a spreadsheet study, as in this example in post #6: alert condition kijun sen |