Forums › ProRealTime English forum › ProBuilder support › Sum open to close of candles in a defined time range? › Reply To: Sum open to close of candles in a defined time range?
07/14/2019 at 9:24 AM
#102543
There you go:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
ONCE StartTime = 080000 ONCE EndTime = 100000 ONCE BullCount = 0 ONCE BearCount = 0 Bullish = close > open Bearish = close < open IF Time = StartTime THEN BullCount = 0 BearCount = 0 ENDIF IF time >= StartTime AND time <= EndTime THEN IF Bullish THEN BullCount = BullCount + (close - open) ENDIF IF Bearish THEN BearCount = BearCount + (open - close) ENDIF ENDIF |
after EndTime both bullish and bearish candlesticks will have been tallied.
Next day the counting will be restarded at StartTime.