This indicator simply plots on the chart the nearest rounded levels to the last close level.
The indicator has just two inputs:
- “level”: represents the value used to identify the rounded levels. For example, as shown in the image, with level=100 the drawn levels are 13000, 13100, etc. It is a decimal so it can be set for any underlying (forex, indexes, …).
- “skips”: indicates how many extra ceils and floors you want to plot above and below the last close price.
This v2 code has been edited to work correctly even on PRT v11.
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 28 29 30 31 32 33 34 35 36 |
// Settings: level = 100, skips = 0 // 09.11.2020 // Author: Daniele Maddaluno once floorBase = close once ceilBase = close price = close[1] if price < floorBase or price > ceilBase then frac = price/level rounded = round(frac) // computing floorBase and ceilBase (functions are not available in v10.3) if rounded > frac then ceilBase = rounded * level floorBase = (rounded-1) * level else floorBase = rounded * level ceilBase = (rounded+1) * level endif endif // Choose one of these chars to mark levels (see https://en.wikipedia.org/wiki/Dash): // ― - — ― ‒ // ~ ∼ ➖ ⁃ ✛ // • ● ○ ∙ ◦ IBar = barindex for skip = 0 to skips do skipSize = skip*level ceilLev = ceilBase + skipSize floorLev = floorBase - skipSize drawtext("◦", IBar, ceilLev, Dialog, Standard, 10) //coloured (rCeil, gCeil, bCeil, tCeil) drawtext("◦", IBar, floorLev, Dialog, Standard, 10) //coloured (rFloor, gFloor, bFloor, tFloor) next return |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials