Market Tide

TheScalpingAnt · study · 254 行 · 点赞 72 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

//@version=6
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
indicator("Market Tide", shorttitle = "MarketTide", overlay = false, explicit_plot_zorder = true, max_boxes_count = 500)
LVL       = 50.0
BAND_LOW  = 30.0
BAND_HIGH = 100.0
GG = "General"
lockTf = input.bool(true, "Restrict to the 2h timeframe", tooltip = "On. The script draws nothing on a timeframe other than 2 hours and shows a short message instead. The 2h chart is the timeframe this indicator was built and tested on. Off. The script draws on any timeframe, at the user's own risk, because the layered reads are calibrated on 2h bars.", group = GG, display = display.none)
confirmed = input.bool(true, "Wait for candle close", tooltip = "Off. Everything follows the forming bar: the layers, the RSI, the trend request and the signals, so a marker can appear and disappear before the bar closes. On. Nothing moves inside the forming bar: the signals print only once the bar has closed and the trend uses the last closed higher timeframe bar.", group = GG, display = display.none)
tfOk   = not lockTf or (timeframe.isminutes and timeframe.multiplier == 120)
src    = not tfOk ? na : confirmed ? (barstate.isconfirmed ? close : close[1]) : close
rsiSrc = src
G1 = "Layer 1 (bottom) - white / black"
G2 = "Layer 2 - bright green / red"
G3 = "Layer 3 - green / dark red"
G4 = "Layer 4 - light gray / dark gray"
G5 = "Layer 5 (top) - light gray / dark gray"
GT = "Top line"
GO = "Oscillator"
GZ = "Zones"
GS = "Signals"
GD = "Dashboard"
show1 = input.bool(true, "Show", tooltip = "Turn this layer on or off.", group = G1, display = display.none)
up1   = input.color(#FFFFFF, "Colour above", tooltip = "Fill colour while the fast EMA of this pair is above the slow one.", group = G1, display = display.none)
dn1   = input.color(#000000, "Colour below", tooltip = "Fill colour while the fast EMA is below the slow one.", group = G1, display = display.none)
t1    = input.int(0, "Transparency", minval = 0, maxval = 100, tooltip = "0 = solid fill, 100 = invisible.", group = G1, display = display.none)
show2 = input.bool(true, "Show", tooltip = "Turn this layer on or off.", group = G2, display = display.none)
up2   = input.color(#00FF15, "Colour above", tooltip = "Fill colour while the fast EMA of this pair is above the slow one.", group = G2, display = display.none)
dn2   = input.color(#FF0000, "Colour below", tooltip = "Fill colour while the fast EMA is below the slow one.", group = G2, display = display.none)
t2    = input.int(0, "Transparency", minval = 0, maxval = 100, tooltip = "0 = solid fill, 100 = invisible.", group = G2, display = display.none)
show3 = input.bool(true, "Show", tooltip = "Turn this layer on or off.", group = G3, display = display.none)
up3   = input.color(#3E9E30, "Colour above", tooltip = "Fill colour while the fast EMA of this pair is above the slow one.", group = G3, display = display.none)
dn3   = input.color(#800101, "Colour below", tooltip = "Fill colour while the fast EMA is below the slow one.", group = G3, display = display.none)
t3    = input.int(0, "Transparency", minval = 0, maxval = 100, tooltip = "0 = solid fill, 100 = invisible.", group = G3, display = display.none)
show4 = input.bool(true, "Show", tooltip = "Turn this layer on or off.", group = G4, display = display.none)
up4   = input.color(#D1D4DC, "Colour above", tooltip = "Fill colour while the fast EMA of this pair is above the slow one.", group = G4, display = display.none)
dn4   = input.color(#2A2E39, "Colour below", tooltip = "Fill colour while the fast EMA is below the slow one.", group = G4, display = display.none)
t4    = input.int(0, "Transparency", minval = 0, maxval = 100, tooltip = "0 = solid fill, 100 = invisible.", group = G4, display = display.none)
show5 = input.bool(true, "Show", tooltip = "Turn this layer on or off.", group = G5, display = display.none)
up5   = input.color(#D1D4DC, "Colour above", tooltip = "Fill colour while the fast EMA of this pair is above the slow one.", group = G5, display = display.none)
dn5   = input.color(#2A2E39, "Colour below", tooltip = "Fill colour while the fast EMA is below the slow one.", group = G5, display = display.none)
t5    = input.int(0, "Transparency", minval = 0, maxval = 100, tooltip = "0 = solid fill, 100 = invisible.", group = G5, display = display.none)
topColUp  = input.color(#FFFFFF, "Colour when the 360 EMA is above", tooltip = "Colour of the top line while the 360 EMA is above it: the healthy uptrend state.", group = GT, display = display.none)
topColDn  = input.color(#000000, "Colour when the 360 EMA is below", tooltip = "Colour of the top line while the 360 EMA is below it: the downtrend state.", group = GT, display = display.none)
topStyleS = input.string("Solid", "Line style (Solid / Dashed / Dotted)", options = ["Solid", "Dotted", "Dashed"], tooltip = "Solid. Dashed draws one bar in two, dotted one bar in three.", group = GT, display = display.none)
topWidth  = input.int(3, "Line width", minval = 1, maxval = 10, tooltip = "Thickness of the top line.", group = GT, display = display.none)
oscCol    = input.color(#000000, "Colour when the colouring below is off", tooltip = "Colour of the RSI when the colouring by side of the level is off.", group = GO, display = display.none)
oscColor  = input.bool(true, "Colour the RSI above / below the level", tooltip = "Green above the level and red below it, switching exactly at the level.", group = GO, display = display.none)
oscUpCol  = input.color(#00FF15, "Colour above the level", tooltip = "Colour of the RSI while it is above the level.", group = GO, display = display.none)
oscDnCol  = input.color(#FF0000, "Colour below the level", tooltip = "Colour of the RSI while it is below the level.", group = GO, display = display.none)
oscGradT1 = input.int(0, "Gradient: transparency at the RSI", minval = 0, maxval = 100, tooltip = "Opacity of the shading where it meets the RSI line. 0 = solid.", group = GO, display = display.none)
oscGradT2 = input.int(65, "Gradient: transparency at the level", minval = 0, maxval = 100, tooltip = "Opacity of the shading where it fades out at the level. 65 = soft fade, 0 = solid block.", group = GO, display = display.none)
oscWidth  = input.int(1, "RSI line width", minval = 1, maxval = 10, tooltip = "Thickness of the RSI line.", group = GO, display = display.none)
plOn      = input.bool(true, "Show the RSI price line", tooltip = "Thin line that follows the RSI value to the right of the last bar, in the RSI's current colour.", group = GO, display = display.none)
plStyleS  = input.string("Dotted", "Price line style", options = ["Dotted", "Dashed", "Solid"], tooltip = "Dotted, dashed or solid price line.", group = GO, display = display.none)
showBg   = input.bool(false, "Show the zone below the level", tooltip = "On. Paints the area between the level and the low band. Off by default.", group = GZ, display = display.none)
bgCol    = input.color(#710A0A, "Zone below colour", tooltip = "Colour of the zone between the level and the low band.", group = GZ, display = display.none)
bgT      = input.int(0, "Zone below transparency", minval = 0, maxval = 100, tooltip = "0 is a solid block, 100 is invisible.", group = GZ, display = display.none)
showBgUp = input.bool(false, "Show the zone above the level", tooltip = "On. Paints the area between the level and the high band. Off by default.", group = GZ, display = display.none)
bgUpCol  = input.color(#268C17, "Zone above colour", tooltip = "Colour of the zone above the level.", group = GZ, display = display.none)
bgUpT    = input.int(0, "Zone above transparency", minval = 0, maxval = 100, tooltip = "0 is a solid block, 100 is invisible.", group = GZ, display = display.none)
showSig   = input.bool(true, "Show signals", group = GS, display = display.none)
sigUpCol  = input.color(#00FF15, "Long, strong trend", tooltip = "Colour of a long signal that goes with the trend line.", group = GS, display = display.none)
sigDnCol  = input.color(#FF0000, "Short, strong trend", tooltip = "Colour of a short signal that goes with the trend line.", group = GS, display = display.none)
sigUpWeak = input.color(#3FDE29, "Long, weak trend", tooltip = "Colour of a long signal that fights the trend line.", group = GS, display = display.none)
sigDnWeak = input.color(#B10606, "Short, weak trend", tooltip = "Colour of a short signal that fights the trend line.", group = GS, display = display.none)
sigShapeStrong = input.string("Circle", "Strong signal style", options = ["Circle", "Square", "Diamond", "Flag", "Cross"], tooltip = "Shape of the signals that follow the top line.", group = GS, display = display.none)
hideWeak  = input.bool(false, "Hide weak signals", tooltip = "On. Only signals that go with the trend line are drawn and alerted. Off. Both kinds are shown.", group = GS, display = display.none)
sigShapeWeak = input.string("Square", "Weak signal style", options = ["Circle", "Square", "Diamond", "Flag", "Cross"], tooltip = "Shape of the signals that fight the top line.", group = GS, display = display.none)
sigTint   = input.bool(false, "Tint the background on signals", tooltip = "Paints the background of the bar where a signal appears.", group = GS, display = display.none)
sigTintUp = input.color(#00FF15, "Long tint colour", tooltip = "Tint colour for a long signal.", group = GS, display = display.none)
sigTintDn = input.color(#FF0000, "Short tint colour", tooltip = "Tint colour for a short signal.", group = GS, display = display.none)
dashPos   = input.string("Top right", "Dashboard position", options = ["Top right", "Top left", "Bottom right", "Bottom left"], tooltip = "Corner of the chart where the panel sits.", group = GD, display = display.none)
dashSize  = input.string("Small", "Dashboard size", options = ["Tiny", "Small", "Normal", "Large", "Huge"], tooltip = "Size of the text inside the panel. The panel grows with it.", group = GD, display = display.none)
showDash  = input.bool(true, "Show the dashboard", tooltip = "CURRENT REGIME is the state of the top line on this bar. MACRO TREND states that same state as a direction. CURRENT SIGNAL is the last signal that printed, judged against the macro trend as it is now. The marker on the chart keeps the colour it had when it printed.", group = GD, display = display.none)
dashBg    = input.color(#000000, "Dashboard background", tooltip = "Solid background of the panel.", group = GD, display = display.none)
dashTxt   = input.color(#FFFFFF, "Dashboard text", tooltip = "Colour of the labels inside the panel.", group = GD, display = display.none)
sigTintT  = input.int(15, "Tint transparency", minval = 0, maxval = 100, tooltip = "0 = solid tint, 100 = invisible.", group = GS, display = display.none)
a1 = ta.ema(src, 800)
b1 = ta.ema(src, 3000)
a2 = ta.ema(src, 1)
b2 = ta.ema(src, 360)
a3 = ta.ema(src, 20)
b3 = ta.ema(src, 80)
a4 = ta.ema(src, 80)
b4 = ta.ema(src, 360)
a5 = ta.ema(src, 360)
b5 = ta.ema(src, 800)
top = ta.ema(src, 3000)
osc = ta.ema(ta.ema(ta.rsi(rsiSrc, 600), 3), 1)
gc(bool show, color c, int t) => color.new(c, show ? t : 100)
p1a = plot(a1, "L1 fast", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
p1b = plot(b1, "L1 slow", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
p2a = plot(a2, "L2 fast", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
p2b = plot(b2, "L2 slow", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
p3a = plot(a3, "L3 fast", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
p3b = plot(b3, "L3 slow", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
p4a = plot(a4, "L4 fast", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
p4b = plot(b4, "L4 slow", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
p5a = plot(a5, "L5 fast", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
p5b = plot(b5, "L5 slow", color = color.new(#000000, 100), editable = false, display = display.pane, force_overlay = true)
fill(p1a, p1b, gc(show1, a1 > b1 ? up1 : dn1, t1), title = "Fill 1")
fill(p2a, p2b, gc(show2, a2 > b2 ? up2 : dn2, t2), title = "Fill 2")
fill(p3a, p3b, gc(show3, a3 > b3 ? up3 : dn3, t3), title = "Fill 3")
fill(p4a, p4b, gc(show4, a4 > b4 ? up4 : dn4, t4), title = "Fill 4")
fill(p5a, p5b, gc(show5, a5 > b5 ? up5 : dn5, t5), title = "Fill 5")
topCol = b2 > top ? topColUp : topColDn
topOn  = topStyleS == "Solid" or (topStyleS == "Dashed" and bar_index % 2 == 0) or (topStyleS == "Dotted" and bar_index % 3 == 0)
plot(topOn ? top : na, "Top EMA", color = topCol, linewidth = topWidth, style = plot.style_line, display = display.pane, force_overlay = true)
hLvl  = hline(LVL, "Level", color = color.new(#000000, 100), linestyle = hline.style_solid)
hLow  = hline(BAND_LOW, "Low band", color = color.new(bgCol, 100), linestyle = hline.style_dashed, editable = false, display = display.none)
hHigh = hline(BAND_HIGH, "High band", color = color.new(bgUpCol, 100), linestyle = hline.style_dashed, editable = false, display = display.none)
fill(hLvl, hLow, color = color.new(bgCol, showBg and tfOk ? bgT : 100), title = "Zone below the level")
fill(hLvl, hHigh, color = color.new(bgUpCol, showBgUp and tfOk ? bgUpT : 100), title = "Zone above the level")
oscLineCol = oscColor ? (osc > LVL ? oscUpCol : oscDnCol) : oscCol
plot(osc, "RSI EMA", color = oscLineCol, linewidth = oscWidth, style = plot.style_line)
pOscUp  = plot(tfOk and oscColor and osc > LVL ? osc : na, "RSI above", color = color.new(oscCol, 100), editable = false, display = display.data_window)
pOscDn  = plot(tfOk and oscColor and osc < LVL ? osc : na, "RSI below", color = color.new(oscCol, 100), editable = false, display = display.data_window)
pOscLvl = plot(LVL, "Level anchor", color = color.new(oscCol, 100), editable = false, display = display.data_window)
fill(pOscUp, pOscLvl, osc, LVL, gc(tfOk and oscColor, oscUpCol, oscGradT1), gc(tfOk and oscColor, oscUpCol, oscGradT2), title = "Gradient above")
fill(pOscDn, pOscLvl, LVL, osc, gc(tfOk and oscColor, oscDnCol, oscGradT1), gc(tfOk and oscColor, oscDnCol, oscGradT2), title = "Gradient below")
plStyle  = plStyleS == "Dotted" ? line.style_dotted : plStyleS == "Solid" ? line.style_solid : line.style_dashed
plColNow = oscColor ? (osc > LVL ? oscUpCol : oscDnCol) : oscCol
var line oscPL = na
if tfOk and plOn and barstate.islast and not na(osc)
    if na(oscPL)
        oscPL := line.new(bar_index, osc, bar_index + 1, osc, extend = extend.right, color = color.new(plColNow, 0), width = 1, style = plStyle)
    else
        line.set_xy1(oscPL, bar_index, osc)
        line.set_xy2(oscPL, bar_index + 1, osc)
        line.set_color(oscPL, color.new(plColNow, 0))
        line.set_style(oscPL, plStyle)
else if not plOn and not na(oscPL)
    line.delete(oscPL)
    oscPL := na
[htfFastLive, htfSlowLive] = request.security(syminfo.tickerid, "240", [ta.ema(close, 50), ta.ema(close, 150)])
[htfFastConf, htfSlowConf] = request.security(syminfo.tickerid, "240", [ta.ema(close, 50)[1], ta.ema(close, 150)[1]], lookahead = barmerge.lookahead_on)
htfFast = confirmed ? htfFastConf : htfFastLive
htfSlow = confirmed ? htfSlowConf : htfSlowLive
sigOk   = not confirmed or barstate.isconfirmed
longState  = tfOk and osc > LVL and htfFast > htfSlow
shortState = tfOk and osc < LVL and htfFast < htfSlow
var bool longOscArmed  = true
var bool longMaArmed   = true
var bool shortOscArmed = true
var bool shortMaArmed  = true
if not (osc > LVL)
    longOscArmed := true
if not (htfFast > htfSlow)
    longMaArmed := true
if not (osc < LVL)
    shortOscArmed := true
if not (htfFast < htfSlow)
    shortMaArmed := true
longSig  = showSig and sigOk and longState and longOscArmed and longMaArmed
shortSig = showSig and sigOk and shortState and shortOscArmed and shortMaArmed
if longSig
    longOscArmed := false
    longMaArmed  := false
if shortSig
    shortOscArmed := false
    shortMaArmed  := false
maWhite = b2 > top
longStrong  = longSig and maWhite
longWeakS   = longSig and not maWhite and not hideWeak
shortStrong = shortSig and not maWhite
shortWeakS  = shortSig and maWhite and not hideWeak
strongShape = sigShapeStrong == "Square" ? shape.square : sigShapeStrong == "Circle" ? shape.circle : sigShapeStrong == "Diamond" ? shape.diamond : sigShapeStrong == "Flag" ? shape.flag : shape.cross
weakShape   = sigShapeWeak == "Square" ? shape.square : sigShapeWeak == "Circle" ? shape.circle : sigShapeWeak == "Diamond" ? shape.diamond : sigShapeWeak == "Flag" ? shape.flag : shape.cross
plotshape(longStrong, "Long, strong", style = strongShape, location = location.bottom, color = sigUpCol,  size = size.tiny, force_overlay = true)
plotshape(longWeakS,  "Long, weak",   style = weakShape,   location = location.bottom, color = sigUpWeak, size = size.tiny, force_overlay = true)
plotshape(shortStrong,"Short, strong",style = strongShape, location = location.top,    color = sigDnCol,  size = size.tiny, force_overlay = true)
plotshape(shortWeakS, "Short, weak",  style = weakShape,   location = location.top,    color = sigDnWeak, size = size.tiny, force_overlay = true)
bandTop = ta.highest(high, 100)
bandBot = ta.lowest(low, 100)
var box[] tintBoxes = array.new<box>()
if tfOk and sigTint and (longSig or shortSig) and not na(bandTop) and not na(bandBot)
    box tb = box.new(bar_index, bandTop, bar_index + 1, bandBot, bgcolor = color.new(longSig ? sigTintUp : sigTintDn, sigTintT), border_width = 0, force_overlay = true)
    array.push(tintBoxes, tb)
    if array.size(tintBoxes) > 400
        box.delete(array.shift(tintBoxes))
alertcondition(ta.crossover(a1, b1),  "Layer 1 up",   "Layer 1 flipped to its up state")
alertcondition(ta.crossunder(a1, b1), "Layer 1 down", "Layer 1 flipped to its down state")
alertcondition(ta.crossover(a2, b2),  "Layer 2 up",   "Layer 2 flipped to its up state")
alertcondition(ta.crossunder(a2, b2), "Layer 2 down", "Layer 2 flipped to its down state")
alertcondition(ta.crossover(a3, b3),  "Layer 3 up",   "Layer 3 flipped to its up state")
alertcondition(ta.crossunder(a3, b3), "Layer 3 down", "Layer 3 flipped to its down state")
alertcondition(ta.crossover(a4, b4),  "Layer 4 up",   "Layer 4 flipped to its up state")
alertcondition(ta.crossunder(a4, b4), "Layer 4 down", "Layer 4 flipped to its down state")
alertcondition(ta.crossover(a5, b5),  "Layer 5 up",   "Layer 5 flipped to its up state")
alertcondition(ta.crossunder(a5, b5), "Layer 5 down", "Layer 5 flipped to its down state")
alertcondition(ta.crossover(b2, top),  "Top line turned white", "Price structure improved: the top line is white, uptrend regime")
alertcondition(ta.crossunder(b2, top), "Top line turned black", "Price structure weakened: the top line is black, downtrend regime")
alertcondition(ta.crossover(osc, LVL),  "RSI crossed above the level", "The RSI crossed above 50")
alertcondition(ta.crossunder(osc, LVL), "RSI crossed below the level", "The RSI crossed below 50")
 
var int lastSigDir = 0
if longStrong
    lastSigDir := 1
if longWeakS
    lastSigDir := 1
if shortStrong
    lastSigDir := -1
if shortWeakS
    lastSigDir := -1
 
dashPosV  = dashPos == "Top right" ? position.top_right : dashPos == "Top left" ? position.top_left : dashPos == "Bottom right" ? position.bottom_right : position.bottom_left
dashSizeV = dashSize == "Tiny" ? size.tiny : dashSize == "Small" ? size.small : dashSize == "Normal" ? size.normal : dashSize == "Large" ? size.large : size.huge
 
var table dash = table.new(position.top_right, 2, 5, bgcolor = dashBg, frame_color = dashBg, frame_width = 0, border_color = dashBg, border_width = 0, force_overlay = true)
if barstate.islast
    if showDash and tfOk
        table.set_position(dash, dashPosV)
        table.merge_cells(dash, 0, 0, 1, 0)
        table.cell(dash, 0, 0, "MARKET TIDE", text_color = dashTxt, text_halign = text.align_left)
        table.cell(dash, 0, 1, "CURRENT REGIME", text_color = dashTxt, text_halign = text.align_left)
        table.cell(dash, 1, 1, maWhite ? "UPTREND" : "DOWNTREND", text_color = maWhite ? oscUpCol : oscDnCol, text_halign = text.align_left)
        table.cell(dash, 0, 2, "RSI EMA", text_color = dashTxt, text_halign = text.align_left)
        table.cell(dash, 1, 2, str.tostring(osc, "#.##"), text_color = osc > LVL ? oscUpCol : oscDnCol, text_halign = text.align_left)
        table.cell(dash, 0, 3, "MACRO TREND", text_color = dashTxt, text_halign = text.align_left)
        table.cell(dash, 1, 3, maWhite ? "LONG" : "SHORT", text_color = maWhite ? oscUpCol : oscDnCol, text_halign = text.align_left)
        sigTxt = lastSigDir == 0 ? "NONE YET" : lastSigDir == 1 ? (maWhite ? "LONG WITH TREND" : "LONG AGAINST TREND") : (maWhite ? "SHORT AGAINST TREND" : "SHORT WITH TREND")
        sigTxtCol = lastSigDir == 0 ? dashTxt : lastSigDir == 1 ? (maWhite ? sigUpCol : sigUpWeak) : (maWhite ? sigDnWeak : sigDnCol)
        table.cell(dash, 0, 4, "CURRENT SIGNAL", text_color = dashTxt, text_halign = text.align_left)
        table.cell(dash, 1, 4, sigTxt, text_color = sigTxtCol, text_halign = text.align_left)
        for r = 0 to 4
            for c = 0 to 1
                table.cell_set_text_size(dash, c, r, dashSizeV)
    else
        table.clear(dash, 0, 0, 1, 4)
 
alertcondition(longStrong,  "Long, with the trend",  "Long signal that follows the trend line")
alertcondition(longWeakS,   "Long, against the trend","Long signal that fights the trend line")
alertcondition(shortStrong, "Short, with the trend", "Short signal that follows the trend line")
alertcondition(shortWeakS,  "Short, against the trend","Short signal that fights the trend line")
if longStrong
    alert("Long with the trend on " + syminfo.ticker + " " + timeframe.period + " at " + str.tostring(close), alert.freq_once_per_bar)
if longWeakS
    alert("Long against the trend on " + syminfo.ticker + " " + timeframe.period + " at " + str.tostring(close), alert.freq_once_per_bar)
if shortStrong
    alert("Short with the trend on " + syminfo.ticker + " " + timeframe.period + " at " + str.tostring(close), alert.freq_once_per_bar)
if shortWeakS
    alert("Short against the trend on " + syminfo.ticker + " " + timeframe.period + " at " + str.tostring(close), alert.freq_once_per_bar)
var label tfMsg = na
if tfOk
    if not na(tfMsg)
        label.delete(tfMsg)
        tfMsg := na
else
    if na(tfMsg)
        tfMsg := label.new(bar_index, LVL, "Market Tide is made for the 2h timeframe" + "\n" + "Switch the chart to 2 hours, or turn off the restriction in the settings.", style = label.style_label_left, color = color.new(#1E222D, 0), textcolor = #D1D4DC, size = size.normal)
    else
        label.set_x(tfMsg, bar_index)

← 返回列表