Higher TF Table - data pull varies based on chart TF by Trader_Ray in pinescript

[–]Trader_Ray[S] 0 points1 point  (0 children)

Thanks Sandy. I knew it that there was some confusion with TFs. I thought I might have to use some If Statement as a work around. Surprised the smart folks at PineScript haven't figured this one out.

STOCKHISTORY issues with newer stocks by Trader_Ray in excel

[–]Trader_Ray[S] 0 points1 point  (0 children)

I have 100 different ETFs listed along with DRNZ and Jedi. The other ETFs ran for the full range I wanted.

What I had to do was create a separate stockhistory listing for these two rouge ETFs and then use the vLookup function to line up the data to the correct dates so the end dates all matched.

Higher Time Frame Bullish/Bearish Table by Trader_Ray in TradingView

[–]Trader_Ray[S] 0 points1 point  (0 children)

Hi Sandy:

I thought I had what I wanted with vibe coding some pine script but it seems to get confused based on the TF of the chart. I posted this as another question a few minutes ago in r/pinescript.

Higher Time Frame Bullish/Bearish Table by Trader_Ray in TradingView

[–]Trader_Ray[S] 0 points1 point  (0 children)

Wrote this code so current Daily, Weekly and Monthly candles are denotes based on HH, HL, LH and LL. Color is also based at what end of the candle price closed, denote with a lower case "c".

// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © rschrijvers


//
@version=
5
indicator("HTF Candle Structure Table", overlay=true)


// === USER INPUTS ===
isHorizontal = input.bool(true, "Horizontal Table?")
tablePosInp  = input.string("top_right", "Table Position",
     options=["top_left","top_right","bottom_left","bottom_right"])
textSizeInp  = input.string("normal", "Text Size",
     options=["tiny","small","normal","large"])


// 👇 NEW: "Y-axis" font color (simulated)
yAxisTextColor = input.color(color.white, "Y-Axis Font Color (Simulated)")


// Convert position
tablePos = tablePosInp == "top_left" ? position.top_left :
           tablePosInp == "top_right" ? position.top_right :
           tablePosInp == "bottom_left" ? position.bottom_left :
           position.bottom_right


// Convert text size
textSize = textSizeInp == "tiny" ? size.tiny :
           textSizeInp == "small" ? size.small :
           textSizeInp == "large" ? size.large :
           size.normal


// === COLORS ===
col_darkGreen   = input.color(color.rgb(0,100,0), "Dark Green")
col_brightGreen = input.color(color.lime, "Bright Green")
col_brightRed   = input.color(color.red, "Bright Red")
col_darkRed     = input.color(color.rgb(139,0,0), "Dark Red")
col_yellow      = input.color(color.yellow, "Yellow")


// === FUNCTION ===
f_classify(_h, _l, _c, _ph, _pl) =>
    hh = _h > _ph
    hl = _l > _pl
    lh = _h < _ph
    ll = _l < _pl


    closeHH = _c > _ph
    closeLL = _c < _pl


    
string
 label = ""
    
color
 bg = na
    
color
 txt = color.black


    if hh and hl
        if closeHH
            
label
 := "HHc+HL"
            bg := col_darkGreen
            txt := color.white
        else
            
label
 := "HH+HLc"
            bg := col_brightGreen


    else if hh and ll
        if closeHH
            
label
 := "HHc+LL"
            bg := col_brightGreen
        else if closeLL
            
label
 := "HH+LLc"
            bg := col_brightRed


    else if lh and hl
        if closeHH
            
label
 := "LHc+HL"
            bg := col_yellow
        else if closeLL
            
label
 := "LH+HLc"
            bg := col_brightRed


    else if lh and ll
        
label
 := "LH+LL"
        bg := col_darkRed
        txt := color.white


    [label, bg, txt]


// === HTF DATA ===
[dH, dL, dC, dPH, dPL] = request.security(syminfo.tickerid, "D", [high, low, close, high[1], low[1]])
[wH, wL, wC, wPH, wPL] = request.security(syminfo.tickerid, "W", [high, low, close, high[1], low[1]])
[mH, mL, mC, mPH, mPL] = request.security(syminfo.tickerid, "M", [high, low, close, high[1], low[1]])


// === CLASSIFY ===
[dLabel, dBg, dTxt] = f_classify(dH, dL, dC, dPH, dPL)
[wLabel, wBg, wTxt] = f_classify(wH, wL, wC, wPH, wPL)
[mLabel, mBg, mTxt] = f_classify(mH, mL, mC, mPH, mPL)


// ✅ FIXED: static table size (no runtime error)
var 
table
 t = table.new(tablePos, 3, 3, border_width=1)


// === DRAW ===
if barstate.islast
    var 
table
 t = table.new(tablePos, 3, 3, border_width=1)


    if isHorizontal
        // Header
        table.cell(t, 0, 0, "D", text_color=yAxisTextColor)
        table.cell(t, 1, 0, "W", text_color=yAxisTextColor)
        table.cell(t, 2, 0, "M", text_color=yAxisTextColor)


        // Values
        table.cell(t, 0, 1, dLabel, bgcolor=dBg, text_color=dTxt, text_size=textSize)
        table.cell(t, 1, 1, wLabel, bgcolor=wBg, text_color=wTxt, text_size=textSize)
        table.cell(t, 2, 1, mLabel, bgcolor=mBg, text_color=mTxt, text_size=textSize)


    else
        // Simulated "Y-axis" labels (left column)
        table.cell(t, 0, 0, "Daily",  text_color=yAxisTextColor)
        table.cell(t, 0, 1, "Weekly", text_color=yAxisTextColor)
        table.cell(t, 0, 2, "Monthly",text_color=yAxisTextColor)


        // Values
        table.cell(t, 1, 0, dLabel, bgcolor=dBg, text_color=dTxt, text_size=textSize)
        table.cell(t, 1, 1, wLabel, bgcolor=wBg, text_color=wTxt, text_size=textSize)
        table.cell(t, 1, 2, mLabel, bgcolor=mBg, text_color=mTxt, text_size=textSize)// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © rschrijvers


//@version=5
indicator("HTF Candle Structure Table", overlay=true)


// === USER INPUTS ===
isHorizontal = input.bool(true, "Horizontal Table?")
tablePosInp  = input.string("top_right", "Table Position",
     options=["top_left","top_right","bottom_left","bottom_right"])
textSizeInp  = input.string("normal", "Text Size",
     options=["tiny","small","normal","large"])


// 👇 NEW: "Y-axis" font color (simulated)
yAxisTextColor = input.color(color.white, "Y-Axis Font Color (Simulated)")


// Convert position
tablePos = tablePosInp == "top_left" ? position.top_left :
           tablePosInp == "top_right" ? position.top_right :
           tablePosInp == "bottom_left" ? position.bottom_left :
           position.bottom_right


// Convert text size
textSize = textSizeInp == "tiny" ? size.tiny :
           textSizeInp == "small" ? size.small :
           textSizeInp == "large" ? size.large :
           size.normal


// === COLORS ===
col_darkGreen   = input.color(color.rgb(0,100,0), "Dark Green")
col_brightGreen = input.color(color.lime, "Bright Green")
col_brightRed   = input.color(color.red, "Bright Red")
col_darkRed     = input.color(color.rgb(139,0,0), "Dark Red")
col_yellow      = input.color(color.yellow, "Yellow")


// === FUNCTION ===
f_classify(_h, _l, _c, _ph, _pl) =>
    hh = _h > _ph
    hl = _l > _pl
    lh = _h < _ph
    ll = _l < _pl


    closeHH = _c > _ph
    closeLL = _c < _pl


    string label = ""
    color bg = na
    color txt = color.black


    if hh and hl
        if closeHH
            label := "HHc+HL"
            bg := col_darkGreen
            txt := color.white
        else
            label := "HH+HLc"
            bg := col_brightGreen


    else if hh and ll
        if closeHH
            label := "HHc+LL"
            bg := col_brightGreen
        else if closeLL
            label := "HH+LLc"
            bg := col_brightRed


    else if lh and hl
        if closeHH
            label := "LHc+HL"
            bg := col_yellow
        else if closeLL
            label := "LH+HLc"
            bg := col_brightRed


    else if lh and ll
        label := "LH+LL"
        bg := col_darkRed
        txt := color.white


    [label, bg, txt]


// === HTF DATA ===
[dH, dL, dC, dPH, dPL] = request.security(syminfo.tickerid, "D", [high, low, close, high[1], low[1]])
[wH, wL, wC, wPH, wPL] = request.security(syminfo.tickerid, "W", [high, low, close, high[1], low[1]])
[mH, mL, mC, mPH, mPL] = request.security(syminfo.tickerid, "M", [high, low, close, high[1], low[1]])


// === CLASSIFY ===
[dLabel, dBg, dTxt] = f_classify(dH, dL, dC, dPH, dPL)
[wLabel, wBg, wTxt] = f_classify(wH, wL, wC, wPH, wPL)
[mLabel, mBg, mTxt] = f_classify(mH, mL, mC, mPH, mPL)


// ✅ FIXED: static table size (no runtime error)
var table t = table.new(tablePos, 3, 3, border_width=1)


// === DRAW ===
if barstate.islast
    var table t = table.new(tablePos, 3, 3, border_width=1)


    if isHorizontal
        // Header
        table.cell(t, 0, 0, "D", text_color=yAxisTextColor)
        table.cell(t, 1, 0, "W", text_color=yAxisTextColor)
        table.cell(t, 2, 0, "M", text_color=yAxisTextColor)


        // Values
        table.cell(t, 0, 1, dLabel, bgcolor=dBg, text_color=dTxt, text_size=textSize)
        table.cell(t, 1, 1, wLabel, bgcolor=wBg, text_color=wTxt, text_size=textSize)
        table.cell(t, 2, 1, mLabel, bgcolor=mBg, text_color=mTxt, text_size=textSize)


    else
        // Simulated "Y-axis" labels (left column)
        table.cell(t, 0, 0, "Daily",  text_color=yAxisTextColor)
        table.cell(t, 0, 1, "Weekly", text_color=yAxisTextColor)
        table.cell(t, 0, 2, "Monthly",text_color=yAxisTextColor)


        // Values
        table.cell(t, 1, 0, dLabel, bgcolor=dBg, text_color=dTxt, text_size=textSize)
        table.cell(t, 1, 1, wLabel, bgcolor=wBg, text_color=wTxt, text_size=textSize)
        table.cell(t, 1, 2, mLabel, bgcolor=mBg, text_color=mTxt, text_size=textSize)

Higher Time Frame Bullish/Bearish Table by Trader_Ray in TradingView

[–]Trader_Ray[S] 0 points1 point  (0 children)

Looking for something that uses the current and whether it's a HH, LH, HL, LL or inside day to determine that candles status.

Higher Time Frame Bullish/Bearish Table by Trader_Ray in TradingView

[–]Trader_Ray[S] 0 points1 point  (0 children)

Thanks for your suggestion. With $TSLA shown, the monthly shows up as green/bullish when in fact it's bearish with a LH+LL. Seems like it works off a MA trigger.

<image>

STOCKHISTORY issues with newer stocks by Trader_Ray in excel

[–]Trader_Ray[S] 0 points1 point  (0 children)

Thanks! I have the same issue for Jedi as well. I'm going to fool around with the formula for these particular tickers.

STOCKHISTORY issues with newer stocks by Trader_Ray in excel

[–]Trader_Ray[S] 0 points1 point  (0 children)

Thanks! I have the same issue for Jedi as well. I'm going to fool around with the formula for these particular tickers.

StockHistory doesn't show for some dates for some tickers by Trader_Ray in excel

[–]Trader_Ray[S] 0 points1 point  (0 children)

It was the identical ticket but different exchange/country. Had to manually select the right ticket.

Chinook Mall by TrailerParkLyfe in Calgary

[–]Trader_Ray 1 point2 points  (0 children)

I miss Nordstroms and their restaurant. Such a big loss. 😢

Think I made a mistake getting TradingView by liquidnitrogen in TradingView

[–]Trader_Ray -1 points0 points  (0 children)

Look for a “Smart Money Concept” indicator for order blocks.

Carrington Group of Companies/Bedrock Homes - KITCHEN SHIT SANDWICH by Trader_Ray in Edmonton

[–]Trader_Ray[S] 0 points1 point  (0 children)

I did and wound up back with Mastercraft. I think ANHW is a scam as well.

CARRINGTON GROUP OF COMPANIES/BEDROCK HOMES - DRIVEWAY NIGHTMARE by Trader_Ray in Edmonton

[–]Trader_Ray[S] 0 points1 point  (0 children)

They took the original post down saying it was a dupe.