Equity Fundamentals Dashboard (India + US)

sayujraghave0102 · study · 431 行 · 点赞 16 · TradingView 原页

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

Pine Script

// @version=6
indicator("Equity Fundamentals Dashboard (India + US)", overlay = true)
 
// India + US version of indicators/nse_fundamentals_dashboard/ (that file is
// kept untouched as the last known-good India-only script). Everything comes
// live from TradingView's own request.financial() (FactSet-sourced) -- no
// embedded data, no libraries, no manual refresh. See
// directives/nse_fundamentals_indicator.md for the full history.
//
// Market is detected from syminfo.currency, nothing to configure:
//   INR   -> Crores, Basic EPS, 1-decimal EPS (same as the India script)
//   other -> always $M, Diluted EPS, 2-decimal EPS
//
// Banks: when a row's metric has no data across the displayed quarters, the
// whole row switches for that symbol:
//   EBITDA       -> Operating Income (OPER_INCOME). This is NOT
//                   Screener/Trendlyne's Financing Profit -- it's after provisions.
//   Gross Profit -> Profit before Tax (PRETAX_INCOME). Net interest income, the
//                   true bank equivalent, isn't available from request.financial().
//
// Finance-sector stocks (banks, NBFCs, and developers like GODREJPROP): the
// Revenue row is labelled "Total Income", because TOTAL_REVENUE includes what
// Screener shows separately as Other Income. Only the label changes.
//
// Historical quarters come from request.financial()'s live series by
// detecting each value change (ta.change) as the script scans the chart's
// bars and accumulating into a persistent array -- the naive [] offset
// operator does NOT work for this (steps by chart bar, not fiscal period;
// confirmed broken via direct testing).
//
// Known caveats:
// - NET_INCOME can diverge from Screener's PAT for complex subsidiary/JV
//   structures (~15-18% on RELIANCE) -- a definitional difference, not a bug.
// - US EPS is reported GAAP, so it won't match "adjusted EPS" in headlines.
// - ADRs and other foreign reporters are NOT verified: converted figures use
//   a daily FX rate, which may break quarter detection. Symbols TradingView
//   types as depositary receipts get a warning in the corner cell.
 
position_choice = input.string("Bottom Right", "Table Position", options = ["Top Right", "Top Left", "Bottom Right", "Bottom Left", "Middle Right", "Middle Left"], group = "Table Appearance")
textsize_choice = input.string("Small", "Table Text Size", options = ["Small", "Normal", "Large"], group = "Table Appearance")
border_color_setting = input.color(color.gray, "Border Color", group = "Table Appearance")
border_width_setting = input.int(1, "Border Width", minval = 0, maxval = 5, group = "Table Appearance")
 
// Applied to BOTH Income Statement YoY coloring and Ratios QoQ coloring --
// same underlying "did this go up or down" concept in both sections.
growth_positive_color = input.color(color.lime, "Positive Growth Color", group = "Colors")
growth_negative_color = input.color(color.red, "Negative Growth Color", group = "Colors")
growth_neutral_color = input.color(color.white, "Neutral / N-A Color", group = "Colors")
text_color_setting = input.color(color.white, "Base Text Color (labels/headers)", group = "Colors")
income_header_color = input.color(color.new(color.blue, 40), "Income Statement Header Color", group = "Colors")
ratios_header_color = input.color(color.new(color.teal, 40), "Ratios Header Color", group = "Colors")
header_row_color = input.color(color.gray, "Header Row / Label Column Color", group = "Colors")
cell_bg_color_1 = input.color(color.new(color.gray, 85), "Cell Background Color 1", group = "Colors")
cell_bg_color_2 = input.color(color.new(color.gray, 75), "Cell Background Color 2", group = "Colors")
 
f_getPosition(choice) =>
    result = position.bottom_right
    if choice == "Top Right"
        result := position.top_right
    if choice == "Top Left"
        result := position.top_left
    if choice == "Bottom Left"
        result := position.bottom_left
    if choice == "Middle Right"
        result := position.middle_right
    if choice == "Middle Left"
        result := position.middle_left
    result
 
f_getTextSize(choice) =>
    result = size.small
    if choice == "Normal"
        result := size.normal
    if choice == "Large"
        result := size.large
    result
 
tblTextSize = f_getTextSize(textsize_choice)
 
show_absolute = input.bool(true, "Show Absolute Numbers", group = "Display Options (Income Statement)")
show_growth = input.bool(true, "Show YoY Growth %", group = "Display Options (Income Statement)")
 
show_revenue = input.bool(true, "Revenue / Total Income (Finance sector)", group = "Income Statement Metrics")
show_ebitda = input.bool(true, "EBITDA / Operating Income (banks)", group = "Income Statement Metrics")
show_net_income = input.bool(true, "Net Income", group = "Income Statement Metrics")
show_eps = input.bool(true, "EPS (Basic India / Diluted US)", group = "Income Statement Metrics")
show_gross_profit = input.bool(true, "Gross Profit / Profit before Tax (banks)", group = "Income Statement Metrics")
show_operating_expenses = input.bool(true, "Operating Expenses", group = "Income Statement Metrics")
 
show_roe = input.bool(true, "Return on Equity (ROE)", group = "Ratios Metrics")
show_roa = input.bool(true, "Return on Assets (ROA)", group = "Ratios Metrics")
show_debt_equity = input.bool(true, "Debt to Equity", group = "Ratios Metrics")
show_current_ratio = input.bool(true, "Current Ratio", group = "Ratios Metrics")
show_quick_ratio = input.bool(true, "Quick Ratio", group = "Ratios Metrics")
show_ebitda_margin = input.bool(true, "EBITDA Margin", group = "Ratios Metrics")
show_net_margin = input.bool(true, "Net Margin", group = "Ratios Metrics")
show_operating_margin = input.bool(true, "Operating Margin", group = "Ratios Metrics")
show_gross_margin = input.bool(true, "Gross Margin", group = "Ratios Metrics")
show_debt_to_asset = input.bool(true, "Debt to Asset", group = "Ratios Metrics")
show_debt_to_ebitda = input.bool(true, "Debt to EBITDA", group = "Ratios Metrics")
show_debt_to_revenue = input.bool(true, "Debt to Revenue", group = "Ratios Metrics")
show_dividend_payout = input.bool(true, "Dividend Payout Ratio", group = "Ratios Metrics")
show_dividends_yield = input.bool(true, "Dividends Yield", group = "Ratios Metrics")
show_equity_to_asset = input.bool(true, "Equity to Asset", group = "Ratios Metrics")
 
// Quarters are labelled relative to the most recent one (T). Up to 8 of the
// most recent accumulated quarters can be selected.
q_t = input.bool(true, "Latest Quarter (T)", group = "Quarters to Display")
q_t1 = input.bool(true, "T-1", group = "Quarters to Display")
q_t2 = input.bool(true, "T-2", group = "Quarters to Display")
q_t3 = input.bool(true, "T-3", group = "Quarters to Display")
q_t4 = input.bool(false, "T-4", group = "Quarters to Display")
q_t5 = input.bool(false, "T-5", group = "Quarters to Display")
q_t6 = input.bool(false, "T-6", group = "Quarters to Display")
q_t7 = input.bool(false, "T-7 (oldest)", group = "Quarters to Display")
 
// Market detection. Currency rather than exchange because it's the currency
// that decides how money is formatted.
bool isIndia = syminfo.currency == "INR"
bool isDepositary = syminfo.type == "dr"
string moneyPrefix = syminfo.currency == "USD" ? "$" : syminfo.currency + " "
string epsId = isIndia ? "EARNINGS_PER_SHARE_BASIC" : "EARNINGS_PER_SHARE_DILUTED"
string epsLabel = isIndia ? "EPS (Basic)" : "EPS (Diluted)"
string netIncomeLabel = isIndia ? "Net Income (PAT)" : "Net Income"
string revenueLabel = syminfo.sector == "Finance" ? "Total Income" : "Revenue"
 
int DAY_MS = 24 * 60 * 60 * 1000
// Shorter than the shortest fiscal quarter (~84 days on a 52/53-week year)
// with margin, so a change this close to the last one is the same quarter.
int REVISION_WINDOW_MS = 60 * DAY_MS
// How far after a Revenue quarter another metric's entry can land and still
// belong to that same quarter.
int QUARTER_MATCH_MS = 30 * DAY_MS
// Quarter-end values land on the first bar on/after the period end, so a
// month-end falling on a weekend (ORCL 31 May 2026 -> Mon 1 Jun) would label
// as the next month. Stepping back 3 days keeps it in the right month.
// Monthly bars are stamped on the 1st, so they must not be shifted.
int LABEL_SHIFT_MS = timeframe.ismonthly ? 0 : 3 * DAY_MS
 
// Maps the 8 quarter toggles onto actual positions within the canonical
// quarter array of size n. Returns ascending (oldest-to-newest) indices.
f_selectedOffsets(n) =>
    array<bool> toggles = array.from(q_t7, q_t6, q_t5, q_t4, q_t3, q_t2, q_t1, q_t)
    array<int> offsets = array.new<int>()
    for j = 0 to 7
        int idx = n - 8 + j
        if array.get(toggles, j) and idx >= 0 and idx < n
            array.push(offsets, idx)
    offsets
 
// Accumulates one financial_id's quarterly history. Pine's `var` inside a
// function persists independently per call-site, so each call below gets
// its own arrays. Returns [values, entry-times] as a tuple.
//
// Revisions: if FactSet restates a figure shortly after the initial report,
// ta.change() fires again for the same fiscal quarter (seen on HCLTECH). A
// change inside the revision window overwrites the value but keeps the
// original time -- moving the time forward would let a late revision swallow
// the next real quarter.
//
// A value disappearing is recorded as an na entry, so f_valueAt shows N/A for
// that quarter instead of carrying the older number forward.
f_history(financialId) =>
    fin = request.financial(syminfo.tickerid, financialId, "FQ", ignore_invalid_symbol = true)
    var array<float> hist = array.new<float>()
    var array<int> histTime = array.new<int>()
    changed = ta.change(fin)
    prevFin = fin[1]
    int n = array.size(histTime)
    bool inWindow = n > 0 and (time - array.get(histTime, n - 1)) < REVISION_WINDOW_MS
    if not na(fin) and (na(changed) or changed != 0)
        if inWindow
            array.set(hist, n - 1, fin)
        else
            array.push(hist, fin)
            array.push(histTime, time)
    else if na(fin) and not na(prevFin) and not inWindow
        array.push(hist, na)
        array.push(histTime, time)
    [hist, histTime]
 
[revenueHist, quarterTimes] = f_history("TOTAL_REVENUE")
[ebitdaHist, ebitdaTimes] = f_history("EBITDA")
[operIncomeHist, operIncomeTimes] = f_history("OPER_INCOME")
[netIncomeHist, netIncomeTimes] = f_history("NET_INCOME")
[epsHist, epsTimes] = f_history(epsId)
[grossProfitHist, grossProfitTimes] = f_history("GROSS_PROFIT")
[pretaxIncomeHist, pretaxIncomeTimes] = f_history("PRETAX_INCOME")
[operatingExpensesHist, operatingExpensesTimes] = f_history("OPERATING_EXPENSES")
 
[roeHist, roeTimes] = f_history("RETURN_ON_EQUITY")
[roaHist, roaTimes] = f_history("RETURN_ON_ASSETS")
[debtEquityHist, debtEquityTimes] = f_history("DEBT_TO_EQUITY")
[currentRatioHist, currentRatioTimes] = f_history("CURRENT_RATIO")
[quickRatioHist, quickRatioTimes] = f_history("QUICK_RATIO")
[ebitdaMarginHist, ebitdaMarginTimes] = f_history("EBITDA_MARGIN")
[netMarginHist, netMarginTimes] = f_history("NET_MARGIN")
[operatingMarginHist, operatingMarginTimes] = f_history("OPERATING_MARGIN")
[grossMarginHist, grossMarginTimes] = f_history("GROSS_MARGIN")
[debtToAssetHist, debtToAssetTimes] = f_history("DEBT_TO_ASSET")
[debtToEbitdaHist, debtToEbitdaTimes] = f_history("DEBT_TO_EBITDA")
[debtToRevenueHist, debtToRevenueTimes] = f_history("DEBT_TO_REVENUE")
[dividendPayoutHist, dividendPayoutTimes] = f_history("DIVIDEND_PAYOUT_RATIO")
[dividendsYieldHist, dividendsYieldTimes] = f_history("DIVIDENDS_YIELD")
[equityToAssetHist, equityToAssetTimes] = f_history("EQUITY_TO_ASSET")
 
// A metric's value for the quarter at qTime: its latest entry at or before
// that quarter. Looked up by time, not array position, because a metric that
// repeats a value (ta.change doesn't fire) or starts later than Revenue has
// fewer entries, and by position its numbers would sit under the wrong
// quarter. A repeated value carries forward, which is what it actually was.
f_valueAt(hist, times, qTime) =>
    float result = na
    int n = array.size(times)
    if n > 0
        for i = 0 to n - 1
            if array.get(times, i) <= qTime + QUARTER_MATCH_MS
                result := array.get(hist, i)
    result
 
// True if the metric has a value in at least one displayed quarter. Drives
// the bank swaps: judged on the displayed quarters as a whole, so a row is
// either all the original metric or all its replacement, never a mix.
f_hasData(hist, times, colOffsets, colCount) =>
    bool found = false
    for c = 0 to colCount - 1
        if not na(f_valueAt(hist, times, array.get(quarterTimes, array.get(colOffsets, c))))
            found := true
    found
 
f_fmtMoney(val) =>
    string result = "N/A"
    if not na(val)
        if isIndia
            result := str.format("{0,number,#,###.#}", val / 10000000) + " Cr"
        else
            result := (val < 0 ? "-" : "") + moneyPrefix + str.format("{0,number,#,##0.#}", math.abs(val) / 1000000) + "M"
    result
 
f_fmtEps(val) =>
    string result = "N/A"
    if not na(val)
        if isIndia
            result := str.format("{0,number,0.0}", val)
        else
            result := (val < 0 ? "-" : "") + moneyPrefix + str.format("{0,number,0.00}", math.abs(val))
    result
 
f_fmtGrowthPct(val) =>
    na(val) ? "N/A" : (val >= 0 ? "+" : "") + str.format("{0,number,0.0}", val) + "%"
 
f_fmtRatioX(val) =>
    na(val) ? "N/A" : str.format("{0,number,0.0}", val) + "x"
 
f_fmtPctVal(val) =>
    na(val) ? "N/A" : str.format("{0,number,0.0}", val) + "%"
 
f_yoyPct(curr, prior) =>
    (na(curr) or na(prior) or prior == 0) ? na : (curr - prior) / math.abs(prior) * 100.0
 
f_yoyColor(curr, prior) =>
    (na(curr) or na(prior) or prior == 0) ? growth_neutral_color : (f_yoyPct(curr, prior) >= 0 ? growth_positive_color : growth_negative_color)
 
f_qoqColor(curr, prior, inverted) =>
    (na(curr) or na(prior)) ? growth_neutral_color : (inverted ? (curr <= prior ? growth_positive_color : growth_negative_color) : (curr >= prior ? growth_positive_color : growth_negative_color))
 
f_fmtIncomeCell(curr, prior, isMoney) =>
    string result = "N/A"
    if not na(curr)
        string absStr = isMoney ? f_fmtMoney(curr) : f_fmtEps(curr)
        string growthStr = f_fmtGrowthPct(f_yoyPct(curr, prior))
        if show_absolute and show_growth
            result := absStr + "\n(" + growthStr + ")"
        else if show_absolute
            result := absStr
        else if show_growth
            result := growthStr
        else
            result := ""
    result
 
f_renderIncomeRow(tbl, rowIdx, label, hist, times, isMoney, colOffsets, colCount) =>
    color rowBg = rowIdx % 2 == 0 ? cell_bg_color_1 : cell_bg_color_2
    table.cell(tbl, 0, rowIdx, label, text_color = text_color_setting, bgcolor = header_row_color, text_size = tblTextSize)
    for c = 0 to colCount - 1
        int idx = array.get(colOffsets, c)
        int priorIdx = idx - 4
        float cur = f_valueAt(hist, times, array.get(quarterTimes, idx))
        float prior = priorIdx >= 0 ? f_valueAt(hist, times, array.get(quarterTimes, priorIdx)) : na
        string cellText = f_fmtIncomeCell(cur, prior, isMoney)
        color txtColor = f_yoyColor(cur, prior)
        table.cell(tbl, c + 1, rowIdx, cellText, text_color = txtColor, bgcolor = rowBg, text_size = tblTextSize)
 
f_renderRatioRow(tbl, rowIdx, label, hist, times, isPercent, inverted, colOffsets, colCount) =>
    color rowBg = rowIdx % 2 == 0 ? cell_bg_color_1 : cell_bg_color_2
    table.cell(tbl, 0, rowIdx, label, text_color = text_color_setting, bgcolor = header_row_color, text_size = tblTextSize)
    for c = 0 to colCount - 1
        int idx = array.get(colOffsets, c)
        int priorIdx = idx - 1
        float cur = f_valueAt(hist, times, array.get(quarterTimes, idx))
        float prior = priorIdx >= 0 ? f_valueAt(hist, times, array.get(quarterTimes, priorIdx)) : na
        string cellText = isPercent ? f_fmtPctVal(cur) : f_fmtRatioX(cur)
        color txtColor = f_qoqColor(cur, prior, inverted)
        table.cell(tbl, c + 1, rowIdx, cellText, text_color = txtColor, bgcolor = rowBg, text_size = tblTextSize)
 
int isCount = (show_revenue ? 1 : 0) + (show_ebitda ? 1 : 0) + (show_net_income ? 1 : 0) + (show_eps ? 1 : 0) + (show_gross_profit ? 1 : 0) + (show_operating_expenses ? 1 : 0)
int ratioCount = (show_roe ? 1 : 0) + (show_roa ? 1 : 0) + (show_debt_equity ? 1 : 0) + (show_current_ratio ? 1 : 0) + (show_quick_ratio ? 1 : 0) + (show_ebitda_margin ? 1 : 0) + (show_net_margin ? 1 : 0) + (show_operating_margin ? 1 : 0) + (show_gross_margin ? 1 : 0) + (show_debt_to_asset ? 1 : 0) + (show_debt_to_ebitda ? 1 : 0) + (show_debt_to_revenue ? 1 : 0) + (show_dividend_payout ? 1 : 0) + (show_dividends_yield ? 1 : 0) + (show_equity_to_asset ? 1 : 0)
int isDivider = isCount > 0 ? 1 : 0
int ratioDivider = ratioCount > 0 ? 1 : 0
int rowCount = math.max(1 + isDivider + isCount + ratioDivider + ratioCount, 1)
 
// Table width is driven by how many quarters are actually selected, not a
// fixed 8 -- otherwise the table stays full-width with blank trailing
// columns when fewer than 8 quarters are toggled on. Computed from inputs
// alone (not accumulated data), so it's known before table.new() runs.
int declaredColCount = (q_t ? 1 : 0) + (q_t1 ? 1 : 0) + (q_t2 ? 1 : 0) + (q_t3 ? 1 : 0) + (q_t4 ? 1 : 0) + (q_t5 ? 1 : 0) + (q_t6 ? 1 : 0) + (q_t7 ? 1 : 0)
int maxColIdx = math.max(declaredColCount, 1)
 
var table dashboard = table.new(f_getPosition(position_choice), maxColIdx + 1, rowCount, border_color = border_color_setting, border_width = border_width_setting)
 
// Rendering lives in its own function, not directly in global scope, since
// an earlier version of this project hit Pine's compiled-scope-size limit
// (CE10295) with a comparable amount of code sitting unwrapped at global
// scope.
f_updateDashboard(tbl, rc) =>
    table.clear(tbl, 0, 0, maxColIdx, rc - 1)
 
    // Offsets computed once from the Revenue/quarterTimes array (the canonical
    // quarter list) and reused for every row, so columns line up across the
    // whole table regardless of which quarters the user has toggled on.
    int tn = array.size(quarterTimes)
    array<int> colOffsets = f_selectedOffsets(tn)
    int colCount = array.size(colOffsets)
 
    string cornerText = isDepositary ? syminfo.ticker + "\nADR: unverified" : syminfo.ticker
    color cornerBg = isDepositary ? color.orange : header_row_color
    table.cell(tbl, 0, 0, cornerText, text_color = text_color_setting, bgcolor = cornerBg, text_size = tblTextSize)
 
    if colCount == 0
        string emptyMsg = declaredColCount == 0 ? "No quarters selected" : "No fundamentals data for " + syminfo.ticker
        table.merge_cells(tbl, 0, 0, maxColIdx, 0)
        table.cell(tbl, 0, 0, emptyMsg, text_color = text_color_setting, bgcolor = color.red, text_size = tblTextSize)
    else
        for c = 0 to colCount - 1
            int idx = array.get(colOffsets, c)
            string label = str.format_time(array.get(quarterTimes, idx) - LABEL_SHIFT_MS, "MMM yyyy")
            table.cell(tbl, c + 1, 0, label, text_color = text_color_setting, bgcolor = header_row_color, text_size = tblTextSize)
 
        int row = 1
        if isCount > 0
            table.merge_cells(tbl, 0, row, colCount, row)
            table.cell(tbl, 0, row, "Income Statement", text_color = text_color_setting, bgcolor = income_header_color, text_size = tblTextSize)
            row := row + 1
            if show_revenue
                f_renderIncomeRow(tbl, row, revenueLabel, revenueHist, quarterTimes, true, colOffsets, colCount)
                row := row + 1
            if show_ebitda
                if f_hasData(ebitdaHist, ebitdaTimes, colOffsets, colCount)
                    f_renderIncomeRow(tbl, row, "EBITDA", ebitdaHist, ebitdaTimes, true, colOffsets, colCount)
                else
                    f_renderIncomeRow(tbl, row, "Operating Income", operIncomeHist, operIncomeTimes, true, colOffsets, colCount)
                row := row + 1
            if show_net_income
                f_renderIncomeRow(tbl, row, netIncomeLabel, netIncomeHist, netIncomeTimes, true, colOffsets, colCount)
                row := row + 1
            if show_eps
                f_renderIncomeRow(tbl, row, epsLabel, epsHist, epsTimes, false, colOffsets, colCount)
                row := row + 1
            if show_gross_profit
                if f_hasData(grossProfitHist, grossProfitTimes, colOffsets, colCount)
                    f_renderIncomeRow(tbl, row, "Gross Profit", grossProfitHist, grossProfitTimes, true, colOffsets, colCount)
                else
                    f_renderIncomeRow(tbl, row, "Profit before Tax", pretaxIncomeHist, pretaxIncomeTimes, true, colOffsets, colCount)
                row := row + 1
            if show_operating_expenses
                f_renderIncomeRow(tbl, row, "Operating Expenses", operatingExpensesHist, operatingExpensesTimes, true, colOffsets, colCount)
                row := row + 1
 
        if ratioCount > 0
            table.merge_cells(tbl, 0, row, colCount, row)
            table.cell(tbl, 0, row, "Ratios", text_color = text_color_setting, bgcolor = ratios_header_color, text_size = tblTextSize)
            row := row + 1
            if show_roe
                f_renderRatioRow(tbl, row, "ROE", roeHist, roeTimes, true, false, colOffsets, colCount)
                row := row + 1
            if show_roa
                f_renderRatioRow(tbl, row, "ROA", roaHist, roaTimes, true, false, colOffsets, colCount)
                row := row + 1
            if show_debt_equity
                f_renderRatioRow(tbl, row, "Debt to Equity", debtEquityHist, debtEquityTimes, false, true, colOffsets, colCount)
                row := row + 1
            if show_current_ratio
                f_renderRatioRow(tbl, row, "Current Ratio", currentRatioHist, currentRatioTimes, false, false, colOffsets, colCount)
                row := row + 1
            if show_quick_ratio
                f_renderRatioRow(tbl, row, "Quick Ratio", quickRatioHist, quickRatioTimes, false, false, colOffsets, colCount)
                row := row + 1
            if show_ebitda_margin
                f_renderRatioRow(tbl, row, "EBITDA Margin", ebitdaMarginHist, ebitdaMarginTimes, true, false, colOffsets, colCount)
                row := row + 1
            if show_net_margin
                f_renderRatioRow(tbl, row, "Net Margin", netMarginHist, netMarginTimes, true, false, colOffsets, colCount)
                row := row + 1
            if show_operating_margin
                f_renderRatioRow(tbl, row, "Operating Margin", operatingMarginHist, operatingMarginTimes, true, false, colOffsets, colCount)
                row := row + 1
            if show_gross_margin
                f_renderRatioRow(tbl, row, "Gross Margin", grossMarginHist, grossMarginTimes, true, false, colOffsets, colCount)
                row := row + 1
            if show_debt_to_asset
                f_renderRatioRow(tbl, row, "Debt to Asset", debtToAssetHist, debtToAssetTimes, false, true, colOffsets, colCount)
                row := row + 1
            if show_debt_to_ebitda
                f_renderRatioRow(tbl, row, "Debt to EBITDA", debtToEbitdaHist, debtToEbitdaTimes, false, true, colOffsets, colCount)
                row := row + 1
            if show_debt_to_revenue
                f_renderRatioRow(tbl, row, "Debt to Revenue", debtToRevenueHist, debtToRevenueTimes, false, true, colOffsets, colCount)
                row := row + 1
            if show_dividend_payout
                f_renderRatioRow(tbl, row, "Dividend Payout Ratio", dividendPayoutHist, dividendPayoutTimes, true, false, colOffsets, colCount)
                row := row + 1
            if show_dividends_yield
                f_renderRatioRow(tbl, row, "Dividends Yield", dividendsYieldHist, dividendsYieldTimes, true, false, colOffsets, colCount)
                row := row + 1
            if show_equity_to_asset
                f_renderRatioRow(tbl, row, "Equity to Asset", equityToAssetHist, equityToAssetTimes, false, false, colOffsets, colCount)
                row := row + 1
    true
 
if barstate.islast
    f_updateDashboard(dashboard, rowCount)

← 返回列表