Market Cap Landscape 3DHello, traders and creators! 👋
Market Cap Landscape 3D. This project is more than just a typical technical analysis tool; it's an exploration into what's possible when code meets artistry on the financial charts. It's a demonstration of how we can transcend flat, two-dimensional lines and step into a vibrant, three-dimensional world of data.
This project continues a journey that began with a previous 3D experiment, the T-Virus Sentiment, which you can explore here:
The Market Cap Landscape 3D builds on that foundation, visualizing market data—particularly crypto market caps—as a dynamic 3D mountain range. The entire landscape is procedurally generated and rendered in real-time using the powerful drawing capabilities of polyline.new() and line.new() , pushed to their creative limits.
This work is intended as a guide and a design example for all developers, born from the spirit of learning and a deep love for understanding the Pine Script™ language.
---
🧐 Core Concept: How It Works
The indicator synthesizes multiple layers of information into a single, cohesive 3D scene:
The Surface: The mountain range itself is a procedurally generated 3D mesh. Its peaks and valleys create a rich, textured landscape that serves as the canvas for our data.
Crypto Data Integration: The core feature is its ability to fetch market cap data for a list of cryptocurrencies you provide. It then sorts them in descending order and strategically places them onto the 3D surface.
The Summit: The highest point on the mountain is reserved for the asset with the #1 market cap in your list, visually represented by a flag and a custom emblem.
The Mountain Labels: The other assets are distributed across the mountainside, with their rank determining their general elevation. This creates an intuitive visual hierarchy.
The Leaderboard Pole: For clarity, a dedicated pole in the back-right corner provides a clean, ranked list of the symbols and their market caps, ensuring the data is always easy to read.
---
🧐 Example of adjusting the view
To evoke the feeling of flying over mountains
To evoke the feeling of looking at a mountain peak on a low plain
🧐 Example of predefined colors
---
🚀 How to Use
Getting started with the Market Cap Landscape 3D:
Add to Chart: Apply the "Market Cap Landscape 3D" indicator to your active chart.
Open Settings: Double-click anywhere on the 3D landscape or click the "Settings" icon next to the indicator's name.
Customize Your Crypto List: The most important setting is in the Crypto Data tab. In the "Symbols" text area, enter a comma-separated list of the crypto tickers you want to visualize (e.g., BTC,ETH,SOL,XRP ). The indicator supports up to 40 unique symbols.
> Important Note: This indicator exclusively uses TradingView's `CRYPTOCAP` data source. To find valid symbols, use the main symbol search bar on your chart. Type `CRYPTOCAP:` (including the colon) and you will see a list of available options. For example, typing `CRYPTOCAP:BTC` will confirm that `BTC` is a valid ticker for the indicator's settings. Using symbols that do not exist in the `CRYPTOCAP` index will result in a script error. or, to display other symbols, simply type CRYPTOCAP: (including the colon) and you will see a list of available options.
Adjust Your View: Use the settings in the Camera & Projection tab to rotate ( Yaw ), tilt ( Pitch ), and scale the landscape until you find a view you love.
Explore & Customize: Play with the color palettes, flag design, and other settings to make the landscape truly your own!
---
⚙️ Settings & Customization
This indicator is highly customizable. Here’s a breakdown of what each setting does:
#### 🪙 Crypto Data
Symbols: Enter the crypto tickers you want to track, separated by commas. The script automatically handles duplicates and case-insensitivity.
Show Market Cap on Mountain: When checked, it displays the full market cap value next to the symbol on the mountain. When unchecked, it shows a cleaner look with just the symbol and a colored circle background.
#### 📷 Camera & Projection
Yaw (°): Rotates the camera view horizontally (side to side).
Pitch (°): Tilts the camera view vertically (up and down).
Scale X, Y, Z: Stretches or compresses the landscape in width, depth, and height, respectively. Fine-tune these to get the perfect perspective.
#### 🏞️ Grid / Surface
Grid X/Y resolution: Controls the detail level of the 3D mesh. Higher values create a smoother surface but may use more resources.
Fill surface strips: Toggles the beautiful color gradient on the surface.
Show wireframe lines: Toggles the visibility of the grid lines.
Show nodes (markers): Toggles the small dots at each grid intersection point.
#### 🏔️ Peaks / Mountains
Fill peaks volume: Draws vertical lines on high peaks, giving them a sense of volume.
Fill peaks surface: Draws a cross-hatch pattern on the surface of high peaks.
Peak height threshold: Defines the minimum height for a peak to receive the fill effect.
Peak fill color/density: Customizes the appearance of the fill lines.
#### 🚩 Flags (3D)
Show Flag on Summit: A master switch to show or hide the flag and emblem entirely.
Flag height, width, etc.: Provides full control over the dimensions and orientation of the flag on the highest peak.
#### 🎨 Color Palette
Base Gradient Palette: Choose from 13 stunning, pre-designed color themes for the landscape, from the classic SUNSET_WAVE to vibrant themes like NEON_DREAM and OCEANIC .
#### 🛡️ Emblem / Badge Controls
This section gives you granular control over every element of the custom emblem on the flag. Tweak rotation, offsets, and scale to design your unique logo.
---
👨💻 Developer's Corner: Modifying the Core Logic
If you're a developer and wish to customize the indicator's core data source, this section is for you. The script is designed to be modular, making it easy to change what data is being ranked and visualized.
The heart of the data retrieval and ranking logic is within the f_getSortedCryptoData() function. Here’s how you can modify it:
1. Changing the Data Source (from Market Cap to something else):
The current logic uses request.security("CRYPTOCAP:" + syms.get(i), ...) to fetch market capitalization data. To change this, you need to modify this line.
Example: Ranking by RSI (14) on the Daily timeframe.
First, you'll need a function to calculate RSI. Add this function to the script:
f_getRSI(symbol, timeframe, length) =>
request.security(symbol, timeframe, ta.rsi(close, length))
Then, inside f_getSortedCryptoData() , find the `for` loop that populates the `caps` array and replace the `request.security` call:
// OLD LINE:
// caps.set(i, request.security("CRYPTOCAP:" + syms.get(i), timeframe.period, close))
// NEW LINE for RSI:
// Note: You'll need to decide how to format the symbol name (e.g., "BINANCE:" + syms.get(i) + "USDT")
caps.set(i, f_getRSI("BINANCE:" + syms.get(i) + "USDT", "D", 14))
2. Changing the Data Formatting:
The ranking values are formatted for display using the f_fmtCap() function, which currently formats large numbers into "M" (millions), "B" (billions), etc.
If you change the data source to something like RSI, you'll want to change the formatting. You can modify f_fmtCap() or create a new formatting function.
Example: Formatting for RSI.
// Modify f_fmtCap or create f_fmtRSI
f_fmtRSI(float v) =>
str.tostring(v, "#.##") // Simply format to two decimal places
Remember to update the calls to this function in the main drawing loop where the labels are created (e.g., str.format("{0}: {1}", crypto.symbol, f_fmtCap(crypto.cap)) ).
By modifying these key functions ( f_getSortedCryptoData and f_fmtCap ), you can adapt the Market Cap Landscape 3D to visualize and rank almost any dataset you can imagine, from technical indicators to fundamental data.
---
We hope you enjoy using the Market Cap Landscape 3D as much as we enjoyed creating it. Happy charting! ✨
Theme
Custom Index CompositeCustom Index Composite calculates an unweighted composite index by averaging the daily returns of multiple stock tickers. Instead of using price-level weighting, it focuses solely on percentage change, allowing you to compare diverse market themes side by side on a common basis.
Why Use a Custom Index Composite?
Unlike traditional indices that often lean on market capitalization or price-level data, a custom composite based solely on returns strips out the bias inherent to high-priced stocks. This provides several benefits:
Objective Cross-Comparison:
When stocks or market themes trade at very different price levels, it can be difficult to assess performance objectively. Using percentage returns, the composite creates an even playing field, enabling a clear comparison between different assets or themes.
Tailored Benchmarking:
By selecting and combining specific tickers, you can create benchmarks that better represent the segments or strategies you’re interested in. This is particularly useful when standard indices do not capture the nuances of your investment approach.
Performance Normalization:
Converting raw price data into daily percentage returns minimizes distortions that arise from price differences. This normalization helps in understanding true performance trends across the chosen tickers, making the composite index a more reliable gauge of relative market movement.
Custom Analysis Framework:
The indicator offers flexibility to adjust the lookback period (defaulting to about 3 months) so you can fine-tune the sensitivity of the index to recent market behavior. This enables you to either smooth out volatility or capture a more immediate trend, depending on your analytical needs.
Key Features:
Configurable Appearance:
You can easily configure the line color, line width, index name, and index name color via the options panel.
Ticker Configuration:
By default, you can enter up to 15 different tickers into the composite index. Technically, the indicator supports up to 40 tickers (these additional inputs are commented out by default to maintain performance), and you may enable them individually if required.
Calculated Bars Length:
The indicator uses a “Calculated bars length” setting, which is set by default to 63 days (approximately 3 months). This value can be adjusted, and it is recommended to use the greatest common denominator for consistent analysis.
How To Configure Your Chart:
Add the Indicator:
Place the Custom Index Composite on your chart.
Disable Main Symbol Visibility:
Hide the primary symbol’s plot and set its scale to “None” to prevent interference with the composite display.
Pin to Right Scale:
Set the scale of the first composite indicator to “Pinned to right scale.” This helps maintain consistency across different composite indicators.
Add Multiple Composites:
You can add additional composite indicators and set their scales to “Pinned to right scale” (or alternatively to “A”) for convenient comparison.
Limitations:
If a ticker symbol is set once in the options, it cannot be cleared to an empty value later. As a result, the symbol will continue to appear in the indicator’s title on the chart. The only way to remove an unwanted symbol is to completely reset the settings and re-enter your desired tickers.
Candles ThemesGood morning,
Here is my first script as a pinecoder.
So I present to you my indicator: the “Candles Theme”.
Instead of searching for a long time in the chart settings to change the style of the chart, you can use this indicator which offers:
- 8 default themes.
- The ability to create a custom theme.
Themes :
- Pink - Blue : Dark and Light
- Classic : Dark and Light
- Blue - Orange Classic : Dark and Light
- Dark Monochrome : Only Dark
- Light Monochrome : Only Light
- Blue - Orange 2 : Light and Dark
- Pastel 1 : Light and Dark
- Pastel 2 : Only Light
Being a trader and PineScript developer, I often create scripts according to my needs like this, but this is the first time I have published it.
If you have any questions or suggestions for improvement, please let me know in the comments.
End
Fetch TrendsThis indicator can be used as a tool to measure the strength of the current trend. It is also trying to achieve to alert traders on when a trend can shift.
In order to achieve this, it uses three simple indicators:
1: 9 Simple moving average
2: 50 Simple moving average
3: Rsi (14)
The moving averages are used to define the current trend of the market, and the rsi is used to measure the strength. We use a color gradient to reach our second goal with this indicator.
The gradient is calculated based on the rsi value, which means the trader can use this indicator to visualize the strength of the current trend. It also helps to alert the trader when the trend starts to shift.
Lets say we use green to signal a strong positive trend, and blue for a weak positive trend. The candles are green in a strong uptrend, and are getting more blue once the trend starts to weaken.
As soon as the trend shifts from bullish to bearish, the bars become a diferent color.
Old Buddy Old Pal... Color Scheme Pallet GeneratorFor the Tasteful Pine Coder, Find your inner rainbow.
Color pallet tool with 7 standard colors as per syntax highlighters typical scheme.
Hue, Sat, Lum adjustments, transparency, and 4 different modes.
Please Share in comments any Chart Captures showcasing your designs if his tool helped you.
a library version is in the works as of may 2022. will enable a 7 color standard output direct into script with floating color input shifting of the whole pallet or partials.
(( next level past gradients)
[e2] Color Gradient Function20 step red/green gradient function
The color gradient function allow colorize any source in 5% steps.
Define the source, minimum and maximum value (constant or , for example, bb (or any other channel)).