Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- indicator('DR/IDR of Omega', overlay=true, max_lines_count=500, max_boxes_count=500, max_labels_count=500)
- import PineCoders/VisibleChart/4 as PCchart
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © TheMas7er and bmistiaen and TRSTNGLRD
- // Input options
- // {
- LS0='Solid', LS1='Dashed', LS2='Dotted'
- BX0='DR', BX1='IDR'
- XL0='Follow Time', XL1='Session End', XL2='ADR End', XL3='ODR End', XL4='RDR End'
- STDLT0='Dynamic',STDLT1='Static'
- // } Input options
- TIMEZONE = 'America/New_York'
- ONE_HOUR = 3600*1000
- ONE_DAY = 24*ONE_HOUR
- // Inputs
- // {
- var GRP1 = "Time Settings"
- //timings
- exchangeOffset = input.int(0,"Exchange Offset (hours)", group=GRP1)
- Omega2v1Time = input.session('0430-0935', 'Omega2v1 Time', group=GRP1)
- Omega2v1Extend = input.session('0935-1600', 'Omega2v1 Lines Time', group=GRP1)
- Omega4v1Time = input.session('0930-1030', 'Omega4v1 Time', group=GRP1)
- Omega4v1Extend = input.session('1030-1600', 'Omega4v1 Lines Time', group=GRP1)
- Omega4v2Time = input.session('1930-2030', 'Omega4v2 Time', group=GRP1)
- Omega4v2Extend = input.session('2030-0200', 'Omega4v2 Lines Time', group=GRP1)
- Omega8v1Time = input.session('0300-0400', 'Omega8v1 Time', group=GRP1)
- Omega8v1Extend = input.session('0400-0830', 'Omega8v1 Lines Time', group=GRP1)
- Omega8v2Time = input.session('2130-2235', 'Omega8v2 Time', group=GRP1)
- Omega8v2Extend = input.session('2235-0245', 'Omega8v2 Lines Time', group=GRP1)
- Omega8v3Time = input.session('1130-1235', 'Omega8v3 Time', group=GRP1)
- Omega8v3Extend = input.session('1235-1645', 'Omega8v3 Lines Time', group=GRP1)
- Omega16v1Time = input.session('1845-1935', 'Omega16v1 Time', group=GRP1)
- Omega16v1Extend = input.session('1935-2115', 'Omega16v1 Lines Time', group=GRP1)
- Omega16v2Time = input.session('2130-2220', 'Omega16v2 Time', group=GRP1)
- Omega16v2Extend = input.session('2220-0000', 'Omega16v2 Lines Time', group=GRP1)
- Omega16v3Time = input.session('0015-0105', 'Omega16v3 Time', group=GRP1)
- Omega16v3Extend = input.session('0105-0245', 'Omega16v3 Lines Time', group=GRP1)
- Omega16v4Time = input.session('0300-0350', 'Omega16v4 Time', group=GRP1)
- Omega16v4Extend = input.session('0350-0545', 'Omega16v4 Lines Time', group=GRP1)
- Omega16v5Time = input.session('0600-0650', 'Omega16v5 Time', group=GRP1)
- Omega16v5Extend = input.session('0650-0815', 'Omega16v5 Lines Time', group=GRP1)
- Omega16v6Time = input.session('0845-0935', 'Omega16v6 Time', group=GRP1)
- Omega16v6Extend = input.session('0935-1115', 'Omega16v6 Lines Time', group=GRP1)
- Omega16v7Time = input.session('1130-1220', 'Omega16v7 Time', group=GRP1)
- Omega16v7Extend = input.session('1220-1400', 'Omega16v7 Lines Time', group=GRP1)
- Omega16v8Time = input.session('1415-1505', 'Omega16v8 Time', group=GRP1)
- Omega16v8Extend = input.session('1505-1645', 'Omega16v8 Lines Time', group=GRP1)
- var GRP2 = "General Settings"
- //lines
- showOmega2v1 = input.bool(true, 'Omega2v1', group=GRP2, inline='session')
- showOmega4v1 = input.bool(true, 'Omega4v1', group=GRP2, inline='session')
- showOmega4v2 = input.bool(true, 'Omega4v2', group=GRP2, inline='session')
- showOmega8v1 = input.bool(true, 'Omega8v1', group=GRP2, inline='session')
- showOmega8v2 = input.bool(true, 'Omega8v2', group=GRP2, inline='session')
- showOmega8v3 = input.bool(true, 'Omega8v3', group=GRP2, inline='session')
- showOmega16v1 = input.bool(true, 'Omega16v1', group=GRP2, inline='session')
- showOmega16v2 = input.bool(true, 'Omega16v2', group=GRP2, inline='session')
- showOmega16v3 = input.bool(true, 'Omega16v3', group=GRP2, inline='session')
- showOmega16v4 = input.bool(true, 'Omega16v4', group=GRP2, inline='session')
- showOmega16v5 = input.bool(true, 'Omega16v5', group=GRP2, inline='session')
- showOmega16v6 = input.bool(true, 'Omega16v6', group=GRP2, inline='session')
- showOmega16v7 = input.bool(true, 'Omega16v7', group=GRP2, inline='session')
- showOmega16v8 = input.bool(true, 'Omega16v8', group=GRP2, inline='session')
- drlines = input.bool(true, 'Show DR Lines ?', group=GRP2)
- idrlines = input.bool(true, 'Show IDR Lines ?', group=GRP2)
- middledrline = input.bool(false, 'Show Middle DR Line ?', group=GRP2)
- middleidrline = input.bool(true, 'Show Middle IDR Line ?', group=GRP2)
- openline = input.bool(true, 'Show Opening Line ?', group=GRP2, inline='openline', tooltip='Shows the Opening line of the Defining Range.\n- Extend: Extends the drawing of the Opening line into the RDR/ODR Lines Time.')
- extendopLines = input.bool(true, 'Extend', group=GRP2, inline='openline') // Extend, follow price
- extendopLinesType = input.string(XL1, '', options=[XL0,XL1,XL2,XL3,XL4], group=GRP2, inline='openline')
- showBackground = input.bool(true, 'Show DR/IDR Box ?', group=GRP2)
- boxType = input.string(BX1, 'Box DR or IDR ?', options=[BX0,BX1], group=GRP2)
- extenddrLines = input.bool(true, 'Extend DR Lines ?', group=GRP2)
- extendidrLines = input.bool(true, 'Extend IDR Lines ?', group=GRP2)
- showAllHistory = input.bool(false, 'Show complete history ?', 'Might cause a slight drawing delay when panning/moving/zooming the chart.', group=GRP2)
- useBoxColors = input.bool(false, 'Box color based on open and close', 'If unchecked, it will default to the selected Box Background Color', group=GRP2)
- extendToEndOfRDR = input.bool(false, 'Extend lines of all ranges to end of most recent Regular session?', group=GRP2)
- showStdLines = input.bool(true, 'Show STD Lines ?', group=GRP2, inline='stdlines', tooltip='Shows the Standard Deviation lines in 0.5 IDR range increments.\n- All = Shows all the STD lines on previous sessions.\n- Labels = Show STD level labels.\n- Dropdown = Choose between Dynamic or Static STD lines.')
- showStdLinesAll = input.bool(true, 'All', group=GRP2, inline='stdlines')
- showStdLineLabels = input.bool(true, 'Labels', group=GRP2, inline='stdlines')
- stdLineType = input.string(STDLT1, '', [STDLT0,STDLT1], group=GRP2, inline='stdlines')
- stdLineDynamicExtraPos = input.int(0, 'Dynamic (+)', minval=0, group=GRP2, inline='stdlinedynamic', tooltip='Dynamic STD Lines.\nDynamically draw STD lines around price action. Progresses with price.\n- (+) = Number of positive extra levels to draw in addition to the lines that are automatically drawn around price action.\n- (-) = Number of negative extra levels to draw in addition to the lines that are automatically drawn around price action.\n- Auto = Automatically determine number of STD lines that need to be drawn. Follows price action.')
- stdLineDynamicExtraNeg = input.int(0, '(-)', minval=0, group=GRP2, inline='stdlinedynamic')
- stdLineDynamicExtraAuto = input.bool(false, 'Auto', group=GRP2, inline='stdlinedynamic')
- stdLineStaticExtraPos = input.int(10, 'Static (+)', minval=0, group=GRP2, inline='stdlinestatic', tooltip='Static STD Lines.\nDraws a fixed number of STD lines.\n- (+) = Number of positive levels to draw.\n- (-) = Number of negative levels to draw.')
- stdLineStaticExtraNeg = input.int(10, '(-)', minval=0, group=GRP2, inline='stdlinestatic')
- var GRP3 = "Styles"
- linesWidth = input.int(1, 'Box And Lines Width ?', minval=1, maxval=4, group=GRP3)
- drLineColor = input.color(#9b8269, 'DR Line Color', group=GRP3, inline='drline')
- drLineStyle = input.string(LS0, 'Style', options=[LS0,LS1,LS2], group=GRP3, inline='drline')
- idrLineColor = input.color(#9b8269, 'IDR Line Color', group=GRP3, inline='idrline')
- idrLineStyle = input.string(LS1, 'Style', options=[LS0,LS1,LS2], group=GRP3, inline='idrline')
- middleLineColor = input.color(#d3d2d0, 'Middle Line Color', group=GRP3, inline='midline')
- middleLineStyle = input.string(LS2, 'Style', options=[LS0,LS1,LS2], group=GRP3, inline='midline')
- opLineColor = input.color(#33658a, 'Opening Line', group=GRP3, inline='openline', tooltip='Opening line:\n- Color\n- Style\n- Width')
- opLineStyle = input.string(LS2, '', options=[LS0,LS1,LS2], group=GRP3, inline='openline')
- stdLineColor = input.color(#d3d2d0, 'STD Lines', group=GRP3, inline='stdline', tooltip='Standard deviation lines:\n- Color\n- Style\n- Width')
- stdLineStyle = input.string(LS2, '', options=[LS0,LS1,LS2], group=GRP3, inline='stdline')
- backgroundColor = input.color(color.new(color.gray, 75), 'Box Background Color', group=GRP3)
- boxBorderSize = input.int(0, title="Box border size", minval=0, group=GRP3)
- upBoxColor = input.color(color.new(color.green, 85), 'Up box', group=GRP3, inline='upbox')
- upBorderColor = input.color(color.green, 'border', group=GRP3, inline='upbox')
- downBoxColor = input.color(color.new(color.red, 85), 'Down box', group=GRP3, inline='downbox')
- downBorderColor = input.color(color.red, 'border', group=GRP3, inline='downbox')
- // } Inputs
- // Constants
- // {
- exchangeOffsetMS = exchangeOffset * 3600000
- // } Constants
- // Variables {
- var int startTime = na
- var int endTime = na
- var string currentSession = na
- var line lowrdrl = na
- var line highrdrl = na
- var line lowridrl = na
- var line highridrl = na
- var line leftrdrl = na
- var line rightrdrl = na
- var line middlerdrl = na
- var line middleridrl = na
- var line drLineOpen = na
- var box bgBox = na
- var line[] stdLines = array.new<line>()
- var float[] stdLevels = array.new<float>()
- var label[] stdLabels = array.new<label>()
- var float rdrlow = na
- var float rdrhigh = na
- var float ridrlow = na
- var float ridrhigh = na
- var float rdrmiddle = na
- var float ridrmiddle = na
- var float sessionOpen = na
- var float regidrlow = na
- var float regidrhigh = na
- var float sessionHigh = na
- var float sessionLow = na
- var int stdLinesStartTime = na
- var int stdLinesStopTime = na
- var bool use_m5 = false
- // } Variables
- // Functions {
- f_insession(_session) =>
- not na(time(timeframe.period, _session, TIMEZONE))
- f_timestrToHM(_timeStr) =>
- var int hourInt = na
- var int minuteInt = na
- if str.length(_timeStr) == 4
- hourInt := int(str.tonumber(str.substring(_timeStr, 0, 2)))
- minuteInt := int(str.tonumber(str.substring(_timeStr, 2, 4)))
- [hourInt, minuteInt]
- f_sessionTime(_session, _timezone=syminfo.timezone, _part) =>
- var int ts = na
- if str.length(_session) == 9 and (_part == 0 or _part == 1)
- arraySessionSplit = str.split(_session, '-')
- timeStrTo = array.get(arraySessionSplit, _part)
- [hourTo, minuteTo] = f_timestrToHM(timeStrTo)
- ts := timestamp(_timezone, year, month, dayofmonth, hourTo, minuteTo)
- ts
- f_sessionStartTime(_session, _timezone=syminfo.timezone) => f_sessionTime(_session, _timezone, 0)
- f_sessionStopTime(_session, _timezone=syminfo.timezone) => f_sessionTime(_session, _timezone, 1)
- f_timestamp_to_date(int _ts = na, string _tz = na) => timestamp(_tz, year(_ts, _tz), month(_ts, _tz), dayofmonth(_ts, _tz))
- f_lineStyle(_inputOption) =>
- switch(_inputOption)
- LS0 => line.style_solid
- LS1 => line.style_dashed
- LS2 => line.style_dotted
- => line.style_solid
- f_newline(_color, _style) => line.new(na, na, na, na, xloc=xloc.bar_time, color=_color, style=_style, width=linesWidth)
- f_newdrline() => f_newline(drLineColor, f_lineStyle(drLineStyle))
- f_newidrline() => f_newline(idrLineColor, f_lineStyle(idrLineStyle))
- f_newmdline() => f_newline(middleLineColor, f_lineStyle(middleLineStyle))
- f_newopline() => f_newline(opLineColor, f_lineStyle(opLineStyle))
- f_newstdine() => f_newline(stdLineColor, f_lineStyle(stdLineStyle))
- f_newbox() => box.new(na, na, na, na, xloc=xloc.bar_time, bgcolor=backgroundColor, border_width=boxBorderSize)
- f_moveLine(_line, _x1, _y, _x2) => line.set_xy1(_line, _x1 + exchangeOffsetMS, _y), line.set_xy2(_line, _x2 + exchangeOffsetMS, _y), _line
- f_movebox(_box, _left, _top, _right, _bottom, _bordercolor, _bgcolor) => box.set_lefttop(_box, _left + exchangeOffsetMS, _top), box.set_rightbottom(_box, _right + exchangeOffsetMS, _bottom), box.set_border_color(_box, _bordercolor), box.set_bgcolor(_box, _bgcolor)
- f_newLabel() => label.new(na, na, '', xloc = xloc.bar_time, yloc=yloc.price, style=label.style_label_left, color=color(na), textcolor=stdLineColor)
- f_moveLabel(_label, _x, _y, _text) =>
- label.set_xy(_label, _x, _y)
- label.set_text(_label, _text)
- _label
- f_drawStdLine(_fromTime, _toTime, _level, float _stdLabelValue=na) =>
- if not na(_level)
- if not array.includes(stdLevels, _level)
- array.push(stdLevels, _level)
- array.push(stdLines, f_moveLine(f_newstdine(), _fromTime, _level, _toTime))
- if showStdLineLabels
- array.push(stdLabels, f_moveLabel(f_newLabel(), _toTime, _level, str.format('{0}',_stdLabelValue)))
- f_drawStdLines(_fromTime, _toTime, bool _clear = false) =>
- var float stdStepFactor = 0.5
- var float stdStep = na
- var float stdLevel = na
- var float stdLabelValue = na
- var int nrLevels = na
- var int nrLevelsPos = na
- var int nrLevelsNeg = na
- if _clear and not showStdLinesAll and array.size(stdLevels) > 0
- // If we don't need to show all the lines, delete them each time we clear. If we do need to show all the previous lines, don't delete them.
- for tmpIndex = 0 to array.size(stdLines)-1
- line.delete(array.get(stdLines, tmpIndex))
- if showStdLineLabels
- label.delete(array.get(stdLabels, tmpIndex))
- if _clear
- array.clear(stdLevels)
- array.clear(stdLines)
- if showStdLineLabels
- array.clear(stdLabels)
- stdStep := math.abs(regidrhigh-regidrlow) * stdStepFactor
- if stdStep != 0
- switch stdLineType
- STDLT0 =>
- nrLevelsPos := math.ceil(math.max(sessionHigh - regidrhigh, 0) / stdStep) + (stdLineDynamicExtraAuto ? 0 : stdLineDynamicExtraPos)
- nrLevelsNeg := math.ceil(math.max(regidrlow - sessionLow, 0) / stdStep) + (stdLineDynamicExtraAuto ? 0 : stdLineDynamicExtraNeg)
- STDLT1 =>
- nrLevelsPos := stdLineStaticExtraPos
- nrLevelsNeg := stdLineStaticExtraNeg
- // Positive lines
- if nrLevelsPos >= 1
- for cnt = 1 to nrLevelsPos
- stdLevel := regidrhigh + (cnt * stdStep)
- stdLabelValue := cnt * stdStepFactor
- f_drawStdLine(_fromTime, _toTime, stdLevel, stdLabelValue)
- // Negative lines
- if nrLevelsNeg >= 1
- for cnt = 1 to nrLevelsNeg
- stdLevel := regidrlow - (cnt * stdStep)
- stdLabelValue := cnt * (-stdStepFactor)
- f_drawStdLine(_fromTime, _toTime, stdLevel, stdLabelValue)
- // } Functions
- // Use the 5 minute timeframe if the chart timeframe is lower than 5m
- if barstate.isfirst
- use_m5 := timeframe.in_seconds() < 300
- [m5_open, m5_high, m5_low, m5_close] = request.security(syminfo.tickerid, '5', [open, high, low, close], lookahead = barmerge.lookahead_on)
- open_value = use_m5 ? m5_open : open
- high_value = use_m5 ? m5_high : high
- low_value = use_m5 ? m5_low : low
- close_value = use_m5 ? m5_close : close
- inOmega2v1Session = f_insession(Omega2v1Time) and showOmega2v1
- inOmega2v1Extend = f_insession(Omega2v1Extend) and showOmega2v1
- inOmega4v1Session = f_insession(Omega4v1Time) and showOmega4v1
- inOmega4v1Extend = f_insession(Omega4v1Extend) and showOmega4v1
- inOmega4v2Session = f_insession(Omega4v2Time) and showOmega4v2
- inOmega4v2Extend = f_insession(Omega4v2Extend) and showOmega4v2
- inOmega8v1Session = f_insession(Omega8v1Time) and showOmega8v1
- inOmega8v1Extend = f_insession(Omega8v1Extend) and showOmega8v1
- inOmega8v2Session = f_insession(Omega8v2Time) and showOmega8v2
- inOmega8v2Extend = f_insession(Omega8v2Extend) and showOmega8v2
- inOmega8v3Session = f_insession(Omega8v3Time) and showOmega8v3
- inOmega8v3Extend = f_insession(Omega8v3Extend) and showOmega8v3
- inOmega16v1Session = f_insession(Omega16v1Time) and showOmega16v1
- inOmega16v1Extend = f_insession(Omega16v1Extend) and showOmega16v1
- inOmega16v2Session = f_insession(Omega16v2Time) and showOmega16v2
- inOmega16v2Extend = f_insession(Omega16v2Extend) and showOmega16v2
- inOmega16v3Session = f_insession(Omega16v3Time) and showOmega16v3
- inOmega16v3Extend = f_insession(Omega16v3Extend) and showOmega16v3
- inOmega16v4Session = f_insession(Omega16v4Time) and showOmega16v4
- inOmega16v4Extend = f_insession(Omega16v4Extend) and showOmega16v4
- inOmega16v5Session = f_insession(Omega16v5Time) and showOmega16v5
- inOmega16v5Extend = f_insession(Omega16v5Extend) and showOmega16v5
- inOmega16v6Session = f_insession(Omega16v6Time) and showOmega16v6
- inOmega16v6Extend = f_insession(Omega16v6Extend) and showOmega16v6
- inOmega16v7Session = f_insession(Omega16v7Time) and showOmega16v7
- inOmega16v7Extend = f_insession(Omega16v7Extend) and showOmega16v7
- inOmega16v8Session = f_insession(Omega16v8Time) and showOmega16v8
- inOmega16v8Extend = f_insession(Omega16v8Extend) and showOmega16v8
- inSession = inOmega2v1Session or inOmega4v1Session or inOmega4v2Session or inOmega8v1Session or inOmega8v2Session or inOmega8v3Session or inOmega16v1Session or inOmega16v2Session or inOmega16v3Session or inOmega16v4Session or inOmega16v5Session or inOmega16v6Session or inOmega16v7Session or inOmega16v8Session
- inExtend = inOmega2v1Extend or inOmega4v1Extend or inOmega4v2Extend or inOmega8v1Extend or inOmega8v2Extend or inOmega8v3Extend or inOmega16v1Extend or inOmega16v2Extend or inOmega16v3Extend or inOmega16v4Extend or inOmega16v5Extend or inOmega16v6Extend or inOmega16v7Extend or inOmega16v8Extend
- enterSession = inSession and not inSession[1]
- enterExtend = inExtend and not inExtend[1]
- leaveOmega4v1Session = not inOmega4v1Session and inOmega4v1Session[1]
- enterOmega4v1Extend = inOmega4v1Extend and not inOmega4v1Extend[1]
- if timeframe.isintraday and (PCchart.barIsVisible() or not showAllHistory)
- if enterSession
- currentSession := inOmega2v1Session ? Omega2v1Time : inOmega4v1Session ? Omega4v1Time : inOmega8v1Session ? Omega8v1Time : inOmega4v2Session ? Omega4v2Time : inOmega8v2Session ? Omega8v2Time : inOmega8v3Session ? Omega8v3Time : inOmega16v1Session ? Omega16v1Time : inOmega16v2Session ? Omega16v2Time : inOmega16v3Session ? Omega16v3Time : inOmega16v4Session ? Omega16v4Time : inOmega16v5Session ? Omega16v5Time : inOmega16v6Session ? Omega16v6Time : inOmega16v7Session ? Omega16v7Time : inOmega16v8Session ? Omega16v8Time : na
- else if enterExtend
- currentSession := inOmega2v1Extend ? Omega2v1Extend : inOmega4v1Extend ? Omega4v1Extend : inOmega8v1Extend ? Omega8v1Extend : inOmega4v2Extend ? Omega4v2Extend : inOmega8v2Extend ? Omega8v2Extend : inOmega8v3Extend ? Omega8v3Extend : inOmega16v1Extend ? Omega16v1Extend : inOmega16v2Extend ? Omega16v2Extend : inOmega16v3Extend ? Omega16v3Extend : inOmega16v4Extend ? Omega16v4Extend : inOmega16v5Extend ? Omega16v5Extend : inOmega16v6Extend ? Omega16v6Extend : inOmega16v7Extend ? Omega16v7Extend : inOmega16v8Extend ? Omega16v8Extend : na
- if inSession
- // Initialize levels
- if not inSession[1]
- startTime := time
- sessionOpen := open_value
- rdrhigh := high_value
- rdrlow := low_value
- ridrlow := math.min(open_value, close_value)
- ridrhigh := math.max(open_value, close_value)
- // Initialize drawing objects
- if showBackground
- bgBox := f_newbox()
- if drlines
- highrdrl := f_newdrline()
- lowrdrl := f_newdrline()
- if idrlines
- highridrl := f_newidrline()
- lowridrl := f_newidrline()
- if middledrline
- middlerdrl := f_newmdline()
- if middleidrline
- middleridrl := f_newmdline()
- if openline
- drLineOpen := f_newopline()
- // Calculate levels
- rdrhigh := math.max(high_value, rdrhigh)
- rdrlow := math.min(low_value, rdrlow)
- ridrhigh := math.max(open_value, close_value, ridrhigh)
- ridrlow := math.min(open_value, close_value, ridrlow)
- rdrmiddle := math.avg(rdrhigh, rdrlow)
- ridrmiddle := math.avg(ridrhigh, ridrlow)
- if leaveOmega4v1Session
- regidrhigh := ridrhigh
- regidrlow := ridrlow
- if inOmega4v1Extend
- stdLinesStartTime := f_sessionStartTime(Omega4v1Extend, TIMEZONE)
- stdLinesStopTime := f_sessionStopTime(Omega8v1Extend, TIMEZONE) + ONE_DAY * (dayofweek == dayofweek.friday and syminfo.type != 'crypto' ? 3 : 1)
- if enterOmega4v1Extend
- // Initialize session high/low.
- sessionHigh := high_value
- sessionLow := low_value
- // Remember high/low since session started. Needed for drawing STD levels. Also keep high low beyond Extend.
- sessionHigh := math.max(sessionHigh, high_value)
- sessionLow := math.min(sessionLow, low_value)
- // Draw objects
- if showBackground and inSession
- boxUp = close_value > sessionOpen
- boxBorderColor = useBoxColors ? (boxUp ? upBorderColor : downBorderColor) : backgroundColor
- boxBackgroundColor = useBoxColors ? (boxUp ? upBoxColor : downBoxColor) : backgroundColor
- boxHigh = boxType==BX0 ? rdrhigh : ridrhigh
- boxLow = boxType==BX0 ? rdrlow : ridrlow
- f_movebox(bgBox, startTime, boxHigh, time, boxLow, boxBorderColor, boxBackgroundColor)
- if extendToEndOfRDR
- if syminfo.type == 'warrant' or syminfo.type == 'structured' or syminfo.type == 'right'
- endTime := time
- else if time > (timenow - 2 * ONE_DAY) // no need to call functions every bar. Only start checking 2 days ago.
- if f_timestamp_to_date(f_sessionStopTime(currentSession, TIMEZONE), TIMEZONE) == f_timestamp_to_date(timenow, TIMEZONE) //timenow_date
- endTime := f_sessionStopTime(Omega4v1Extend, TIMEZONE)
- else
- endTime := time
- else
- endTime := time
- else
- endTime := time
- if drlines and (inSession or (extenddrLines and inExtend))
- f_moveLine(highrdrl, startTime, rdrhigh, endTime)
- f_moveLine(lowrdrl, startTime, rdrlow, endTime)
- if middledrline
- f_moveLine(middlerdrl, startTime, rdrmiddle, endTime)
- if idrlines and (inSession or (extendidrLines and inExtend))
- f_moveLine(highridrl, startTime, ridrhigh, endTime)
- f_moveLine(lowridrl, startTime, ridrlow, endTime)
- if middleidrline
- f_moveLine(middleridrl, startTime, ridrmiddle, endTime)
- if openline and (inSession or (extendopLines and inExtend))
- f_moveLine(drLineOpen, startTime, sessionOpen, endTime)
- if showStdLines
- f_drawStdLines(stdLinesStartTime, stdLinesStopTime, enterOmega4v1Extend)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement