Hello, on a 5 minute chart I want to inspect the high, low, 1st open, last close for the last three candles and draw that as a separate panel indicator on the 5 minute chart.
Then the next 5 minute period and so on.
(That is, a rolling 15 minute bar on a 5 minute chart. Conventionally 15m bars are only :00, :15, :30, :45.)
So for the 3 candle ‘triplet’ the data generated is the max price high, min low across the three candles, the opening price at the start of the 15 minute ‘triplet’ and the closing price at the end of the ‘triplet’.
I’ve attached my code so far – it works and gives an exact representation of PRICE candles generated in this way, :00, :15, :30, :45 candles match exactly the corresponding 15 minute chart data.
My problem is: I do not get the correct result when I try to adjust my code for Heiken-Ashi output: it doesn’t match anything if I cross reference the 15m HA chart.
Can anyone suggest code that takes my triplet data and draws the Heiken-Ashi candle version?
Thank you very much
Generates 'triplet' data for last 3 bars
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Uses the 5m bars over the last 15m period to create a 15m bar EACH 5 MINUES
// Each price point:
TripletLow=Lowest[3](Low)
TripletHigh=Highest[3](High)
TripletOpen=Open[2]
TripletClose=Close
// Draw Bars
ifTripletClose>TripletOpenthen
DrawCandle(TripletOpen,TripletHigh,TripletLow,TripletClose)Coloured(0,200,0)// Green candle
else
DrawCandle(TripletOpen,TripletHigh,TripletLow,TripletClose)Coloured(200,0,0)// Red candle
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue