@halcyonguy,

Could I make a request: Capture peak or valleys when a price crosses above or below a 200-SMA? I have seen several similar codes from you, such as box for an oscillator when ob/os and for fibs in addition to the new one you added to check if price is near a moving average; so, I think you are the right person. But, not being a developer, the indicators seem hard to modify for my needs.

Specifically:

1. After the prices crosses above and closes above, plot two Median Prices (MP) on the chart as Cyan Squares or Yellow Squares on the identified bars:

A: First Median Price: the valley (lowest) between this cross above and the prior cross below.

B: Second Median Price: the bar when it Crossed and closed Above the 200-SMA.

2. For example, Apple crossed above the 200SMA on Feb 2nd, 2023. Prior to it, it cross below from above on Aug 30th, 2022.

A: First Lowest MP: Of candle when AAPL crossed above on a Daily chart was: HL2 on Jan 5, 2023.

B: 2nd Median Price of the candle when it Crossed Above (and closed above 200SMA): HL2 of Feb 2nd, 2023

3. Condition: Use the first cross (Above or Below) of the 4 bars near each other (input variable) and ignore the other within in the 4 bars; for cases of multiple up and downs. (or if you recommend different number of bars to ignore the noise).

4. Detect if the median price crossed above or below the 200SMA

5. Colors: If Crossed Above from below, plot Cyan squares, for the two Median Price of the Bars (MA Cross Above and the Lowest MP). And, Yellow Squares for the opposite scenario: the two Median Prices, when the prices crosses Below from Above, of the median price of the highest bar/candle.

6. Time-frame: entire chart (I usually use a 2-3 year, Daily; but can reduce to 1-year if there are system performance constraint. but plots on the entire chart, rather than last ones are highly desirable)

Any help would be greatly appreciated!

I hope this is a complete description of what I am trying to plot. Please let me know if I can clarify anything.

AAPL Daily

Could I make a request: Capture peak or valleys when a price crosses above or below a 200-SMA? I have seen several similar codes from you, such as box for an oscillator when ob/os and for fibs in addition to the new one you added to check if price is near a moving average; so, I think you are the right person. But, not being a developer, the indicators seem hard to modify for my needs.

Specifically:

1. After the prices crosses above and closes above, plot two Median Prices (MP) on the chart as Cyan Squares or Yellow Squares on the identified bars:

A: First Median Price: the valley (lowest) between this cross above and the prior cross below.

B: Second Median Price: the bar when it Crossed and closed Above the 200-SMA.

2. For example, Apple crossed above the 200SMA on Feb 2nd, 2023. Prior to it, it cross below from above on Aug 30th, 2022.

A: First Lowest MP: Of candle when AAPL crossed above on a Daily chart was: HL2 on Jan 5, 2023.

B: 2nd Median Price of the candle when it Crossed Above (and closed above 200SMA): HL2 of Feb 2nd, 2023

3. Condition: Use the first cross (Above or Below) of the 4 bars near each other (input variable) and ignore the other within in the 4 bars; for cases of multiple up and downs. (or if you recommend different number of bars to ignore the noise).

4. Detect if the median price crossed above or below the 200SMA

5. Colors: If Crossed Above from below, plot Cyan squares, for the two Median Price of the Bars (MA Cross Above and the Lowest MP). And, Yellow Squares for the opposite scenario: the two Median Prices, when the prices crosses Below from Above, of the median price of the highest bar/candle.

6. Time-frame: entire chart (I usually use a 2-3 year, Daily; but can reduce to 1-year if there are system performance constraint. but plots on the entire chart, rather than last ones are highly desirable)

Any help would be greatly appreciated!

I hope this is a complete description of what I am trying to plot. Please let me know if I can clarify anything.

AAPL Daily

Last edited: