Swing high pivot with two bar strength


Category:
0
0

Hi Pete

Can you please assist on how can i pot an arrow or color this block where the arrow is pointed.  Condition would be after 2 red block a white block followed by another 2 red blocks?   I tried to in rabbit hole where close[-1] > close[-2] but not getting anything.

Thanks

Attachments:
Marked as spam
Posted by (Questions: 3, Answers: 3)
Asked on January 25, 2023 7:28 am
119 views
0
Private answer

This solution has absolutely nothing to do with the chart type. You can use this on candles, bars, ticks, range or renko charts. The code is exactly the same and the description is exactly the same.

The key here is to recognize that for Renko bars the color is determined by comparing current close to previous close. Most swing high pivot formations are based on a comparison of the highs. So I will provide both versions here:

plot swingPivot = close > close[1] and close[1] > close[2] and close > close[-1] and close[-1] > close[-2];
swingPivot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Here is the more standard version used for candle and bar charts:

plot swingPivot = high > high[1] and high[1] > high[2] and high > high[-1] and high[-1] > high[-2];
swingPivot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Your screenshot was not complete. So it was impossible for me to test this out on your specific example. And had I been able to do that I would have also included a screenshot of my own. Keep that in mind next time you include a screenshot in a forum. Include the full view of the chart so folks have every detail they need to test it out on their end and confirm their solutions works for your specific example.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 25, 2023 9:44 am