Module: TradingviewScreener::ScreenData

Defined in:
lib/tradingview_screener/screen_data.rb,
lib/tradingview_screener/generated_column_map.rb

Overview

Convert TradingView saved-screener window.initData.screen_data into scanner.tradingview.com scan payloads / Relations.

Defined Under Namespace

Classes: ConversionError, Converter, FetchError, Fetcher, FieldContract, FieldContractError, ParseError, Parser

Constant Summary collapse

GENERATED_COLUMN_BASE_MAP =

Generated by script/update_screen_data_column_map from TradingView's development-time bundles. Runtime conversion never downloads these files. Enum bundle: 34637.7df3f5e70c4873c3e8fb.js Definition bundle: 3730.e59ce877c7b3afcb8ea0.js

{
    "AccruedCouponInterest" => "accrued_coupon_interest",
    "ActiveContributors" => "contributorsactive",
    "ActivePosts" => "postsactive",
    "AddressesWithBalance" => "total_addresses_with_balance",
    "AltRank" => "altrank",
    "AltmanZScore" => "altman_z_score",
    "AmountOutstandingRatio" => "amount_outstanding_ratio",
    "AnalystRating" => "AnalystRating",
    "Aroon" => "Aroon",
    "Ask" => "ask",
    "AssetClass" => "asset_class",
    "AssetsToEquityRatio" => "total_assets_to_equity",
    "AssetsTurnover" => "asset_turnover",
    "AssetsUnderManagement" => "aum",
    "AumPerformance" => "aum_perf",
    "AverageDailyRange" => "ADR",
    "AverageDayRangePercent" => "ADRP",
    "AverageDirectionalIndex" => "ADX",
    "AverageTrueRange" => "ATR",
    "AverageTrueRangePercent" => "ATRP",
    "AverageVolume" => "average_volume",
    "AverageVolumeCex" => "average_volume",
    "AwesomeOscillator" => "AO",
    "BBPower" => "BBPower",
    "BaseCurrency" => "base_currency_id",
    "BasicElements" => "basic_elements",
    "BasicEps" => "earnings_per_share_basic",
    "Beta" => "beta",
    "Bid" => "bid",
    "Blockchain" => "blockchain-id",
    "BollingerBands" => "BB",
    "BondAsk" => "ask_pct",
    "BondAskNet" => "ask_net",
    "BondBid" => "bid_pct",
    "BondBidAskSpread" => "bid_ask_spread_pct",
    "BondBidNet" => "bid_net",
    "BondChangeAbs" => "change_abs",
    "BondClose" => "close_pct",
    "BondCloseNet" => "close_net",
    "BondIssuer" => "bond_issuer",
    "BondIssuerType" => "bond_issuer_type",
    "BondPrice" => "Bond.Price",
    "BondYield" => "close",
    "BookPerShare" => "book_value_per_share",
    "BookPerShareEstimate" => "book_value_per_share_estimate",
    "Brand" => "brand",
    "BuyVolumeDex" => "dex_buy_volume",
    "BuybackYield" => "buyback_yield",
    "BuysDex" => "dex_buys",
    "CallFrequency" => "call_frequency",
    "CallNextDate" => "call_next_date",
    "CallNextPrice" => "call_next_price",
    "CapExPerShare" => "capex_per_share",
    "CapexGrowth" => "capital_expenditures",
    "CapitalExpenditures" => "neg_capital_expenditures",
    "CapitalExpendituresEstimate" => "capital_expenditures_estimate",
    "CashDividendCoverageRatio" => "cash_dividend_coverage_ratio",
    "CashFromFinancing" => "cash_f_financing_activities",
    "CashFromFinancingEstimate" => "cash_f_financing_activities_estimate",
    "CashFromInvesting" => "cash_f_investing_activities",
    "CashFromInvestingEstimate" => "cash_f_investing_activities_estimate",
    "CashFromOperating" => "cash_f_operating_activities",
    "CashFromOperatingEstimate" => "cash_f_operating_activities_estimate",
    "CashNEquivalents" => "cash_n_equivalents",
    "CashNShortTermInvest" => "cash_n_short_term_invest",
    "CashNShortTermInvestEstimate" => "cash_n_short_term_invest_estimate",
    "CashPerShare" => "cash_per_share",
    "CashRatio" => "cash_n_short_term_invest_to_total_current_liabilities",
    "CashToDebt" => "cash_n_short_term_invest_to_total_debt",
    "Category" => "category",
    "CfiCode" => "cfi_code",
    "ChaikinMoneyFlow" => "ChaikinMoneyFlow",
    "Change" => "change",
    "ChangeAbs" => "change_abs",
    "ChangeCrypto" => "change",
    "ChangeFromOpen" => "change_from_open",
    "ChangeFromOpenAbs" => "change_from_open_abs",
    "CommodityChannelIndex" => "CCI",
    "ContinuousDivGrowth" => "continuous_dividend_growth",
    "ContinuousDivPayout" => "continuous_dividend_payout",
    "Conversion" => "conversion_option",
    "CostOfSalesEstimate" => "cost_of_goods_estimate",
    "Country" => "country",
    "Coupon" => "coupon",
    "CouponChange" => "coupon_change_type",
    "CouponCurrency" => "coupon_currency",
    "CouponDateNext" => "coupon_date_next",
    "CouponDaycountBasis" => "coupon_daycount_type",
    "CouponExdateGap" => "coupon_exdate_gap",
    "CouponFrequency" => "coupon_frequency",
    "CouponLink" => "coupon_link",
    "CouponNextResetDate" => "coupon_next_reset_date",
    "CouponPaymentDateType" => "coupon_pmt_date_type",
    "CouponResetFrequency" => "coupon_reset_frequency",
    "CouponType" => "coupon_type_general",
    "CouponUnderlyingIndex" => "coupon_underlying_index",
    "Covenant" => "covenant",
    "CreatedContributors" => "contributorscreated",
    "CreatedPosts" => "postscreated",
    "CreditEnhancement" => "credit_enhancement_type",
    "CreditEnhancementStatus" => "credit_enhancement_status",
    "CreditParent" => "bond_issuer_cr_parent",
    "CryptoBlockchainEcosystems" => "crypto_blockchain_ecosystems",
    "CryptoCategory" => "crypto_common_categories",
    "CryptoConsensusAlgorithms" => "crypto_consensus_algorithms",
    "CurrencyHedged" => "currency_hedged_flag",
    "CurrentCoupon" => "current_coupon",
    "CurrentCouponType" => "coupon_type_current",
    "CurrentRatio" => "current_ratio",
    "CurrentYield" => "current_yield",
    "Cusip" => "cusip",
    "DailyActiveAddresses" => "addresses_active",
    "DebtToAssets" => "debt_to_asset",
    "DebtToEbitda" => "total_debt_to_ebitda",
    "DebtToEquityRatio" => "debt_to_equity",
    "DebtToRevenueRatio" => "debt_to_revenue",
    "DebtType" => "bond_type_gen",
    "DeepestHistory" => "is_primary",
    "DerivativeHoldings" => "holds_derivatives_flag",
    "DirectionalMovementIndex" => "ADX",
    "DiscountToPremiumToNav" => "nav_discount_premium",
    "DividendPayoutRatio" => "dividend_payout_ratio",
    "DividendTreatment" => "dividend_treatment",
    "DividendsFrequency" => "dividends_frequency",
    "DividendsPaid" => "neg_total_cash_dividends_paid",
    "DividendsPerShare" => "dps_common_stock_prim_issue",
    "DividendsPerShareEstimate" => "dps_estimate",
    "DividendsPerShareGrowth" => "dps_common_stock_prim_issue",
    "DividendsYield" => "dividends_yield",
    "DividendsYieldForward" => "dividends_yield",
    "DonchianChannels" => "DonchCh",
    "DurationType" => "duration_type",
    "EBITDAMargin" => "ebitda_margin",
    "EBITDAPerShare" => "ebitda_per_share",
    "EBITPerShare" => "ebit_per_share",
    "EarningsRecent" => "earnings_release_trading_date_fq",
    "EarningsUpcoming" => "earnings_release_next_trading_date_fq",
    "EarningsYield" => "earnings_yield",
    "EbitEstimate" => "ebit_estimate",
    "Ebitda" => "ebitda",
    "EbitdaEstimate" => "ebitda_estimate",
    "EbitdaGrowth" => "ebitda",
    "EbitdaInterestCoverage" => "ebitda_interst_cover",
    "EbitdaLessCapexInterestCoverage" => "ebitda_less_capex_interst_cover",
    "EbitdaPerEmployee" => "ebitda_per_employee",
    "EffectiveInterestRateOnDebt" => "effective_interest_rate_on_debt",
    "Elements" => "elements",
    "Ema" => "EMA",
    "Engagements" => "interactions",
    "EpsDiluted" => "earnings_per_share_diluted",
    "EpsDilutedGrowth" => "earnings_per_share_diluted",
    "EpsForecast" => "earnings_per_share_forecast_next",
    "EquityToAsset" => "shrhldrs_equity_to_total_assets",
    "Ev" => "enterprise_value_current",
    "EvToEbit" => "enterprise_value_to_ebit",
    "EvToEbitForward" => "enterprise_value_ebit_fwd",
    "EvToEbitda" => "enterprise_value_ebitda",
    "EvToEbitdaForward" => "enterprise_value_ebitda_fwd",
    "EvToFreeCashFlow" => "enterprise_value_to_free_cash_flow",
    "EvToGrossProfit" => "enterprise_value_to_gross_profit",
    "EvToRevenue" => "enterprise_value_to_revenue",
    "EvToRevenueForward" => "enterprise_value_sales_fwd",
    "Exchange" => "exchange",
    "ExpenseRatio" => "expense_ratio",
    "Expiration" => "expiration",
    "FScore" => "piotroski_f_score",
    "FaceValue" => "nominal_value",
    "Figi" => "figi.exchange-level",
    "FiscalPeriodEndDate" => "fiscal_period_end",
    "FitchIssuerOutlookLongTerm" => "issuer_fitch_outlook_lt",
    "FitchIssuerRatingLongTerm" => "issuer_fitch_rating_lt",
    "FitchIssuerRatingShortTerm" => "issuer_fitch_rating_st",
    "FitchOutlook" => "bond_fitch_outlook_lt",
    "FitchRatingLongTerm" => "bond_fitch_rating_lt",
    "FixedAssetsTurnover" => "fixed_assets_turnover",
    "FloatShares" => "float_shares_percent_current",
    "ForwardPriceToEarnings" => "non_gaap_price_to_earnings_per_share_forecast_next",
    "FreeCashFlow" => "free_cash_flow",
    "FreeCashFlowEstimate" => "free_cash_flow_estimate",
    "FreeCashFlowGrowth" => "free_cash_flow",
    "FreeCashFlowMargin" => "free_cash_flow_margin",
    "FreeCashFlowPerEmployee" => "free_cash_flow_per_employee",
    "FreeCashFlowPerShare" => "free_cash_flow_per_share",
    "FullyDilutedValuation" => "fully_diluted_value",
    "FundFlows" => "fund_flows",
    "FundingRate" => "funding_rate",
    "GalaxyScore" => "galaxyscore",
    "Gap" => "gap",
    "Goodwill" => "goodwill",
    "GrahamsNumber" => "graham_numbers",
    "GrossMargin" => "gross_margin",
    "GrossProfit" => "gross_profit",
    "GrossProfitEstimate" => "gross_profit_estimate",
    "GrossProfitGrowth" => "gross_profit",
    "High" => "high",
    "HighestIncomeCountry" => "top_revenue_country_code",
    "HoldingWeight" => "etf_holdings",
    "HullMovingAverage" => "HullMA",
    "IPODealAmount" => "ipo_deal_amount_usd",
    "IPOOfferDate" => "ipo_offer_date",
    "IPOOfferPrice" => "ipo_offer_price_usd",
    "IPOOfferPricePerformance" => "ipo_offer_price_performance",
    "IchimokuCloud" => "Ichimoku",
    "InceptionDate" => "launch_date",
    "Index" => "index_id",
    "IndexProvider" => "index_provider",
    "IndexTracked" => "index_tracked",
    "IndicatedAnnualDividend" => "indicated_annual_dividend",
    "Industry" => "industry",
    "InflationProtection" => "inflation_protection",
    "InterestCoverage" => "interst_cover",
    "InventoryTurnover" => "invent_turnover",
    "Isin" => "isin-displayed",
    "IssueAmount" => "issue_amount",
    "IssueCurrency" => "fundamental_currency_code",
    "IssueDate" => "issue_date",
    "IssueStatus" => "issue_status",
    "Issuer" => "issuer",
    "IssuerCountry" => "country",
    "KeltnerChannels" => "KltChnl",
    "LTDebt" => "long_term_debt",
    "LargeTransactionsNumber" => "large_tx_count",
    "LargeTransactionsVolumeInUsd" => "large_tx_volume_usd",
    "LastPriceUpdate" => "last-price-update-time",
    "LastPriceUpdateIntraday" => "last-price-update-time-intraday",
    "LastTradeTime" => "active_symbol",
    "Leverage" => "leverage",
    "LeverageRatio" => "leverage_ratio",
    "Leveraged" => "leveraged_flag",
    "Liquidations" => "liquidations_volume",
    "LiquidityDex" => "dex_total_liquidity",
    "Listing" => "is_primary",
    "LongLiquidations" => "long_liquidations_volume",
    "Low" => "low",
    "Ma" => "SMA",
    "Macd" => "MACD",
    "MakeWholeCall" => "make_whole_call_option",
    "MakeWholeCallEndDate" => "make_whole_call_end_date",
    "MakeWholeCallSpread" => "make_whole_call_spread",
    "MakeWholeCallStartDate" => "make_whole_call_start_date",
    "Management" => "actively_managed",
    "MarketCap" => "market_cap_basic",
    "MarketCapCalc" => "market_cap_calc",
    "MarketCapCalcDiluted" => "market_cap_diluted_calc",
    "MarketCapPerf" => "MarketCap",
    "MarketCapToTvl" => "market_cap_to_tvl",
    "MarketValue" => "etf_holdings",
    "MaturityDate" => "maturity_date",
    "MaturityType" => "maturity_type",
    "MaximumCouponRate" => "coupon_rate_ceiling",
    "MinDenominationIncrement" => "denom_increment",
    "MinimalCouponRate" => "coupon_rate_floor",
    "MinimumDenominationAmount" => "denom_min",
    "Momentum" => "Mom",
    "MoneyFlow" => "MoneyFlow",
    "NCAVPS" => "ncavps_ratio",
    "NavPerformance" => "nav_perf",
    "NavTotalReturn" => "nav_total_return",
    "NetAssetsValue" => "nav",
    "NetDebt" => "net_debt",
    "NetDebtToEbitda" => "net_debt_to_ebitda",
    "NetIncome" => "net_income",
    "NetIncomeEstimate" => "net_income_estimate",
    "NetIncomeFromContinuingOperations" => "income_from_cont_ops",
    "NetIncomeGrowth" => "net_income",
    "NetIncomePerEmployee" => "net_income_per_employee",
    "NetMargin" => "net_margin",
    "NetRevenue" => "net_revenue",
    "NetRevenueAfterProvision" => "net_revenue_after_provision",
    "NetworkValueToTransactionsRatio" => "nvt",
    "NewFundedAddresses" => "addresses_new",
    "Niche" => "niche",
    "NumberOfEmployees" => "number_of_employees",
    "NumberOfShareholders" => "number_of_shareholders",
    "OfferDate" => "offer_date",
    "OfferPrice" => "offer_price_pct",
    "OfferType" => "offer_type",
    "Open" => "open",
    "OpenInterest" => "open_interest",
    "OpenInterestChange" => "open_interest_change_percent",
    "OpenInterestVolume24h" => "open_interest_to_volume_24h",
    "OperatingCashFlowPerShare" => "operating_cash_flow_per_share",
    "OperatingIncome" => "oper_income",
    "OperatingIncomePerEmployee" => "oper_income_per_employee",
    "OperatingMargin" => "operating_margin",
    "OutstandingAmount" => "outstanding_amount",
    "OwnershipForm" => "ownership_form",
    "Pattern" => "candlestick_patterns",
    "PercentInTop10" => "weight_top_10",
    "PercentInTop25" => "weight_top_25",
    "PercentInTop50" => "weight_top_50",
    "Performance" => "Perf",
    "PivotCamarilla" => "Pivot.M.Camarilla",
    "PivotClassic" => "Pivot.M.Classic",
    "PivotDemark" => "Pivot.M.Demark",
    "PivotFibonacci" => "Pivot.M.Fibonacci",
    "PivotWoodie" => "Pivot.M.Woodie",
    "PlacementType" => "placement_type",
    "PledgeStatus" => "pledge_status",
    "PoisonPut" => "poison_put_option",
    "PortfolioTransparency" => "transparent_holding_flag",
    "PostMarketChange" => "postmarket_change",
    "PostMarketChangeAbs" => "postmarket_change_abs",
    "PostMarketClose" => "postmarket_close",
    "PostMarketHigh" => "postmarket_high",
    "PostMarketLow" => "postmarket_low",
    "PostMarketOpen" => "postmarket_open",
    "PostMarketVolume" => "postmarket_volume",
    "PreMarketChange" => "premarket_change",
    "PreMarketChangeAbs" => "premarket_change_abs",
    "PreMarketChangeFromOpen" => "premarket_change_from_open",
    "PreMarketChangeFromOpenAbs" => "premarket_change_from_open_abs",
    "PreMarketClose" => "premarket_close",
    "PreMarketGap" => "premarket_gap",
    "PreMarketHigh" => "premarket_high",
    "PreMarketLow" => "premarket_low",
    "PreMarketOpen" => "premarket_open",
    "PreMarketVolume" => "premarket_volume",
    "PreTaxMargin" => "pre_tax_margin",
    "PrematureRedemption" => "premature_redemption",
    "PreviousCouponDate" => "coupon_date_prev",
    "Price" => "close",
    "PriceAvgVolume" => "AvgValue.Traded",
    "PriceToBook" => "price_book_fq",
    "PriceToBookForward" => "price_book_fwd",
    "PriceToCashFlow" => "price_to_cash_f_operating_activities_ttm",
    "PriceToCashRatio" => "price_to_cash_ratio",
    "PriceToEarnings" => "price_earnings_ttm",
    "PriceToEarningsForward" => "price_earnings_fwd",
    "PriceToEarningsToGrowth" => "price_earnings_growth",
    "PriceToFreeCashFlow" => "price_free_cash_flow_ttm",
    "PriceToNetWorkingCapital" => "price_to_working_capital_fq",
    "PriceToSales" => "price_sales_current",
    "PriceToSalesForward" => "price_sales_fwd",
    "PrincipalRedemptionType" => "principal_redemption_type",
    "Psar" => "P.SAR",
    "PutFrequency" => "put_frequency",
    "PutNextDate" => "put_next_date",
    "PutNextPrice" => "put_next_price",
    "QuickRatio" => "quick_ratio",
    "QuoteCurrency" => "currency_id",
    "ROEAdjustedToBook" => "return_on_equity_adjust_to_book",
    "Rank" => "crypto_total_rank",
    "RateOfChange" => "ROC",
    "RatingMa" => "MARating",
    "RatingOscillators" => "OsRating",
    "ReceivablesTurnover" => "receivables_turnover",
    "RecentFiscalPeriod" => "fiscal_period",
    "Redemption" => "redemption_type",
    "RedemptionAmount" => "final_redemption_amount",
    "Region" => "holdings_region",
    "RelativeStrengthIndex" => "RSI",
    "RelativeVolume" => "relative_volume_10d_calc",
    "RelativeVolumeAtTime" => "relative_volume_intraday|5",
    "RelativeVolumeAtTimeCex" => "relative_volume_intraday_usd|5",
    "RelativeVolumeCex" => "relative_volume_10d_calc_usd",
    "ReportedEps" => "earnings_per_share",
    "ResearchNDevelopment" => "neg_research_and_dev",
    "ResearchNDevelopmentEstimate" => "research_and_dev_estimate",
    "ResearchNDevelopmentPerEmployee" => "research_and_dev_per_employee",
    "ResearchNDevelopmentRatio" => "research_and_dev_ratio",
    "ReturnOnAssets" => "return_on_assets",
    "ReturnOnCapitalEmployed" => "return_on_capital_employed",
    "ReturnOnCommonEquity" => "return_on_common_equity",
    "ReturnOnEquity" => "return_on_equity",
    "ReturnOnInvestedCapital" => "return_on_invested_capital",
    "ReturnOnTangibleAssets" => "return_on_tang_assets",
    "ReturnOnTangibleEquity" => "return_on_tang_equity",
    "ReturnOnTotalCapital" => "return_on_total_capital",
    "RevenueEstimate" => "revenue_forecast_next",
    "RevenueGrowth" => "total_revenue",
    "RevenuePerEmployee" => "revenue_per_employee",
    "RevenuePerShare" => "revenue_per_share",
    "STDebt" => "short_term_debt",
    "Sector" => "sector",
    "SelectionCriteria" => "selection_criteria",
    "SellVolumeDex" => "dex_sell_volume",
    "SellingGeneralNAdminExpensesEstimate" => "sell_gen_admin_exp_total_estimate",
    "SellingGeneralNAdminExpensesRatio" => "sell_gen_admin_exp_other_ratio",
    "SellsDex" => "dex_sells",
    "SeniorityLevel" => "seniority_level",
    "Sentiment" => "sentiment",
    "SharesBuyback" => "share_buyback_ratio",
    "SharesFloat" => "float_shares_outstanding_current",
    "SharesOutstanding" => "shares_outstanding",
    "Shariah" => "is_shariah_compliant",
    "ShortLiquidations" => "short_liquidations_volume",
    "SinkingFund" => "sinking_fund",
    "SloanRatio" => "sloan_ratio",
    "SnpIssuerOutlookLongTerm" => "bond_issuer_snp_outlook_lt",
    "SnpIssuerRatingLongTerm" => "issuer_snp_rating_lt",
    "SnpIssuerRatingShortTerm" => "issuer_snp_rating_st",
    "SnpOutlook" => "bond_snp_outlook_lt",
    "SnpRatingLongTerm" => "bond_snp_rating_lt",
    "SocialDominance" => "socialdominance",
    "SocialResponsibility" => "social_responsibility",
    "SocialVolume" => "social_volume_24h",
    "Source" => "exchange",
    "Stochastic" => "Stoch",
    "StochasticRsi" => "Stoch.RSI",
    "Strategy" => "strategy",
    "SubMarket" => "submarket",
    "SupplyCirculating" => "circulating_supply",
    "SupplyMax" => "max_supply",
    "SupplyTotal" => "total_supply",
    "SustainableGrowthRate" => "sustainable_growth_rate",
    "SymbolCurrency" => "currency_id",
    "SymbolType" => "type",
    "TangibleBookPerShare" => "book_tangible_per_share",
    "TargetPrice" => "price_target",
    "TargetPricePerformance" => "price_target",
    "TaxForm" => "k1_form",
    "TechnicalRating" => "TechRating",
    "Telegram" => "telegram",
    "Tenor" => "tenor",
    "TickerInstrumentUniversal" => "ticker-view",
    "TickerLinkIndustry" => "ticker-view",
    "TickerLinkSector" => "ticker-view",
    "TickerUniversal" => "ticker-view",
    "TimeToMaturity" => "days_to_maturity",
    "TobinsQ" => "tobin_q_ratio",
    "TotalAssets" => "total_assets",
    "TotalAssetsEstimate" => "total_assets_estimate",
    "TotalAssetsGrowth" => "total_assets",
    "TotalAssetsPerEmployee" => "total_assets_per_employee",
    "TotalCurrentAssets" => "total_current_assets",
    "TotalCurrentLiabilities" => "total_current_liabilities",
    "TotalDebt" => "total_debt",
    "TotalDebtEstimate" => "total_debt_estimate",
    "TotalDebtGrowth" => "total_debt",
    "TotalDebtPerEmployee" => "total_debt_per_employee",
    "TotalDebtPerShare" => "total_debt_per_share",
    "TotalDebtToCapital" => "total_debt_to_capital",
    "TotalEquity" => "total_equity",
    "TotalHoldings" => "etf_holdings_count",
    "TotalLiabilities" => "total_liabilities",
    "TotalRevenue" => "total_revenue",
    "TotalSharesOutstanding" => "total_shares_outstanding_current",
    "TotalValueLocked" => "tvl",
    "TradersDex" => "dex_txs_count_uniq",
    "TradingVolumeDex" => "dex_trading_volume",
    "TransactionsAverageInUsd" => "average_transaction_usd",
    "TransactionsDex" => "dex_txs_count",
    "TransactionsNumber" => "txs_count",
    "TransactionsVolume" => "txs_volume",
    "TransactionsVolumeInUsd" => "txs_volume_usd",
    "Tweets" => "tweets",
    "UcitsEtf" => "ucits_compliant_flag",
    "UltimateOscillator" => "UO",
    "UniqBuyersDex" => "dex_buyers",
    "UniqSellersDex" => "dex_sellers",
    "Velocity" => "velocity",
    "Volatility" => "Volatility",
    "Volume" => "volume",
    "Volume1d" => "volume",
    "Volume24h" => "vol|5",
    "Volume24hChange" => "vol_change|5",
    "Volume24hChangeCoin" => "vol_change_cmc",
    "Volume24hCoin" => "vol_cmc",
    "VolumeChange" => "volume_change",
    "VolumeChangeAbs" => "volume_change_abs",
    "VolumePrice" => "Value.Traded",
    "VolumeToMarketCap" => "24h_vol_to_market_cap",
    "VolumeWeightedAveragePrice" => "VWAP",
    "VolumeWeightedMovingAverage" => "VWMA",
    "WeightingScheme" => "weighting_scheme",
    "WilliamsPercentRange" => "W.R",
    "WorkingCapitalPerShare" => "working_capital_per_share",
    "YieldToCall" => "yield_to_call",
    "YieldToMaturity" => "yield_to_maturity",
    "YieldToPut" => "yield_to_put",
    "YieldToWorst" => "yield_to_worst",
    "ZmijewskiScore" => "zmijewski_score",
    "focus" => "focus"
}.freeze

Class Method Summary collapse

Class Method Details

.fetch(url, cookies: nil, proxy: nil, timeout: 20, headers: nil) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/tradingview_screener/screen_data.rb', line 35

def fetch(url, cookies: nil, proxy: nil, timeout: 20, headers: nil)
  Fetcher.new(
    cookies: cookies,
    proxy: proxy,
    timeout: timeout,
    headers: headers
  ).fetch(url)
end

.parse_html(html) ⇒ Object



31
32
33
# File 'lib/tradingview_screener/screen_data.rb', line 31

def parse_html(html)
  Parser.extract_screen_data(html)
end

.to_payload(screen_data, field_contract: nil) ⇒ Object



16
17
18
# File 'lib/tradingview_screener/screen_data.rb', line 16

def to_payload(screen_data, field_contract: nil)
  Converter.new(screen_data, field_contract: field_contract).to_payload
end

.to_relation(screen_data, model: Stock, field_contract: nil) ⇒ Object



27
28
29
# File 'lib/tradingview_screener/screen_data.rb', line 27

def to_relation(screen_data, model: Stock, field_contract: nil)
  model.from_payload(to_payload(screen_data, field_contract: field_contract))
end

.to_validated_payload(screen_data, client: nil, cookies: nil, proxy: nil, timeout: 20, headers: nil) ⇒ Object



20
21
22
23
24
25
# File 'lib/tradingview_screener/screen_data.rb', line 20

def to_validated_payload(screen_data, client: nil, cookies: nil, proxy: nil, timeout: 20, headers: nil)
  converter = Converter.new(screen_data)
  http = client || Client.new(timeout: timeout, cookies: cookies, proxy: proxy, headers: headers)
  contract = FieldContract.fetch(markets: converter.markets, client: http)
  Converter.new(screen_data, field_contract: contract).to_payload
end