EPS+Sales+Net Profit+MCap+Sector & Industry📄 Full Description
This script displays a comprehensive financial data panel directly on your TradingView chart, helping long-term investors and swing traders make informed decisions based on fundamental trends. It consolidates key financial metrics and business classification data into a single, visually clear table.
🔍 Key Features:
🧾 Financial Metrics (Auto-Fetched via request.financial):
EPS (Earnings Per Share) – Displayed with trend direction (QoQ or YoY).
Sales / Revenue – In ₹ Crores (for Indian stocks), trend change also included.
Net Profit – Also in ₹ Crores, along with percentage change.
Market Cap – Automatically calculated using outstanding shares × price, shown in ₹ Cr.
Free Float Market Cap – Based on float shares × price, also in ₹ Cr.
🏷️ Sector & Industry Info:
Automatically identifies and displays the Sector and Industry of the stock using syminfo.sector and syminfo.industry.
Displayed inline with metrics, making it easy to know what business the stock belongs to.
📊 Table View:
Compact and responsive table shown on your chart.
Columns: Date | EPS | QoQ | Sales | QoQ | Net Profit | QoQ | Metrics
Metrics column dynamically shows:
Market Cap
Free Float
Sector (Row 4)
Industry (Row 5)
🌗 Appearance:
Supports Dark Mode and Mini Mode toggle.
You can also customize:
Number of data points (last 4+ quarters or years)
Table position and size
🎯 Use Case:
This script is ideal for:
Fundamental-focused traders who use EPS/Sales trends to identify momentum.
Swing traders who combine price action with fundamental tailwinds.
Portfolio builders who want to see sector/industry alignment quickly.
It works best with fundamentally sound stocks where earnings and profitability are a major factor in price movements.
✅ Important Notes:
Script uses request.financial which only works with supported symbols (mostly stocks).
Market Cap and Free Float are calculated in ₹ Crores.
All financial values are rounded and formatted for readability (e.g., 1,234 Cr).
🙏 Credits:
Developed and published by Sameer Thorappa
Built with a clean, minimalist approach for high readability and functionality.
Netprofit
Replica of TradingView's Backtesting Engine with ArraysHello everyone,
Here is a perfectly replicated TradingView backtesting engine condensed into a single library function calculated with arrays. It includes TradingView's calculations for Net profit, Total Trades, Percent of Trades Profitable, Profit Factor, Max Drawdown (absolute and percent), and Average Trade (absolute and percent). Here's how TradingView defines each aspect of its backtesting system:
Net Profit: The overall profit or loss achieved.
Total Trades: The total number of closed trades, winning and losing.
Percent Profitable: The percentage of winning trades, the number of winning trades divided by the total number of closed trades.
Profit Factor: The amount of money the strategy made for every unit of money it lost, gross profits divided by gross losses.
Max Drawdown: The greatest loss drawdown, i.e., the greatest possible loss the strategy had compared to its highest profits.
Average Trade: The sum of money gained or lost by the average trade, Net Profit divided by the overall number of closed trades.
Here's how each variable is defined in the library function:
_backtest(bool _enter, bool _exit, float _startQty, float _tradeQty)
bool _enter: When the strategy should enter a trade (entry condition)
bool _exit: When the strategy should exit a trade (exit condition)
float _startQty: The starting capital in the account (for BTCUSD, it is the amount of USD the account starts with)
float _tradeQty: The amount of capital traded (if set to 1000 on BTCUSD, it will trade 1000 USD on each trade)
Currently, this library only works with long strategies, and I've included a commented out section under DEMO STRATEGY where you can replicate my results with TradingView's backtesting engine. There's tons I could do with this beyond what is shown, but this was a project I worked on back in June of 2022 before getting burned out. Feel free to comment with any suggestions or bugs, and I'll try to add or fix them all soon. Here's my list of thing to add to the library currently (may not all be added):
Add commission calculations.
Add support for shorting
Add a graph that resembles TradingView's overview graph.
Clean and optimize code.
Clean up in a way that makes it easy to add other TradingView calculations (such as Sharpe and Sortino ratio).
Separate all variables, so they become accessible outside of calculations (such as gross profit, gross loss, number of winning trades, number of losing trades, etc.).
Thanks for reading,
OztheWoz