0

Want to write a pine script that gives an alert after 8 consecutive similar candles and gives an alert after the 8th or on the 8th candle.

Bjorn Mistiaen
  • 6,459
  • 3
  • 18
  • 42
Nkosi
  • 3
  • 3
  • You can share a full script for this or suggest a source where i can get such information.thank you – Nkosi Jul 11 '21 at 05:41

1 Answers1

0
greenCandle = close > open ? 1 : 0

cond = sum(greenCandle, 8) == 8

alertcondition(cond, title = "Alert", message = "8th green!")
rumpypumpydumpy
  • 3,435
  • 2
  • 5
  • 10