Rounded Grid Levels🟩 Rounded Grid Levels is a visual tool that helps traders quickly identify key psychological price levels on any chart. By dynamically adapting to the user's visible screen area, it provides consistent, easy-to-read round number grids that align with price action. The indicator offers a traditional visualization of horizontal round level grids, along with enhanced options such as tilted grids that align with market sentiment, and fan-shaped grids for alternative price interaction views. It serves purely as a visual aid, providing an adaptable way to observe rounded price levels without making predictions or generating trading signals.
⚡ OVERVIEW ⚡
The Rounded Grid Levels indicator is a visual tool designed to help traders identify and track price levels that may hold psychological significance, such as round numbers or significant milestones. These levels often serve as potential areas for price reactions, including support, resistance, or points of market interest. The indicator's gridlines are determined by user-defined settings and adjust dynamically based on the visible chart area, meaning they are influenced by the user's current zoom level and perspective. This behavior is similar to TradingView's built-in grid lines found in the chart settings canvas, which also adjust in real-time based on the visible screen, ensuring the most relevant price levels are displayed. By default, the indicator provides consistent gridlines to represent traditional round number levels, offering a straightforward view of key psychological areas. Additionally, users have access to experimental and novel configurations, such as fan-shaped layouts, which expand from a central point and adapt directionally based on user settings. This configuration can provide an alternate perspective for traders, especially useful in analyzing broader market moves and visualizing expansion relative to the current price.
Users can display the gridlines in a variety of configurations, including horizontal, neutral, auto, or fan-shaped layouts, depending on their preferred method of analysis. This flexibility allows traders to focus on different types of price action without overcrowding the visual representation of price movements.
This indicator is intended purely as a visual aid for understanding how price interacts with rounded levels over time. It does not generate predictive trading signals or recommendations but rather provides traders with a customizable framework to enhance their market analysis.
⭕ ROUND NUMBERS IN MARKET PSYCHOLOGY ⭕
Round numbers hold a significant place in financial markets, largely due to the psychological tendencies of traders and investors. These levels often represent areas of interest where human behavior, market biases, and trading strategies converge. Whether it's prices ending in 000, 500, or other recognizable values, these levels naturally attract more attention and influence decision-making.
Round numbers can act as key support or resistance levels and often become focal points in market activity. They are frequently highlighted by financial media, embedded in products like options, and serve as foundations for various trading theories. Their impact extends across different market participants and strategies, making them important focal points in both short-term and long-term market analysis.
Round numbers play an important role in guiding trader behavior and market activity. To better understand why these levels are so impactful, there are several key factors that highlight their significance in trading and price dynamics:
Psychological Impact : Humans naturally gravitate toward round numbers, such as prices ending in 000, 500, or 00. These levels tend to draw attention as traders perceive them as psychologically significant. This behavior is rooted in the cognitive bias known as "left-digit bias," where people assign greater importance to rounded, more recognizable numbers. In trading, this means that prices at these levels are more memorable and thus more likely to attract attention, creating an area where traders focus their buying or selling decisions.
Order Clustering : Traders often place buy and sell orders around these rounded levels, either manually or automatically through stop and limit orders. This clustering leads to the formation of visible support or resistance zones, as the concentrated orders tend to influence price behavior around these key levels. Market participants tend to converge their orders around these price points because of their perceived psychological importance, creating a liquidity pocket. As a result, these areas often act as barriers that the price either struggles to cross or uses as springboards for further movement.
External Influences : Financial media frequently highlights round-number milestones, amplifying market sentiment and drawing traders' attention to these levels. Additionally, algorithmic trading systems often react to round-number thresholds, which can further reinforce price movements, creating self-reinforcing reactions at these levels. As media and analysts emphasize these milestones, more traders pay attention to them, leading to increased volume and often heightened volatility at those points. This self-reinforcing cycle makes round numbers an area where price movement can either accelerate due to a breakout or stall because of clustering interest.
Option Strike Prices : Options contracts typically have strike prices set at round numbers, and as expiration approaches, these levels can influence the price of the underlying asset due to concentrated trading activity. The behavior around these levels, often called "pinning," happens because traders adjust their positions to avoid unfavorable scenarios at these key strikes. This activity tends to concentrate price movement toward these levels as traders hedge their positions, leading to increased liquidity and the potential for abrupt price reactions near option expiration dates.
Whole Number Theory : This theory suggests that whole numbers act as natural psychological barriers, where traders tend to make decisions, place orders, or expect price reactions, making these levels crucial for analysis. Whole numbers are simple to remember and are often used as informal targets for profit-taking or stop placement. This behavior leads to a natural ebb and flow around these levels, where the market finds equilibrium temporarily before deciding on a future direction. Whole numbers tend to work like magnets, drawing price to them and often creating reactions that are visible across different timeframes.
Quarters Theory : Commonly used in Forex markets, this theory focuses on quarter-point increments (e.g., 1.0000, 1.2500, 1.5000) as key levels where price often pauses or reverses. These quarter levels are treated as important psychological barriers, with price frequently interacting at these intervals. Traders use these points to gauge market strength or weakness because quarter levels divide larger round-number ranges into more manageable and meaningful segments. For example, in highly traded forex pairs like EUR/USD, traders might treat 1.2500 as a significant barrier because it represents a halfway point between 1.0000 and 1.5000, offering a balanced reference point for decision-making.
Big Round Numbers : Major round numbers, such as 100, 500, or 1000, often attract significant attention and serve as psychological thresholds. Traders anticipate strong reactions when prices approach or cross these levels. This is often because large round numbers symbolize major milestones, and price behavior around them tends to signal important market sentiment shifts. When price crosses a major level, such as a stock moving above $100 or Bitcoin crossing $50,000, it often creates a surge in trading activity as it is viewed as a validation or invalidation of market trends, drawing in momentum traders and triggering both retail and institutional responses.
By visualizing these round levels on the chart, the Rounded Grid Levels indicator helps traders identify areas where price may pause, reverse, or gain momentum. While round numbers provide useful insights, they should be used in conjunction with other technical analysis tools for a comprehensive trading strategy.
🛠️ CONFIGURATION AND SETTINGS 🛠️
The Rounded Grid Levels indicator offers a variety of configurable settings to tailor the visualization according to individual trader preferences. Below are the key settings available for customization:
Custom Settings
Rounding Step : The Rounding Step parameter sets the minimum interval between gridlines. This value determines how closely spaced the rounded levels are on the chart. For example, if the Rounding Step is set to 100, gridlines will be displayed at every 100 points (e.g., $100, $200, $300) relative to the current price level. The Rounding Step is scaled to the chart's visible area, meaning users should adjust it appropriately for different assets to ensure effective visualization. Lower values provide a more granular view, while larger values give a broader, higher-level perspective.
Major Grids : Defines the interval at which major gridlines will appear compared to minor ones. For example, if the Rounding Step is 100 and Major Grids is set to 10, major gridlines will be displayed every $1,000, while minor gridlines will be at every $100. This distinction allows traders to better visualize key psychological levels by emphasizing significant price intervals.
Direction : Users can select the gridline direction, choosing between options such as 'Up', 'Down', 'Auto', or 'Neutral'. This setting controls how the gridlines extend relative to the current price level, which can help in analyzing directional trends.
Neutral Direction : This option provides balanced gridlines both above and below the current price, allowing traders to visualize support and resistance levels symmetrically. This is useful for analyzing sideways or ranging markets without directional bias.
Up Direction : The gridlines are tilted upwards, starting from visible lows and extending toward the rounded level at the current price. By choosing Up , traders emphasize an upward sentiment, visualizing price action that aligns with rising trends. This option helps illustrate potential areas where pullbacks may occur, as well as how price might expand upwards in the current market context.
Down Direction : The gridlines are tilted downwards, starting from visible highs and extending toward the rounded level at the current price. Selecting Down allows traders to emphasize a downward sentiment, visualizing how price may expand downwards, which is particularly useful when analyzing downtrends or potential correction levels. The gridlines provide an illustrative view of how price interacts with lower levels during market declines.
Auto Direction : The gridlines automatically adjust their direction based on recent market trends. This adaptive option allows traders to visualize gridlines that dynamically change according to price action, making it suitable for evolving market conditions where the direction is uncertain. It’s useful for traders looking for an indicator that moves in sync with market shifts and doesn’t require manual adjustment.
Grid Type : Allows users to choose between 'Linear' or 'Fan' grid types. The Linear type creates evenly spaced gridlines that can be either horizontal or tilted, depending on the chosen direction setting, providing a straightforward view of price levels. The Fan type radiates lines from a central point, offering a more dynamic perspective for analyzing price expansions relative to the current price. These grid types introduce experimental visualizations influenced by chart properties, including visible highs, lows, and the current price. Regardless of the configuration, the gridlines will always end at the current bar, which represents a rounded price level, ensuring consistency in how key price areas are displayed.
Extend : This setting allows gridlines to be projected into the future, helping traders see potential levels beyond the current bar. When enabled, the behavior of the extended lines varies based on the selected grid type and direction. For Neutral and Horizontal Linear settings, the extended gridlines maintain their round-number alignment indefinitely. However, for Up , Down , or Auto directions, the angle of the extended gridlines can change dynamically based on the chart’s visible high and low or the latest price action. As a result, extended lines may not continue to align with round-number levels beyond the current bar, reflecting instead the current trend and sentiment of the market. Regardless of direction, extended gridlines remain consistently spaced and either parallel or evenly distributed, ensuring a structured visual representation.
Color Settings : Users can customize the colors for resistance, support, and minor gridlines at the current price. This helps in visually distinguishing between different grid types and their significance on the chart.
Color Options
These configuration options make the Rounded Grid Levels indicator a versatile tool for traders looking to customize their charts based on their personal trading strategies and analytical preferences.
🖼️ CHART EXAMPLES 🖼️
The following chart examples illustrate different configurations available in the Rounded Grid Levels indicator. These examples show how variations in grid type, direction, and rounding step settings impact the visualization of price levels. Traders may find that smaller rounding steps are more effective on lower time frames, where precision is key, whereas larger rounding steps help to reduce clutter and highlight key levels on higher time frames. Each image includes a caption to explain the specific configuration used, helping users better understand how to apply these settings in different market conditions.
Smaller Rounding Step (100) : With a smaller rounding step, the gridlines are spaced closely together. This setting is particularly useful for lower time frames where price action is more granular and finer details are needed. It allows traders to track price interactions at narrower levels, but on higher time frames, it may lead to clutter and exceed Pine Script's 500-line limit.
Larger Rounding Step (1000) : With a larger rounding step, the gridlines are spaced farther apart. This visualization is better suited for higher time frames or broader market overviews, allowing users to focus on major psychological levels without overloading the chart. On lower time frames, this may result in fewer actionable levels, but it helps in maintaining clarity and staying within Pine Script's line limit.
Linear Grid Type, Neutral Direction (Traditional Rounded Price Levels) : The Linear gridlines are displayed in a neutral fashion, representing traditional round-number levels with consistent spacing above and below the current price. This layout helps visualize key psychological price levels over time in a straightforward manner.
Linear Grid Type, Down Direction : The Linear gridlines are tilted downwards, remaining parallel and ending at the rounded level at the current price. This setup emphasizes downward market sentiment, allowing traders to visualize price expansion towards lower levels, which is useful when analyzing downtrends or potential correction levels.
Linear Grid Type, Down Direction : The Linear gridlines are tilted downwards, extending from the current price to lower levels. Useful for observing downtrending price movements and visualizing pullback areas during uptrends.
Linear Grid Type, Auto Direction : The Linear gridlines adjust dynamically, tilting either upwards or downwards to align with recent price trends, remaining parallel and ending at the rounded level at the current price. This configuration reflects the current market sentiment and offers traders a flexible way to observe price dynamics as they develop in real time.
Fan Grid Type, Neutral Direction : The fan-shaped gridlines radiate symmetrically from a central point, ending at the rounded level at the current price. This configuration provides an unbiased view of price action, giving traders a balanced visualization of rounded levels without directional influence.
Fan Grid Type, Up Direction : The fan-shaped gridlines originate from lower visible price points and radiate upwards, ending at the rounded level at the current price. This layout helps visualize potential price expansion to higher levels, offering insights into upward momentum while maintaining a dynamic and evolving perspective on market conditions.
Fan Grid Type, Down Direction : The fan-shaped gridlines originate from higher visible price points and radiate downwards, ending at the rounded level at the current price. This setup is particularly useful for observing potential price expansion towards lower levels, illustrating areas where the price might extend during a downtrend.
Fan Grid Type, Auto Direction : The fan-shaped gridlines dynamically adjust, originating from visible chart points based on the current market trend, and radiate outward, ending at the rounded level at the current price. This adaptive visualization offers a continuously evolving representation that aligns with changing market sentiment, helping traders assess price expansion dynamically.
📊 SUMMARY 📊
The Rounded Grid Levels indicator helps traders highlight important round-number price levels on their charts, providing a dynamic way to visualize these psychological areas. With customizable gridline options—including traditional, tilted, and fan-shaped styles—users can adapt the indicator to suit their analysis needs. The gridlines adjust with chart zoom or scale, offering a flexible tool for observing price action, without providing specific trading signals or predictions.
⚙️ COMPATIBILITY AND LIMITATIONS ⚙️
Asset Compatibility :
The Rounded Grid Levels indicator is compatible with all asset classes, including cryptocurrencies, forex, stocks, and commodities. Users should adjust both the Rounding Step and the Major Grid settings to ensure the correct scale is used for the specific asset. This adjustment ensures that the most relevant round price levels are displayed effectively regardless of the instrument being analyzed. For instance, when analyzing BTCUSD, a higher Rounding Step may be needed compared to forex pairs like EURUSD, and the Major Grid value should also be adjusted to appropriately emphasize significant levels.
Line Limitations in Pine Script :
The Rounded Grid Levels indicator is subject to Pine Script's 500-line limit. This means that it cannot draw more than 500 gridlines on the chart at any given time. The number of gridlines depends directly on the chosen Rounding Step . If the steps are too small, the gridlines will be spaced too closely, causing the indicator to quickly reach the line limit. For example, if Ethereum is trading around $2,500, a Rounding Step of 100 might be appropriate, but a step of 1.00 would create too many gridlines, exceeding Pine Script's limit. Users should consider appropriate settings to avoid running into this constraint.
Runtime Error Considerations
When using the Rounded Grid Levels indicator, users might encounter a runtime error in specific scenarios. This typically happens if the Rounding Step is set too small, causing the indicator to exceed Pine Script's line limit or take too long to process. This can often occur when switching between charts that have significantly different price ranges. Since the Rounding Step requires flexibility to work with a wide variety of assets—ranging from decimals to thousands—it is not practically limited within the script itself. If a runtime error occurs, the recommended solution is to increase the Rounding Step to a larger value that better matches the current asset's price range.
Runtime Error: If the Rounding Step is too small for the current asset or chart, the indicator may generate a runtime error. Users should increase the Rounding Step to ensure proper visualization.
⚠️ DISCLAIMER ⚠️
The Rounded Grid Levels indicator is not designed as a predictive tool. While it extends gridlines into the future, this extension is purely for visual continuity and does not imply any forecast of future price movements. The primary function of this indicator is to help users visualize significant round number price levels.
The gridlines adjust dynamically based on the visible chart range, ensuring that the most relevant round price levels are displayed. This behavior allows the indicator to adapt to your current view of the market, but it should not be used to predict price movements. The indicator is intended as a visual aid and should be used alongside other tools in a comprehensive market analysis approach.
While gridlines may align with significant price levels in hindsight, they should not be interpreted as indicators of future price movements. Traders are encouraged to adjust settings based on their strategy and market conditions.
🧠 BEYOND THE CODE 🧠
The Rounded Grid Levels indicator, like other xxattaxx indicators , is designed with education and community collaboration in mind. Its open-source nature encourages exploration, experimentation, and the development of new grid calculation indicators, drawings, and strategies. We hope this indicator serves as a framework and a starting point for future innovations in grid trading.
Your comments, suggestions, and discussions are invaluable in shaping the future of this project. We actively encourage your feedback and contributions, which will directly help us refine and improve the Rounded Grid Levels indicator. We look forward to seeing the creative ways in which you use and enhance this tool.
GRID
Revenue GridDescription:
The Revenue Grid indicator helps traders and investors visualize a stock’s valuation by plotting horizontal lines based on its price-to-sales (P/S) ratio. This tool displays how the stock price compares to multiples of its total revenue per share, giving a clear perspective on valuation benchmarks.
Fundamental Concept:
The price-to-sales ratio compares a company’s stock price to its revenue per share. It’s used to evaluate whether a stock is overvalued or undervalued based on its revenue.
This indicator offers a unique way to view this ratio by applying Fibonacci multiples to the revenue per share. It plots lines at these multiples to show how the stock price measures up against different valuation levels.
How It Works:
Data Inputs:
Total Revenue (TR): The company’s revenue over the past twelve months.
Total Shares Outstanding (TSO): The total number of shares in circulation.
Calculation:
Calculates the revenue per share (TR/TSO).
Plots lines at fixed Fibonacci multiples (e.g., 1x, 2x, 3x, 5x, 8x, 13x) of the revenue per share value.
How to Use:
1. Add the "Revenue Grid" indicator to your chart by searching for it in the indicator library and applying it.
2. Observe the lines plotted on the chart. If these lines are trending upwards, it indicates that the revenue is increasing.
3. Analyze how historical prices trend relative to these lines. Look for periods where the stock price supports around specific multiples, you can easily get a sense of overvaluation or undervaluation in certain periods.
Use this information to guide further analysis and investment decisions.
Benefits:
1. Clear Valuation View: Easily see how the company’s revenue translates into stock price levels.
2. Investment Insight: Identify if the stock price is lagging behind revenue growth, which might signal a buying opportunity.
3. Historical Context: Understand how the market has historically valued the company and assess the current valuation.
Do let me know your feedbacks in comments. Happy Investing :)
Grid Bot Parabolic [xxattaxx]🟩 The Grid Bot Parabolic, a continuation of the Grid Bot Simulator Series , enhances traditional gridbot theory by employing a dynamic parabolic curve to visualize potential support and resistance levels. This adaptability is particularly useful in volatile or trending markets, enabling traders to explore grid-based strategies and gain deeper market insights. The grids are divided into customizable trade zones that trigger signals as prices move into new zones, empowering traders to gain deeper insights into market dynamics and potential turning points.
While traditional grid bots excel in ranging markets, the Grid Bot Parabolic’s introduction of acceleration and curvature adds new dimensions, enabling its use in trending markets as well. It can function as a traditional grid bot with horizontal lines, a tilted grid bot with linear slopes, or a fully parabolic grid with curves. This dynamic nature allows the indicator to adapt to various market conditions, providing traders with a versatile tool for visualizing dynamic support and resistance levels.
🔑 KEY FEATURES 🔑
Adaptable Grid Structures (Horizontal, Linear, Curved)
Buy and Sell Signals with Multiple Trigger/Confirmation Conditions
Secondary Buy and Secondary Sell Signals
Projected Grid Lines
Customizable Grid Spacing and Zones
Acceleration and Curvature Control
Sensitivity Adjustments
📐 GRID STRUCTURES 📐
Beyond its core parabolic functionality, the Parabolic Grid Bot offers a range of grid configurations to suit different market conditions and trading preferences. By adjusting the "Acceleration" and "Curvature" parameters, you can transform the grid's structure:
Parabolic Grids
Setting both acceleration and curvature to non-zero values results in a parabolic grid.This configuration can be particularly useful for visualizing potential turning points and trend reversals. Example: Accel = 10, Curve = -10)
Linear Grids
With a non-zero acceleration and zero curvature, the grid tilts to represent a linear trend, aiding in identifying potential support and resistance levels during trending phases. Example: Accel =1.75, Curve = 0
Horizontal Grids
When both acceleration and curvature are set to zero, the indicator reverts to a traditional grid bot with horizontal lines, suitable for ranging markets. Example: Accel=0, Curve=0
⚙️ INITIAL SETUP ⚙️
1.Adding the Indicator to Your Chart
Locate a Starting Point: To begin, visually identify a price point on your chart where you want the grid to start.This point will anchor your grid.
2. Setting Up the Grid
Add the Grid Bot Parabolic Indicator to your chart. A “Start Time/Price” dialog will appear
CLICK on the chart at your chosen start point. This will anchor the start point and open a "Confirm Inputs" dialog box.
3. Configure Settings. In the dialog box, you can set the following:
Acceleration: Adjust how quickly the grid reacts to price changes.
Curve: Define the shape of the parabola.
Intervals: Determine the distance between grid levels.
If you choose to keep the default settings, with acceleration set to 0 and curve set to 0, the grid will display as traditional horizontal lines. The grid will align with your selected price point, and you can adjust the settings at any time through the indicator’s settings panel.
⚙️ CONFIGURATION AND SETTINGS ⚙️
Grid Settings
Accel (Acceleration): Controls how quickly the price reacts to changes over time.
Curve (Curvature): Defines the overall shape of the parabola.
Intervals (Grid Spacing): Determines the vertical spacing between the grid lines.
Sensitivity: Fine tunes the magnitude of Acceleration and Curve.
Buy Zones & Sell Zones: Define the number of grid levels used for potential buy and sell signals.
* Each zone is represented on the chart with different colors:
* Green: Buy Zones
* Red: Sell Zones
* Yellow: Overlap (Buy and Sell Zones intersect)
* Gray: Neutral areas
Trigger: Chooses which part of the candlestick is used to trigger a signal.
* `Wick`: Uses the high or low of the candlestick
* `Close`: Uses the closing price of the candlestick
* `Midpoint`: Uses the middle point between the high and low of the candlestick
* `SWMA`: Uses the Symmetrical Weighted Moving Average
Confirm: Specifies how a signal is confirmed.
* `Reverse`: The signal is confirmed if the price moves in the opposite direction of the initial trigger
* `Touch`: The signal is confirmed when the price touches the specified level or zone
Sentiment: Determines the market sentiment, which can influence signal generation.
* `Slope`: Sentiment is based on the direction of the curve, reflecting the current trend
* `Long`: Sentiment is bullish, favoring buy signals
* `Short`: Sentiment is bearish, favoring sell signals
* `Neutral`: Sentiment is neutral. No secondary signals will be generated
Show Signals: Toggles the display of buy and sell signals on the chart
Chart Settings
Grid Colors: These colors define the visual appearance of the grid lines
Projected: These colors define the visual appearance of the projected lines
Parabola/SWMA: Adjust colors as needed. These are disabled by default.
Time/Price
Start Time & Start Price: These set the starting point for the parabolic curve.
* These fields are automatically populated when you add the indicator to the chart and click on an initial location
* These can be adjusted manually in the settings panel, but he easiest way to change these is by directly interacting with the start point on the chart
Please note: Time and Price must be adjusted for each chart when switching assets. For example, a Start Price on BTCUSD of $60,000 will not work on an ETHUSD chart.
🤖 ALGORITHM AND CALCULATION 🤖
The Parabolic Function
At the core of the Parabolic Grid Bot lies the parabolic function, which calculates a dynamic curve that adapts to price action over time. This curve serves as the foundation for visualizing potential support and resistance levels.
The shape and behavior of the parabola are influenced by three key user-defined parameters:
Acceleration: This parameter controls the rate of change of the curve's slope, influencing its tilt or steepness. A higher acceleration value results in a more pronounced tilt, while a lower value leads to a gentler slope. This applies to both curved and linear grid configurations.
Curvature: This parameter introduces and controls the curvature or bend of the grid. A higher curvature value results in a more pronounced parabolic shape, while a lower value leads to a flatter curve or even a straight line (when set to zero).
Sensitivity: This setting fine-tunes the overall responsiveness of the grid, influencing how strongly the Acceleration and Curvature parameters affect its shape. Increasing sensitivity amplifies the impact of these parameters, making the grid more adaptable to price changes but potentially leading to more frequent adjustments. Decreasing sensitivity reduces their impact, resulting in a more stable grid structure with fewer adjustments. It may be necessary to adjust Sensitivity when switching between different assets or timeframes to ensure optimal scaling and responsiveness.
The parabolic function combines these parameters to generate a curve that visually represents the potential path of price movement. By understanding how these inputs influence the parabola's shape and behavior, traders can gain valuable insights into potential support and resistance areas, aiding in their decision-making process.
Sentiment
The Parabolic Grid Bot incorporates sentiment to enhance signal generation. The "Sentiment" input allows you to either:
Manually specify the market sentiment: Choose between 'Long' (bullish), 'Short' (bearish), or 'Neutral'.
Let the script determine sentiment based on the slope of the parabolic curve: If 'Slope' is selected, the sentiment will be considered 'Long' when the curve is sloping upwards, 'Short' when it's sloping downwards, and 'Neutral' when it's flat.
Buy and Sell Signals
The Parabolic Grid Bot generates buy and sell signals based on the interaction between the price and the grid levels.
Trigger: The "Trigger" input determines which part of the candlestick is used to trigger a signal (wick, close, midpoint, or SWMA).
Confirmation: The "Confirm" input specifies how a signal is confirmed ('Reverse' or 'Touch').
Zones: The number of "Buy Zones" and "Sell Zones" determines the areas on the grid where buy and sell signals can be generated.
When the trigger condition is met within a buy zone and the confirmation criteria are satisfied, a buy signal is generated. Similarly, a sell signal is generated when the trigger and confirmation occur within a sell zone.
Secondary Signals
Secondary signals are generated when a regular buy or sell signal contradicts the prevailing sentiment. For example:
A buy signal in a bearish market (Sentiment = 'Short') would be considered a "secondary buy" signal.
A sell signal in a bullish market (Sentiment = 'Long') would be considered a "secondary sell" signal.
These secondary signals are visually represented on the chart using hollow triangles, differentiating them from regular signals (filled triangles).
While they can be interpreted as potential contrarian trade opportunities, secondary signals can also serve other purposes within a grid trading strategy:
Exit Signals: A secondary signal can suggest a potential shift in market sentiment or a weakening trend. This could be a cue to consider exiting an existing position, even if it's currently profitable, to lock in gains before a potential reversal
Risk Management: In a strong trend, secondary signals might offer opportunities for cautious counter-trend trades with controlled risk. These trades could utilize smaller position sizes or tighter stop-losses to manage potential downside if the main trend continues
Dollar-Cost Averaging (DCA): During a prolonged trend, the parabolic curve might generate multiple secondary signals in the opposite direction. These signals could be used to implement a DCA strategy, gradually accumulating a position at potentially favorable prices as the market retraces or consolidates within the larger trend
Secondary signals should be interpreted with caution and considered in conjunction with other technical indicators and market context. They provide additional insights into potential market reversals or consolidation phases within a broader trend, aiding in adapting your grid trading strategy to the evolving market dynamics.
Examples
Trigger=Wick, Confirm=Touch. Signals are generated when the wick touches the next gridline.
Trigger=Close, Confirm=Touch. Signals require the close to touch the next gridline.
Trigger=SWMA, Confirm=Reverse. Signals are triggered when the Symmetrically Weighted Moving Average reverse crosses the next gridline.
🧠THEORY AND RATIONALE 🧠
The innovative approach of the Parabolic Grid Bot can be better understood by first examining the limitations of traditional grid trading strategies and exploring how this indicator addresses them by incorporating principles of market cycles and dynamic price behavior
Traditional Grid Bots: One-Dimensional and Static
Traditional grid bots operate on a simple premise: they divide the price chart into a series of equally spaced horizontal lines, creating a grid of trading zones. These bots excel in ranging markets where prices oscillate within a defined range. Buy and sell orders are placed at these grid levels, aiming to profit from mean reversion as prices bounce between the support and resistance zones.
However, traditional grid bots face challenges in trending markets. As the market moves in one direction, the bot continues to place orders in that direction, leading to a stacking of positions. If the market eventually reverses, these stacked trades can be profitable, amplifying gains. But the risk lies in the potential for the market to continue trending, leaving the trader with a series of losing trades on the wrong side of the market
The Parabolic Grid Bot: Adding Dimensions
The Parabolic Grid Bot addresses the limitations of traditional grid bots by introducing two additional dimensions:
Acceleration (Second Dimension): This parameter introduces a second dimension to the grid, allowing it to tilt upwards or downwards to align with the prevailing market trend. A positive acceleration creates an upward-sloping grid, suitable for uptrends, while a negative acceleration results in a downward-sloping grid, ideal for downtrends. The magnitude of acceleration controls the steepness of the tilt, enabling you to fine-tune the grid's responsiveness to the trend's strength
Curvature (Third Dimension): This parameter adds a third dimension to the grid by introducing a parabolic curve. The curve's shape, ranging from gentle bends to sharp turns, is controlled by the curvature value. This flexibility allows the grid to closely mirror the market's evolving structure, potentially identifying turning points and trend reversals.
Mean Reversion in Trending Markets
Even in trending markets, the Parabolic Grid Bot can help identify opportunities for mean reversion strategies. While the grid may be tilted to reflect the trend, the buy and sell zones can capture short-term price oscillations or consolidations within the broader trend. This allows traders to potentially pinpoint entry and exit points based on temporary pullbacks or reversals.
Visualize and Adapt
The Parabolic Grid Bot acts as a visual aid, enhancing your understanding of market dynamics. It allows you to "see the curve" by adapting the grid to the market's patterns. If the market shows a parabolic shape, like an upward curve followed by a peak and a downward turn (similar to a head and shoulders pattern), adjust the Accel and Curve to match. This highlights potential areas of interest for further analysis.
Beyond Straight Lines: Visualizing Market Cycle
Traditional technical analysis often employs straight lines, such as trend lines and support/resistance levels, to interpret market movements. However, many analysts, including Brian Millard, contend that these lines can be misleading. They propose that what might appear as a straight line could represent just a small part of a larger curve or cycle that's not fully visible on the chart.
Markets are inherently cyclical, marked by phases of expansion, contraction, and reversal. The Parabolic Grid Bot acknowledges this cyclical behavior by offering a dynamic, curved grid that adapts to these shifts. This approach helps traders move beyond the limitations of straight lines and visualize potential support and resistance levels in a way that better reflects the market's true nature
By capturing these cyclical patterns, whether subtle or pronounced, the Parabolic Grid Bot offers a nuanced understanding of market dynamics, potentially leading to more accurate interpretations of price action and informed trading decisions.
⚠️ DISCLAIMER⚠️
This indicator utilizes a parabolic curve fitting approach to visualize potential support and resistance levels. The mathematical formulas employed have been designed with adaptability and scalability in mind, aiming to accommodate various assets and price ranges. While the resulting curves may visually resemble parabolas, it's important to note that they might not strictly adhere to the precise mathematical definition of a parabola.
The indicator's calculations have been tested and generally produce reliable results. However, no guarantees are made regarding their absolute mathematical accuracy. Traders are encouraged to use this tool as part of their broader analysis and decision-making process, combining it with other technical indicators and market context.
Please remember that trading involves inherent risks, and past performance is not indicative of future results. It is always advisable to conduct your own research and exercise prudent risk management before making any trading decisions.
🧠 BEYOND THE CODE 🧠
The Parabolic Grid Bot, like the other grid bots in this series, is designed with education and community collaboration in mind. Its open-source nature encourages exploration, experimentation, and the development of new grid trading strategies. We hope this indicator serves as a framework and a starting point for future innovations in the field of grid trading.
Your comments, suggestions, and discussions are invaluable in shaping the future of this project. We welcome your feedback and look forward to seeing how you utilize and enhance the Parabolic Grid Bot.
Exponential Grid [Phi, Pi, Euler]If you disagree with one of the EMH principles that price is too random, then by definition you must agree that historic price has deterministic function to a scenario ahead.
I personally believe that constants like phi, pi and e can mimic exponential growth of the price.
In this script, first grid is based on the Lowest price multiplied with self fraction of the constant.
For example:
If you are familiar with fib ratio 1.272, then you must know that it is 1.618 to the power of 0.5.
With default settings of exponent step 0.25
First grid = Lowest price x phi^0.25
Second grid = Lowest price x phi^0.25x2
Third grid = Lowest price x phi^0.25x3 and so on
The script will automatically find the lowest price and update the grid values.
Or you can set up your custom Lowest price manually if you feel like the All Time Low level loses its relevance value after long period.
There are 64 grids including Lowest price level. And it wasn't by a chance. Pine Script has a limitation of max 64 plots. Number of grids shown in the chart depends on the highest price. Once price breaks above ATH a couple of next grids will be plotted automatically. In most cases if everything is plotted, the chart appears squeezed and you'll need to zoom in to see it. Therefore, I adjusted it relatively to the scale of the chart for the comfort.
In some cases 64 plots aren't enough to cover the whole chart. For example, let's take a look at NVIDIA chart:
Since the price has started with 0.0333, it is way too small to cover all with default settings.
We are left with 2 choices:
Either Enable "Round"
OR increase Exponent Step (from 0.25 to 0.5 in the particular example below)
If you set constant to pi or e which is a bigger number than phi, expect the gaps to be bigger. To reduce it to a more gradual way of expansion you can decrease Exponent Step.
Market Structure Volume Distribution [LuxAlgo]The Market Structure Volume Distribution tool allows traders to identify the strength behind breaks of market structure at defined price ranges to measure de correlation of forces between bulls and bears visually and easily.
🔶 USAGE
This tool has three main features: market structure highlighting, grid levels, and volume profile. Each feature is covered more in depth below:
🔹 Market Structure
The basic unit of market structure is a swing point, the period of the swing point is user-defined, so traders can identify longer-term market structures. Price breaking a prior swing point will confirm the occurrence of a market structure.
The tool will plot a line after a market structure is confirmed, by default the lines on bullish MS will be green (indicative of an uptrend), and red in case of bearish MS (indicative of a downtrend).
🔹 Grid Levels
The Grid visually divides the price range contained inside the tool execution window, into equal size rows, the number of rows is user-defined so users can divide the full price range up to 100 rows.
The main objective of this feature is to help identify the execution window and the limits of each row in the volume profile so traders can know in a simple look what BoMS belongs to each row.
There is however another use for the grid, by dividing the range into equal-sized parts, this feature provides automatic support and resistance levels as good as any other.
Grid provides a visual help to know what our execution window is and to associate MS with their rows in the profile. It can provide S/R levels too.
🔹 Volume Profile
The volume profile feature shows in a visually easy way the volume behind each MS aggregated by rows and divided into buy and sell volume to spot the differences in a simple look.
This tool allows users to spot the liquidity associated with the event of a market structure in a specific price range, allowing users to know which price areas where associated with the most trading activity during the occurrence of a market structutre.
🔶 SETTINGS
🔹 Data Gathering
Execute on all visible range: Activate this to use all visible bars on the calculations. This disables the use of the next parameter "Execute on the last N bars". Default false.
Execute on the last N bars: Use last N bars on the calculations. To use this parameter "Execute on all visible range" must be disabled. Values from 20 to 5000, default 500.
Pivot Length: How many bars will be used to confirm a pivot. The bigger this parameter is the fewer breaks of structure will detect. Values from 1, default 2
🔹 Profile
Profile Rows: Number of rows in the volume profile. Values from 2 to 100, default 10.
Profile Width: Maximum width of the volume profile. Values from 25 to 500, default 200.
Profile Mode: How the volume will be displayed on each row. "TOTAL VOLUME" will aggregate buy & sell volume per row, "BUY&SELL VOLUME" will separate the buy volume from the sell volume on each row. Default BUY&SELL VOLUME.
🔹 Style
Buy Color: This is the color for the buy volume on the profile when the "BUY&SELL VOLUME" mode is activated. Default green.
Sell Color: This is the color for the sell volume on the profile when the "BUY&SELL VOLUME" mode is activated. Default red.
Show dotted grid levels: Show dotted inner grid levels. Default true.
FreedX Grid Backtest█ FreedX Grid Backtest is an open-source tool that offers accurate GRID calculations for GRID trading strategies. This advanced tool allows users to backtest GRID trading parameters with precision, accurately reflecting exchange functionalities. We are committed to enhancing trading strategies through precise backtesting solutions and address the issue of unreliable backtesting practices observed on GRID trading strategies. FreedX Grid Backtest is designed for optimal calculation speed and plotting efficiency, ensuring users to achieve fastest calculations during their analysis.
█ GRID TRADING STRATEGY SETTINGS
The core of the FreedX Grid Backtest tool lies in its ability to simulate grid trading strategies. Grid trading involves placing orders at regular intervals within a predefined price range, creating a grid of orders that capitalize on market volatility.
Features:
⚙️ Backtest Range:
→ Purpose: Allows users to specify the backtesting range of GRID strategy. Closes all positions at the end of this range.
→ How to Use: Drag the dates to fit the desired backtesting range.
⚙️ Investment & Compounding:
→ Purpose: Allows users to specify the total investment amount and select between fixed and compound investment strategies. Compounding adjusts trade quantities based on performance, enhancing the grid strategy's adaptability to market changes.
→ How to Use: Set the desired investment amount and choose between "Fixed" or "Compound" for the investment method.
⚙️ Leverage & Grid Levels:
→ Purpose: Leverage amplifies the investment amount, increasing potential returns (and risks). Users can define the number of grid levels, which determines how the investment is distributed across the grid.
→ How to Use: Input the desired leverage and number of grids. The tool automatically calculates the distribution of funds across each grid level.
⚙️ Distribution Type & Mode:
→ Purpose: Users can select the distribution type (Arithmetic or Geometric) to set how grid levels are determined. The mode (Neutral, Long, Short) dictates the direction of trades within the grid.
→ How to Use: Choose the distribution type and mode based on the desired trading strategy and market outlook.
⚙️ Enable LONG/SHORT Grids exclusively:
█ MANUAL LEVELS AND STOP TRIGGERS
Beyond automated settings, the tool offers manual adjustments for traders seeking finer control over their grid strategies.
Features:
⚙️ Manual Level Adjustment:
→ Purpose: Enables traders to manually set the top, reference, and bottom levels of the grid, offering precision control over the trading range.
→ How to Use: Activate manual levels and adjust the top, reference, and bottom levels as needed to define the grid's scope.
⚙️ Stop Triggers:
→ Purpose: Provides an option to set upper and lower price limits, acting as stop triggers to close or terminate trades. This feature safeguards investments against significant market movements outside the anticipated range.
→ How to Use: Enable stop triggers and specify the upper and lower limits. The tool will automatically manage positions based on these parameters.
---
This guide gives you a quick and clear overview of the FreedX Grid Backtest tool, explaining how you can use this cutting-edge tool to improve your trading strategies.
Open Liquidity Heatmap [BigBeluga]Open Liquidity Heatmap is an indicator designed to display accumulated resting liquidity on the chart.
Unlike any other liquidity heatmap, this aims to accumulate liquidity at specific levels that build up over time, showing larger areas of liquidity.
🔶 FEATURES
The indicator includes the following settings:
Lookback : Used to determine the range calculation of the heatmap.
Leverage : Leverage of the liquidation (Counted as % in price, Example: 4.5 will return a distance from price of 4.5%, indicating any possible resting liquidity in this range).
Levels : Amount of levels to display (Each level is counted as liquidity resting on the chart; fewer levels will return a bigger area of liquidity sitting on the chart).
Mode : Apply a color gradient from the minimum liquidation to the maximum liquidity level. Set the maximum color gradient value (Counted as volume).
Offset : Automatically determine the offset range of the Volume Profiles. Manual offset of the Volume Profiles.
🔶 CALCULATION
for i = 0 to step - 1
float plotter = na
switch i
0 =>
plotter := hs
=>
plotter := hs - diff * ( i )
cls.hm.gnL(plotter)
cls.vp.put(plotter, 0)
We calculate levels like a normal volume profile with steps, from the highest point within the lookback to the lowest one. Each level will contain the corresponding amount of volume that the candle has closed in that range.
As we can see in the image above, we add liquidity each time the distance in % from price is between two levels.
Unlike many liquidity indicators that provide a single candle liquidity heatmap, this aims to add up liquidity (volume) in already present levels.
This can be extremely useful to see which levels are likely to be more liquid and tend to get a bigger reaction to the price.
Imagine it like a range of levels that each time price revisits that area, a new position area is added; we add volume in that area each time price visits that zone. Liquidity builds up in those zones, causing a bigger reaction to the price once the price visits it.
This indicator is not the same as a single candle heatmap like many others. What is a single candle heatmap?
A single candle heatmap is when a level is created on every new candle, coloring the level based on the total volume of it.
This indicator, on the contrary, aims to provide a more specific use by adding up liquidity each time price visits it.
🔶 BASIC DEMOSTRATION
This is a basic demonstration of how we can spot high liquidity points overall using confluence:
We see the POC of the liquidation in a low volume area of the normal volume profile adding up as confluence.
Resistance from the POC Volume Profile suggesting price will go lower.
Major long open liquidity down.
As we can see, price takes out all the long liquidity and right after pumping, indicating that all the major liquidity got taken out.
Some key note to take is that a POC in the liquidation heatmap in a low volume area of the normal Volume Profile add confluence of a possible big reaction in that zone.
In the forex market, we suggest to use a low distance from price (Leverage) while in a crypto market you can use the one that fit the best the current timeframe.
🔶 CONCLUSION
This indicator aims to show open resting liquidity that had built up over time, showing the most amount of liquidation in specific areas in an aggregated way unlike many liquidation heatmap indicators that show single-level liquidation.
🔶 RELATED SCRIPT
ATR Grid Levels [By MUQWISHI]▋ INTRODUCTION :
The “ATR Levels” produces a sequence of horizontal line levels above and below the Center Line (reference level). They are sized based on the instrument's volatility, representing the average historical price movement on a selected higher timeframe using the average true range (ATR) indicator.
_______________________
▋ OVERVIEW:
_______________________
▋ IMPLEMENTATION:
The indicator starts by drawing a Center Line that is selected by the user from a variety of common levels. Then, it draws a sequence of horizontal lines above and below the Center Line, which are sized based on the most confirmed average true range (ATR) at the selected higher timeframe.
In the top right corner of the chart, there is a table displaying both the selected ATR (in the right cell) and the ATR of the current bar (in the left cell). This feature enables users to compare these two values. It's important to note that the ATR of the current bar may not be confirmed yet, as the market is still active.
_______________________
▋ INDICATOR SETTINGS:
# Section (1): ATR Settings
(1) ATR Period & Smoothing.
(2) Timeframe where ATR value imported from.
(3) To show/hide the table comparison between the current ATR and the ATR for the selected period. Also, ability to color the current ATR cell if it’s greater.
# Section (2): Levels Settings
(1) Selecting a Center Line level among a variety of common levels, which is taken as reference level where a sequence of horizontal lines plot above and below it.
(2) Size of grid in ATR unit.
(3) Number of horizontal lines to plot in a single side.
(4) Grid Side. Ability to plot above or below the Center Line.
(5) Lines colors, and mode.
(6) Line style.
(7) Label style.
(8) Ability to remove old lines, from previous HTF.
_____________________
▋ COMMENT:
The ATR Levels should not be taken as a major concept to build a trading decision.
Please let me know if you have any questions.
Thank you.
Grid Bot BacktestingBinance, Bybit, Bitget, and other cross-exchange (grid) trading bot backtesting.
Auto bound: Automatically setting upper and lower price bounds.
Manual: Setting upper and lower price bounds manually.
The graph below represents the overall asset changes (initial investment amount + current position profit + grid profit).
Try using backtesting when setting up a grid bot on the exchange!
바이낸스, 바이비트, 비트겟 등 교차거래(그리드) 봇 백테스팅
Auto bound : 자동으로 상,하단 가격 설정
Manual : 직접 상,하단 가격 설정
아래 그래프는 총 자산 변화입니다.(초기투자금액 + 현재 포지션 수익 + 그리드 수익)
거래소에서 그리드 봇 설정할 때 백테스팅 유용하게 써보세요!
Hulk Grid Algorithm V2 - The Quant ScienceIt's the latest proprietary grid algorithm developed by our team. This software represents a clearer and more comprehensive modernization of the deprecated Hulk Grid Algorithm. In this new release, we have optimized the source code architecture and investment logic, which we will describe in detail below.
Overview
Hulk Grid Algorithm V2 is designed to optimize returns in sideways market conditions. In this scenario, the algorithm divides purchases with long orders at each level of the grid. Unlike a typical grid algorithm, this version applies an anti-martingale model to mitigate volatility and optimize the average entry price. Starting from the lower level, the purchase quantity is increased at each new subsequent level until reaching the upper level. The initial quantity of the first order is fixed at 0.50% of the initial capital. With each new order, the initial quantity is multiplied by a value equal to the current grid level (where 1 is the lower level and 10 is the upper level).
Example: Let's say we have an initial capital of $10,000. The initial capital for the first order would be $50 * 1 = $50, for the second order $50 * 2 = $100, for the third order $50 * 3 = $150, and so on until reaching the upper level.
All previously opened orders are closed using a percentage-based stop-loss and take-profit, calculated based on the extremes of the grid.
Set Up
As mentioned earlier, the user's goal is to analyze this strategy in markets with a lack of trend, also known as sideways markets. After identifying a price range within which the asset tends to move, the user can choose to create the grid by placing the starting price at the center of the range. This way, they can consider trading the asset, if the backtesting generates a return greater than the Buy & Hold return.
Grid Configuration
To create the grid, it's sufficient to choose the starting price during the launch phase. This level will be the center of the grid from which the upper and lower levels will be calculated. The grid levels are computed using an arithmetic method, adding and subtracting a configurable fixed amount from the user interface (Grid Step $).
Example: Let's imagine choosing 1000 as the starting price and 50 as the Grid Step ($). The upper levels will be 1000, 1050, 1100, 1150, 1200. The lower levels will be 950, 900, 850, 800, and 750.
Markets
This software can be used in all markets: stocks, indices, commodities, cryptocurrencies, ETFs, Forex, etc.
Application
With this backtesting software, is possible to analyze the strategy and search for markets where it can generate better performance than Buy & Hold returns. There are no alerts or automatic investment mechanisms, and currently, the strategy can only be executed manually.
Design
Is possible to modify the grid style and customize colors by accessing the Properties section of the user interface.
Extended Parallel ChannelsThis indicator provides an enhanced version of the popular Parallel Channel tool by allowing channel boundaries to be extended above and below the primary channel. It can also serve as a general tool for drawing parallel lines and grid lines to aid technical analysis.
🟠 Application
There are two primary ways extended channels can provide valuable insights:
🔵 Support and Resistance Levels
When prices break out of a channel, they often encounter strong resistance at approximately the 100% extension point. Breakout traders can utilize the extended channel boundary to place take-profit orders. Meanwhile, reversal traders can look for entry opportunities at this level.
🔵 Grid / Martingale Trading
Grid Trading and Martingale Trading strategies rely heavily on grid lines. This indicator streamlines that process by enabling traders to effortlessly plot grid lines across the chart.
🟠 Instructions
Upon adding the indicator, the user will be prompted to set the channel boundaries by placing three anchor points on the chart. The first two anchors determine one boundary line, while the third anchor determine the other boundary line.
Once the three anchors are positioned, the indicator automatically plots the resulting channel as well as the extended lines. The anchor points are highlighted as movable blue circles, allowing the user to dynamically adjust the channel formation by dragging the anchors to new locations as needed.
RSI Box Strategy (pseudo- Grid Bot)This is a strategy intended primarily for algorithmic traders. It's a pseudo-grid bot that uses a dynamic, volume-weighted grid that only updates when the RSI meets certain conditions. It's also a breakout strategy, whereas normal grid bots are not (typical grid bots sell when a higher grid is reached, whereas this strategy sells when a lower grid is breached under specific conditions). This strategy also sells 100% of pyramiding orders on close.
In a nutshell, the strategy updates its grid to the volume-weighted highest/lowest values of your given source ("src" in the settings) each time that there is a RSI crossunder/crossover. From this range it produces an evenly-spaced grid of five lines, and uses the current source to determine which grid line is closest to the source. Then, if the source crosses over the line directly above the current line, it enters a buy order. If the source crosses under the line directly below the current line, it enters a sell order.
You can configure shorts, source, RSI length, and overbought/oversold levels in the settings.
For the strategy results below: fees are at 0.1% per trade, with order size 1% of equity and a max pyramiding value of 33. For a greater R/R profile, you can increase the order size, which will increase drawdown but potentially yield better results.
Grid by Volatility (Expo)█ Overview
The Grid by Volatility is designed to provide a dynamic grid overlay on your price chart. This grid is calculated based on the volatility and adjusts in real-time as market conditions change. The indicator uses Standard Deviation to determine volatility and is useful for traders looking to understand price volatility patterns, determine potential support and resistance levels, or validate other trading signals.
█ How It Works
The indicator initiates its computations by assessing the market volatility through an established statistical model: the Standard Deviation. Following the volatility determination, the algorithm calculates a central equilibrium line—commonly referred to as the "mid-line"—on the chart to serve as a baseline for additional computations. Subsequently, upper and lower grid lines are algorithmically generated and plotted equidistantly from the central mid-line, with the distance being dictated by the previously calculated volatility metrics.
█ How to Use
Trend Analysis: The grid can be used to analyze the underlying trend of the asset. For example, if the price is above the Average Line and moves toward the Upper Range, it indicates a strong bullish trend.
Support and Resistance: The grid lines can act as dynamic support and resistance levels. Price tends to bounce off these levels or breakthrough, providing potential trade opportunities.
Volatility Gauge: The distance between the grid lines serves as a measure of market volatility. Wider lines indicate higher volatility, while narrower lines suggest low volatility.
█ Settings
Volatility Length: Number of bars to calculate the Standard Deviation (Default: 200)
Squeeze Adjustment: Multiplier for the Standard Deviation (Default: 6)
Grid Confirmation Length: Number of bars to calculate the weighted moving average for smoothing the grid lines (Default: 2)
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
CE - Market Performance TableThe 𝓜𝓪𝓻𝓴𝓮𝓽 𝓟𝓮𝓻𝓯𝓸𝓻𝓶𝓪𝓷𝓬𝓮 𝓣𝓪𝓫𝓵𝓮 is a sophisticated market tool designed to provide valuable insights into the current market trends and the approximate current position in the Macroeconomic Regime.
Furthermore the 𝓜𝓪𝓻𝓴𝓮𝓽 𝓟𝓮𝓻𝓯𝓸𝓻𝓶𝓪𝓷𝓬𝓮 𝓣𝓪𝓫𝓵𝓮 provides the Correlation Implied Trend for the Asset on the Chart. Lastly it provides information about current "RISK ON" or "RISK OFF" periods.
Methodology:
𝓜𝓪𝓻𝓴𝓮𝓽 𝓟𝓮𝓻𝓯𝓸𝓻𝓶𝓪𝓷𝓬𝓮 𝓣𝓪𝓫𝓵𝓮 tracks the 15 underlying Stock ETF's to identify their performance and puts the combined performances together to visualize 42MACRO's GRID Equity Model.
For this it uses the below ETF's:
Dividends (SPHD)
Low Beta (SPLV)
Quality (QUAL)
Defensives (DEF)
Growth (IWF)
High Beta (SPHB)
Cyclicals (IYT, IWN)
Value (IWD)
Small Caps (IWM)
Mid Caps (IWR)
Mega Cap Growth (MGK)
Size (OEF)
Momentum (MTUM)
Large Caps (IWB)
Overall Settings:
The main time values you want to change are:
Correlation Length
- Defines the time horizon for the Correlation Table
ROC Period
- Defines the time horizon for the Performance Table
Normalization lookback
- Defines the time horizon for the Trend calculation of the ETF's
- For longer term Trends over weeks or months a length of 50 is usually pretty accurate
Visuals:
There is a variety of options to change the visual settings of what is being plotted and the two table positions and additional considerations.
Everything that is relevant in the underlying logic that can help comprehension can be visualized with these options.
Market Correlation:
The Market Correlation Table takes the Correlation of the above ETF's to the Asset on the Chart, it furthermore uses the Normalized KAMA Oscillator by IkkeOmar to analyse the current trend of every single ETF.
It then Implies a Correlation based on the Trend and the Correlation to give a probabilistically adjusted expectation for the future Chart Asset Movement. This is strengthened by taking the average of all Implied Trends.
With this the Correlation Table provides valuable insights about probabilistically likely Movement of the Asset, for Traders and Investors alike, over the defined time duration.
Market Performance:
𝓜𝓪𝓻𝓴𝓮𝓽 𝓟𝓮𝓻𝓯𝓸𝓻𝓶𝓪𝓷𝓬𝓮 𝓣𝓪𝓫𝓵𝓮 is the actual valuable part of this Indicator.
It provides valuable information about the current market environment (whether it's risk on or risk off), the rough GRID models from 42MACRO and the actual market performance.
This allows you to obtain a deeper understanding of how the market works and makes it simple to identify the actual market direction.
Utility:
The 𝓜𝓪𝓻𝓴𝓮𝓽 𝓟𝓮𝓻𝓯𝓸𝓻𝓶𝓪𝓷𝓬𝓮 𝓣𝓪𝓫𝓵𝓮 is divided in 4 Sections which are the GRID regimes:
Economic Growth:
Goldilocks
Reflation
Economic Contraction:
Inflation
Deflation
Top 5 Equity Style Factors:
Are the values green for a specific Column? If so then the market reflects the corresponding GRID behavior.
Bottom 5 Equity Style Factors:
Are the values red for a specific Column? If so then the market reflects the corresponding GRID behavior.
So if we have Goldilocks as current regime we would see green values in the Top 5 Goldilocks Cells and red values in the Bottom 5 Goldilocks Cells.
You will find that Reflation will look similar, as it is also a sign of Economic Growth.
Same is the case for the two Contraction regimes.
Simple Grid Lines VisualizerAbout Grid Bots
A grid bot is a type of trading bot or algorithm that is designed to automatically execute trades within a predefined price range or grid. It is commonly used in markets that exhibit ranging or sideways movement, where prices tend to fluctuate within a specific range without a clear trend.
The grid bot strategy involves placing a series of buy and sell orders at regular intervals within the predefined price range or grid. The bot essentially creates a grid of orders, hence the name. When the price reaches one of these levels, the bot will execute the corresponding trade. For example, if the price reaches a predefined lower level, the bot will buy, and if it reaches a predefined upper level, it will sell.
The purpose of the grid bot strategy is to take advantage of the price oscillations within the range. As the price moves up and down, the bot aims to generate profits by buying at the lower end of the range and selling at the higher end. By repeatedly buying and selling at these predetermined levels, the bot attempts to capture gains from the price fluctuations.
About this Script
Simple Grid Lines Visualizer is designed to assist traders in visualizing and implementing automated price grids on their charts. With just a few inputs, this script generates gridlines based on your specified top price, bottom price, and the number of grids or profit per grid.
How it Works:
Specify Top and Bottom Prices: Start by setting the top and bottom prices that define the range within which the gridlines will be generated. These prices can be based on support and resistance levels, historical data, or any other factors you consider relevant to your analysis.
Determine Grid Parameters: Choose either the number of grids or profit per grid, depending on your preference and trading strategy. If you select the number of grids, the script will evenly distribute the gridlines within the specified price range. Alternatively, if you opt for profit per grid, the script will calculate the price increment required to achieve your desired profit level per grid.
Note that when choosing Profit per Grid , an approximation usually is performed, as all grid lines must be evenly distributed. To achieve that, the script computes the grid distance using the mean price between top and bottom, then computes how many of those complete distances may enter the entire range, and lastly, creates a grid with evenly distributed distances as close as possible to the previously computed.
Customize Styling and Display: Adjust the line color, line style, transparency, and other visual aspects to ensure clear visibility on your charts.
Analyze and Trade: Once the gridlines are plotted on your chart, carefully observe how the market interacts with them. The gridlines can act as reference points for potential support and resistance levels, as well as simple buy/sell orders for a trading bot.
Try to find gridlines that intersect prices as frequently as possible from one to another.
A grid with too many lines will make lots of potential trades, but the amount traded will be minimal (as the total amount invested is divided over the number of grids).
A grid with too few lines will make lots of profits with each trade, but the trades will be less likely to occur (depending on the top/bottom distance).
This tool aims to help visually which grid parameters seem to optimize this problem.
Future versions may include automatic profit computation.
Grid Spot Trading Algorithm V2 - The Quant ScienceGrid Spot Trading Algorithm V2 is the last grid trading algorithm made by our developer team.
Grid Spot Trading Algorithm V2 is a fixed 10-level grid trading algorithm. The grid is divided into an accumulation area (red) and a selling area (green).
In the accumulation area, the algorithm will place new buy orders, selling the long positions on the top of the grid.
BUYING AND SELLING LOGIC
The algorithm places up to 5 limit orders on the accumulation section of the grid, each time the price cross through the middle grid. Each single order uses 20% of the equity.
Positions are closed at the top of the grid by default, with the algorithm closing all orders at the first sell level. The exit level can be adjusted using the user interface, from the first level up to the fifth level above.
CONFIGURING THE ALGORITHM
1) Add it to the chart: Add the script to the current chart that you want to analyze.
2) Select the top of the grid: Confirm a price level with the mouse on which to fix the top of the grid.
3) Select the bottom of the grid: Confirm a price level with the mouse on which to fix the bottom of the grid.
4) Wait for the automatic creation of the grid.
USING THE ALGORITHM
Once the grid configuration process is completed, the algorithm will generate automatic backtesting.
You can add a stop loss that destroys the grid by setting the destruction price and activating the feature from the user interface. When the stop loss is activated, you can view it on the chart.
Volume Profile Matrix [LuxAlgo]The Volume Profile Matrix indicator extends from regular volume profiles by also considering calculation intervals within the calculation window rather than only dividing the calculation window in rows.
Note that this indicator is subject to repainting & back-painting, however, treating the indicator as a tool for identifying frequent points of interest can still be very useful.
🔶 SETTINGS
Lookback: Number of most recent bars used to calculate the indicator.
Columns: Number of columns (intervals) used to calculate the volume profile matrix.
Rows: Number of rows (intervals) used to calculate the volume profile matrix.
🔶 USAGE
The Volume Profile Matrix indicator can be used to obtain more information regarding liquidity on specific time intervals. Instead of simply dividing the calculation window into equidistant rows, the calculation is done through a grid.
Grid cells with trading activity occurring inside them are colored. More activity is highlighted through a gradient and by default, cells with a color that are closer to red indicate that more trading activity took place within that cell. The cell with the highest amount of trading activity is always highlighted in yellow.
Each interval (column) includes a point of control which highlights an estimate of the price level with the highest traded volume on that interval. The level with the highest traded volume of the overall grid is extended to the most recent bar.
AUTOMATIC GRID BOT STRATEGY [ilovealgotrading]
OVERVIEW:
This Grid trading strategy can help you maximize your profit in a ranging sideways market with no clear direction.
INDICATOR:
We can get some money by taking advantage of the movement of the price between the range we have determined.
Short positions are opened while the price is rising, long positions are opened while the price is falling.
Therefore, there is no need to predict the trend direction.
What is different in this indicator:
I want to say thank you to © thequantscience. His GRID SPOT TRADING ALGORITHM - GRID BOT TRADING strategy helped me when I was writing my indicator.
I want to explain what I have improved:
1- Grid strategy is a type of strategy that can be traded in very short time frames and users can trade this strategy algorithmically by connecting this strategy to their own accounts with the help of API systems. For this reason, I have developed a software that can give us signals by dynamically changing the long and short messages when users are trading.
2- We can change the start and end dates of our grid bot as we want. It is necessary to use this setting when setting up automatic bots, so that previously opened transactions are not taken into account.
3 - Lot or quantity size should not be excessively small when users are taking automatic trades because exchanges have limitations, to avoid this problem, I have prevented this error by automatically rounding up to the nearest quantity size inside the software.
4 - Users can avoid excessive losses by using stop loss on this grid bot if they wish.
5 - When our price is over the range high or below the range low, our open positions are closed, if the stop button is active. We can also change which close price time frame we take as a basis from the settings.
6 -Users can set how many dollars they can enter per transaction while performing their transactions automatically.
IMPLEMENTATION DETAILS – SETTINGS:
This script allows the user to choose the highs and lows leves of our range. Our bot trades in the specified range.
1. This strategy allows us to set start and end backtest dates.
2. We can change range high and range low leves of our bot
3. IF people want to trade algorithmically with the help of this bot, there are 6 different input systems that will receive the Json codes as an alarm
4. IF the price closes above the upper line or below the lower line, all transactions will be closed. We can determine in which time frame our transactions will be stopped if the price closes outside these levels.We can adjust how our bot works by activating or turning off the Stop Loss button.
5. In this strategy, you can determine your dollar cost for per position.
6. The user can also divide the interval we have determined into 10 parts or 20 equal parts.
7. The grid is divided and colored at the interval we set. At the same time, if we don't want we can turn off colored channels.
Notes:
If you're going to connect this bot to an automatic Long and Short direction,
Don’t forget! you need to Webhook URL,
Don’t miss paste this code to your message window {{strategy.order.alert_message}}
ALSO:
Set your range below the support zones and above the resistance zones.
Don't be afraid to take a wide range, it doesn't matter if you make a little money, the important thing is that you don't lose money.
If you have any ideas what to add to my work to add more sources or make calculations cooler, suggest in DM .
Grid Range Volatility BasedThis TradingView Pine script implements a grid range volatility based indicator that displays dynamic horizontal lines on the chart. The lines are calculated based on the average true range (ATR) of the security being plotted, and the range can be adjusted using an input parameter. The distance between the top and bottom lines is displayed as a percentage in a dynamic label that updates with each new bar.
The script allows the user to choose whether to use red or black lines, and also provides options to set the number of days for range calculations, and the calculation type (either ATR(1) or ATR(x)). The script is designed to work with stocks, forex, and other securities that have price data.
To use this script, simply attach it to a chart and adjust the input parameters to suit your analysis needs. The dynamic lines and percentage label will be displayed on the chart, providing a visual representation of the range volatility of the security being plotted. The values of the highest and lowest lines can also be displayed as labels on the price axis, providing additional context for the range volatility.
Scaled Order Sizing and Take Profit Target ArraysWOAH Order Scaling!
This Provides a user with methods to create a list of profit targets and order sizes which grow or shrink. For size, the will add up to specific sum. for Targets they will include the first and last, and can lean towards either, to scale the order grid.
And thanks to @Hoanghetti for the markdown, i've included a basic usage example within the hover , o you don't need to search for the usage example, simply import, and when writing, the code hint contains a full example.
scaled_sizes(total_size, count, weight, min_size, as_percent)
create an array of sizes which grow or shrink from first to last
which add up to 1.0 if set the as_percent flag , or a total value / sum.
Parameters:
total_size : (float) total size to divide ito split
count : (int ) desired number of splits to create
weight : (float) a weight to apply to grow or shrink the split either towards the last being most, or the first being most, or 1.0 being each is equally sized as 1/n count
min_size : (float) a minimum size for the smallest value (in value of ttotal_size units)
as_percent : (float) a minimum size for the smallest value (in value of total_size units)
Returns: Array of Sizes for each split
scaled_targets(count, weight, minimum, maximum)
create a list of take profitt targets from the smallest to larget distance
Parameters:
count : (int ) number of targets
weight : (float) weight to apply to growing or shrinking
minimum : (float) first value of the output
maximum : (float) last value of the output
Returns: Array of percentage targets
Grid Indicator - The Quant ScienceQuickly draw a 10-level grid on your chart with our open-source tool.
Our grid tool offers a unique solution to traders looking to maximize their profits in volatile market conditions. With its advanced features, you can create customized grids based on your preferred start price and line distance, allowing you to easily execute trades and capitalize on price movements. The tool works automatically, freeing up your time to focus on other important aspects of your trading strategy.
The benefits of using this tool are numerous. Firstly, it eliminates the need for manual calculation, making the analysis process much more efficient. Secondly, the automatic nature of the tool ensures that each grids are draw at precisely prices, giving you the best possible chance of maximizing your analysis. Finally, the ability to easily customize grids means that you can adapt your strategy quickly and effectively, even in rapidly changing market conditions.
So why wait? Take control of your trading and start using our innovative grid tool today! With its advanced features and ease of use, it's the perfect solution for traders of all levels looking to take their trading to the next level.
HOW TO USE
Using it is easy. Add the script to your chart and set the price and distance between the grids.
Hulk Grid Algorithm - The Quant ScienceGrid-based intraday algorithm that works 50% in trend following and 50% in swing trading. Orders are executed on a grid of 10 levels. The grid levels are dynamic and calculated on the difference between the previous day's open and close. The algorithm makes only long trades based on the following logic:
1. The daily close of the previous day is analyzed, the first condition is met if the previous day was bullish, closing higher than the 'opening.
2. Must pass 'x' number of bars before placing market orders.
3. The range, as the difference between close and open of the previous day must be greater than 'x'.
If these three conditions are met then the algorithm will proceed to place long orders. On a total of 10 grid levels, up to five trades are executed per day.
If the current close is above level 1 of the grid (previous day's close) then trend following trading will take place, working on the upper 5 levels. In this case each order is placed starting at level 1 and closed at each level above.
If the current close is below level 1 of the grid (previous day's open) then swing trading will be carried out, working on the lower 5 levels. In this case each order is placed starting at level 2 and closed at the upper level.
If at the time of order execution the price is above or below the stop loss and take profit levels, the algorithm will cancel the orders and prevent trading.
All orders are closed exclusively for two reasons:
1. If the stop loss or take profit level is confirmed.
2. If the daily session is ended.
UI Interface
You can adjust:
1. Backtesting period
2. 'x' number of bars before placing orders at the market (remember to always add 2 to the number you enter in the user interface if you enter 2 then execution will occur at the market opening after the fourth bar).
3. Intercepted price range between close and open of the previous day, avoiding trading on days when the range is too low.
4. Stop loss, level calculated from the 'last lower grid, if the market breaks this level the grid is destroyed and closes all open positions.
5. Take profit, the level calculated from the last upper grid, if the market breaks this level the grid is destroyed and closes all open positions.
The backtesting you see in the example was generated on:
BINANCE:BTCUSDT
Timeframe 15 min
Stop loss 2%
Take profit 2%
Minimum bars 3
Size grid range 500
This algorithm can be used only on intraday timeframe.
Assassin's Grid
Introduction: Are you a fan of automated grid-based trading and holding onto your crypto assets like they're the last Snickers bar in the world? If so, this Pine script could be your new best friend!
Grid Trading Genius: The script uses some seriously advanced grid trading techniques to automatically place orders at different price levels, creating a mesh of positions that move with the market like a well-oiled machine. This strategy can be great for traders who are willing to sit back and let their positions grow like a fine wine over time.
Optimization Features: The script comes loaded with all sorts of features and tools to help traders optimize their grid positions, like position exits and custom alerts for creating limit and market orders. This helps keep traders in the loop and allows them to take action as needed, like a ninja in the night.
Unique Twists: One of the unique features of this script is the option to choose between normal or incremental entry steps in a 1,2,3,... ratio. By choosing incremental entries, traders can potentially improve their average price and increase their potential profits like a boss. Just keep in mind that this script doesn't have a stop loss feature, but it does include the option to sell without profit on the final entry or on all entries if desired. Additionally, the script is always open to improvement and any ideas for improving it are welcome, like a blank canvas.
Conclusion: If you love automated trading and have the patience and determination to stick to a solid strategy, this Pine script could be a great fit for you. It's suitable for traders who are comfortable with more complex trading approaches and are willing to put in the time and effort to learn and master the script's various features and techniques, like a Jedi Knight