Forums › ProRealTime English forum › ProBuilder support › Arrays & Same Candle Programming › Reply To: Arrays & Same Candle Programming
05/07/2024 at 9:06 PM
#232444
hi… see if this is getting anywhere!
druby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
// !!! default timeframe 1 minute timeframe(20minute, updateonclose) // update only every 20 minutes close20m = close // 20minute close barIndex20m = barindex // 20minute barindex timeframe(1minute ) // 1minute timeframe close1m = close // 1minute close if barIndex20m <> barIndex20m[1]then // end of 20minute bar! drawvline(barindex[20])style(dottedline,1) // denote with vertical line // calculate the 20minute bar average based on last 20 1minute bars avg1m = average[20](close1m) // display this average over the relative 15minute bar width drawsegment(barindex,avg1m,barindex[20],avg1m)style(dottedline,2)coloured("blue") // table variables print(close20m[1]) // this [1] aligns up 20m close with the avg1m value print(avg1m) // in table print(barindex20m) endif return close20m coloured("red")as"20m Close",close1m coloured("lime")as"1m close" |