CFD Lot Calculator [MT5 Optimized]CFD Position Size Calculator for MT5 (ES/NQ)
A clean, professional Pine Script tool that calculates optimal position sizes in lots for ES/NQ CFDs based on:
Account balance
Risk percentage per trade
Stop loss in pips
Contract size (default = 1 for MT5)
Features:
✅ Bottom-right compact table
✅ Displays risk amount, stop loss, and lot size
✅ Works with any CFD broker (adjust pip/contract values if needed)
✅ Detailed tooltips explain all inputs
Perfect for traders who want precise position sizing without chart clutter.
Pine utilities
RiskCalc FX & GoldRiskCalc FX & Gold is a multi-market position sizing tool designed to help you manage risk quickly and accurately. With this script, simply enter your account capital, the percentage of risk you wish to take, and your stop in ticks. Depending on the selected market—Forex or XAUUSD—the script automatically adjusts its calculations:
Forex: Assumes 1 lot equals 100,000 units.
XAUUSD: Assumes 1 lot equals 100 ounces.
The script calculates your risk in dollars and, using a fixed value of 1 USD per tick per lot, determines the ideal position size in both lots and total contracts. Results are displayed in a clear, centralized table at the top of the chart for real-time decision-making.
Perfect for traders operating across multiple markets who need an automated and consistent approach to risk management.
High-Win Trend & Momentum StrategyStrategy created by team Narayan Ventures. Details are below for reference.
✅ Trend-Following (EMA-Based Entries)
✅ Momentum Confirmation (RSI & MACD)
✅ ATR-Based Dynamic Stop-Loss
✅ Risk-Reward Ratio (1:1, 1:2 or 1:3, adjustable)
✅ Backtest Results Display
Barras de resiliencia contra el mercadoRelative strength vs market indicator
🎯 main goal:
To visually detect when a stock shows relative strength against the S&P 500, especially on down days in the market. The indicator helps identify stocks that:
Go up while the SP500 goes down
Fall less than the SP500
🟩 solid green bar (upward)
Condition: SP500 closes negative, your stock closes positive.
Color: solid green
Meaning: strong relative strength. The stock goes up while the market drops.
Example:
SP500: -1.2%
Stock: +1.5%
Difference: +2.7% → green bar going up
🟧 light orange bar (upward)
Condition: SP500 closes negative, your stock also drops, but less than the SP500.
Color: light orange
Meaning: resilience. Still a down day, but the stock shows relative strength.
Example:
SP500: -2.0%
Stock: -0.5%
Difference: +1.5% → light orange bar going up
🟥 red bar (downward)
Condition: SP500 closes negative, your stock drops more than the index.
Color: solid red
Meaning: clear weakness. The stock is underperforming in a weak market.
Example:
SP500: -0.8%
Stock: -2.0%
Difference: -1.2% → red bar going down
🟩 light green bar (upward)
Condition: SP500 closes positive, your stock outperforms the index (goes up more).
Color: light green (50% opacity)
Meaning: relative strength in a strong market. Not as critical, but still positive.
Example:
SP500: +0.5%
Stock: +1.5%
Difference: +1.0% → light green bar going up
🟩 light green bar (downward)
Condition: SP500 closes positive, but your stock underperforms (gains less or even drops).
Color: light green (50% opacity)
Meaning: underperformance on a strong day. The stock lags the index.
Example 1:
SP500: +1.8%
Stock: +0.5%
Difference: -1.3% → light green bar going down
Example 2:
SP500: +1.0%
Stock: -0.5%
Difference: -1.5% → light green bar going down
HOB / GuGaApart from the standard support-resistance zones or FVGs, you can improve your trading strategies by identifying hidden support-resistance zones on the current timeframe.
Next Bar CountdownLittle script to show a countdown for the next candle (or the close of the actual candle) on the bottom right corner of the chart.
There is a countdown integrated in the scale, but it always changes the vertical position and sometimes it is hard to find between labels and often is cover by the mouse cursor etc. ...
I want a fixed position for that to reduce "mental overhead".
It is driven by ticks, if there are no ticks the counter will not update. This a limitation in the tv pine script. (at least this is what claude.ai says ;-) )
Trade Ladder Pro: Compounding & Risk ManagerTrade Ladder Pro: Compounding & Risk Manager
Inspired by the popular $20 to $52,000 trading challenge, this tool is designed to help you scale your trading account using systematic compounding and enhanced risk management techniques. Whether you’re aiming for disciplined growth or fine-tuning your risk/reward, Trade Ladder Pro offers a flexible approach to visualizing your trade levels.
How to Use:
Inputs:
Compounding Mode:
Set your starting balance, final balance goal, number of trades, and current trade level. You can move to the next trade after a successful trade in settings. The entries are not signals. They are there to help manage risk.
The script calculates the necessary compounding factor to grow your balance across the defined trades.
Risk Management Mode:
In addition to the above, specify a risk percentage and risk/reward ratio.
Input an entry price (or leave it at 0 to use the current price) to automatically compute the stop loss and take profit levels.
Display Options:
Choose the table’s position on the chart (e.g., Top Right, Top Left, Bottom Right, Bottom Left).
Pick between a vertical or horizontal layout for a display that suits your workflow.
Results:
The table will display the trade level, starting balance, risk amount, entry price, take profit, and (if in Risk Management mode) stop loss along with the projected ending balance.
Community & Feedback:
Your feedback is invaluable! Please share any tips or report any errors you encounter so we can continue to improve this tool. Happy trading!
ATR SL and TP with Candle Freeze & DataWindowThis indicator uses the Average True Range (ATR) to automatically calculate your stop loss (SL) and take profit (TP) levels based on the current market volatility and your chosen multipliers. Here's how it works:
ATR Calculation:
The indicator computes the ATR, which measures the average market volatility over a set period. This value helps gauge how much the price typically moves.
SL and TP Determination:
Depending on whether you're in a long or short trade, the SL and TP are calculated relative to the current price:
For a long trade, the stop loss is set below the current price (by subtracting a multiple of the ATR) and the take profit is set above it (by adding a multiple of the ATR).
For a short trade, the calculations are reversed.
Candle Freeze Feature:
Once a new candle starts, the calculated SL and TP values are "frozen" for that candle. This means they remain constant during the candle's formation, preventing them from updating continuously as the price fluctuates. This can make it easier to plan your trades without the levels shifting mid-candle.
Data Window & Labels:
The SL and TP values are plotted on the chart as lines and displayed in labels for quick reference. Additionally, they appear in TradingView's Data Window, so you can easily copy the price numbers if needed.
Overall, the indicator is designed to help you manage your trades by setting dynamic, volatility-adjusted SL and TP levels that only update at the start of each new candle, aligning with your chosen timeframe. Let me know if you have any more questions or need further adjustments!
Treasury Yield// This is based on Treasury Yield created by morzor61
// The improvement is upgrading to Pine v6
It is easy to compare the bond yield across different time and country.
Ersin Efsanesi Stratejisi v1.0This strategy uses moving averages, RSI, and volume analysis to identify potential buy and sell signals. It aims to find market trends and provide trading opportunities based on specific technical indicators.
Daily Break IndicatorThis indicator shows the daily trading. This is useful when back testing. To be aware of the end and the start of the day especially UTC +8 Time Zones.
VSA Vol Key VSA Signals
(1) No Demand – Bearish Signal
Low volume, narrow spread.
Price rises, but volume does not increase → Weak market, lack of buyers.
If this appears in an uptrend, it may indicate a potential reversal.
(2) No Supply – Bullish Signal
Low volume, narrow spread.
Price declines, but volume does not increase → Weak selling pressure.
If this appears in an uptrend, it may confirm the continuation of the uptrend.
(3) Stopping Volume – Bullish Reversal Signal
Strong price decline, but unusually high volume.
Candle shows a long lower wick, closing near the top.
Indicates Smart Money absorbing supply, signaling a potential reversal upwards.
(4) Climactic Volume – Possible Trend Reversal
Extremely high volume with a sharp price increase or decrease.
If this occurs after a long trend, it may indicate a trend reversal.
Smart Money may be taking profits after a prolonged price movement.
(5) Effort vs. Result
If volume is high but price movement is weak → Inefficient buying/selling, possible reversal.
If volume is high and price moves strongly in the same direction → Trend is likely to continue.
Exact Dynamic Yield SpreadYield Spread Overlay
"Yield Spread Overlay" is an indicator that displays the yield spread between two currencies based on their respective 10-year bond yields. It overlays directly onto the Forex chart, allowing real-time visualization of the relationship between the yield spread and the currency pair's price movements.
This indicator saves time by avoiding the manual addition of bond yields. Unlike manual methods, it supports smaller timeframes (1h, 4h, etc.), making it particularly useful.
Several customization options are available to suit individual preferences:
Custom Display: Adjust the line thickness and color.
Scale Position: Choose between displaying the scale on the right or left side of the chart.
This indicator helps traders better understand currency relationships and can serve as an additional tool within a Forex trading strategy.
All feedback, suggestions, and critiques—positive or negative—are welcome to continually improve this tool.
Supertrend Fixed TP Unified with Time Filter (MSK)Trend Strategy Based on the SuperTrend Indicator
This strategy is based on the use of the adaptive SuperTrend indicator, which takes into account the current market volatility and acts as a dynamic trailing stop. The indicator is visualized on the chart with colors that change depending on the direction of the trade: green indicates an uptrend (long), while red indicates a downtrend (short).
How It Works:
A buy signal (long) is generated when a bar closes above the indicator line.
A sell signal (short) is triggered when a bar closes below the indicator line.
Strategy Settings:
Trading Modes :
Long only : Only long positions are allowed.
Short only : Only short positions are allowed.
Both : Both types of trades are permitted.
Take-Profit :
The strategy supports a simple percentage-based take-profit, allowing you to lock in profits during sharp price movements without waiting for a pullback.
The take-profit level and its value are visualized on the chart. Visualization can be disabled in the settings.
Colored Chart Areas :
Long and short areas on the chart are highlighted with background colors for easier analysis.
Price Level :
You can set a price level in the settings to restrict trade execution:
Long trades are executed only above the specified level.
Short trades are executed only below the specified level.
This mode can be enabled or disabled in the parameters.
________________________________________________________________
Описание стратегии (на русском языке)
Трендовая стратегия на основе индикатора SuperTrend
Стратегия основана на использовании адаптивного индикатора SuperTrend , который учитывает текущую волатильность рынка и играет роль динамического трейлинг-стопа. Индикатор визуализируется на графике цветом, который меняется в зависимости от направления сделки: зелёный цвет указывает на восходящий тренд (лонг), а красный — на нисходящий тренд (шорт).
Принцип работы:
Сигнал на покупку (лонг) генерируется при закрытии бара выше линии индикатора.
Сигнал на продажу (шорт) возникает при закрытии бара ниже линии индикатора.
Настройки стратегии:
Режимы торговли :
Long only : только лонговые позиции.
Short only : только шортовые позиции.
Both : разрешены оба типа сделок.
Тейк-профит :
Стратегия поддерживает простой процентный тейк-профит, что позволяет фиксировать прибыль при резком изменении цены без ожидания отката.
Уровень и значение тейк-профита визуализируются на графике. Визуализацию можно отключить в настройках.
Цветные области графика :
Лонговые и шортовые области графика выделяются цветом фона для удобства анализа.
Уровень цены :
В настройках можно задать уровень цены, который будет ограничивать выполнение сделок:
Лонговые сделки выполняются только выше указанного уровня.
Шортовые сделки выполняются только ниже указанного уровня.
Этот режим можно включать или отключать в параметрах.
Daily Range %The Daily Range % Indicator calculates and plots a percentage of the daily range (high to low) based on a custom lookback period. It identifies outside bars from past daily data, prioritizing the most recent unbroken range. If no outside bar is found, it defaults to yesterday's range. The selected percentage of this range is then displayed on the chart, updating once per 5-minute bar (or the chosen resolution).
JsonAlertJsonAlert Library – Convert TradingView Alerts to JSON for Server Processing! 📡
🚀 The JsonAlert library makes it easy to send TradingView alerts as structured JSON to your server, allowing seamless integration with automated trading systems, databases, or webhook-based services.
📌 Features:
✅ Converts TradingView alert data into JSON format
✅ Supports custom key-value pairs for flexibility
✅ Allows frequency control (once per bar, once per bar close, every update)
✅ Easy to integrate with server-side PHP or other languages
Note that you have to pass one string array for keys and one string array for values , also you should pass alert frequency .
📖 Example Usage in Pine Script:
//@version=6
indicator("My script" , overlay = true)
import Penhan/JsonAlert/1 as alrt
if high > low
var array keys = array.from("ticker", "timeframe", "pattern")
var array values = array.from( syminfo.ticker , timeframe.period , str.tostring(123.45) )
alrt.alarm (keys, values , alert.freq_once_per_bar)
📡 Json Output Example:
{"ticker": "BTCUSDT","timeframe": "1","pattern": "123.45"}
🖥️ Server-Side PHP Example:
There you can integrate JsonAlert with your server in seconds! :)
Mark Hours/Minutes (Formula + Minutes)This Pine Script code is a TradingView indicator that analyzes the hour and minutes of each candle in a 1-minute timeframe and plots a red triangle above the candle if one of the following conditions is met:
Sum/Difference Condition: The sum or the absolute difference of the hours and minutes is equal to 29, 35, or 71, with a tolerance of +/- 1.
Minutes Condition: The minutes are equal to 00, 29, or 35.
This indicator is based on the Goldbach theory and the "algo path" concept popularized by Hopiplaka, which posits that algorithmic trading paths often initiate from minute values of 00, 29, and 35. Use this indicator according to your trading strategy.
Correlation X macroeconomicsFind the correlation between financial assets and the main Brazilian macroeconomic variables:
SELIC rate (Red)
PIB (Green)
Inflation (Blue)
Employment and income (Yellow)
Unlike other indicators that measure the correlation between two assets, the indicator "Correlation X macroeconomics" measures, for example, the correlation that the VALE3 asset has with the SELIC rate.
The correlation is obtained by calculating the variation suffered by a given asset on the day a given Brazilian macroeconomic variable is released.
This indicator can be used on any financial asset.
Use time frame chart = 1 day.
To calculate the correlation, data published by IBGE and the Central Bank of Brazil over a period of time are used. This time period is different depending on the selected macroeconomic variable. Namely:
16 PIB disclosures (4 years)
24 SELIC rate disclosures (3 years)
24 disclosures of IPCA and employment and income data (2 years)
You can select one or more macroeconomic variables to check the effect of correlation separately on each of them.
This indicator "Correlation X macroeconomics" will be updated monthly, as detailed below:
At the end of the day on which the PIB is released
At the end of the day on which employment and income data are released
At the end of the day following the day on which the SELIC rate is published
On the last business day of the month if none of the aforementioned disclosures occur
DateTimeLibrary with enums that can be used as script inputs to allow users to set their preferred date and/or time formats. The user-selected formats can be passed to the library functions (which use 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎() under the hood) to get formatted date and time strings from a UNIX time.
PREFACE
The target audience of this publication is users creating their own indicators/strategies.
Sometimes a date and/or time needs to be displayed to the user. As a Pine Coder, it is natural to focus our initial attention on the primary calculations or functions of a script, which can lead to the display format of dates and times being an afterthought. While it may not be crucial for the main use case of a script, increased customizability can help push indicators/strategies to the next level in the eyes of the user.
The purpose of this library is to provide an easy-to-use mechanism for allowing script users to choose the formats of dates and times that are displayed to them. Not only is this helpful for users from around the world who may be accustomed to different date/time formats, but it also makes it easier for the script author because it offloads the date/time formatting decision from the author to the user.
HOW TO USE
Step 1
Import the library. Replace with the latest available version number for this library.
//@version=6
indicator("Example")
import n00btraders/DateTime/ as dt
Step 2
Select a date format and/or time format enum to be used as an input.
dateFormatInput = input.enum(dt.DateFormat.FORMAT_3, "Date format")
timeFormatInput = input.enum(dt.TimeFormat.TWENTY_FOUR_HOURS, "Time hours format")
Step 3
Pass the user's selection as the `format` parameter in the formatting functions from this library. The `timestamp` & `timezone` parameters can be any value that would otherwise be used in 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎(𝚝𝚒𝚖𝚎, 𝚏𝚘𝚛𝚖𝚊𝚝, 𝚝𝚒𝚖𝚎𝚣𝚘𝚗𝚎).
string formattedDate = dt.formatDate(timestamp, dateFormatInput, timezone)
string formattedTime = dt.formatTime(timestamp, timeFormatInput, timezone)
LIMITATIONS
The library's ease-of-use comes at a few costs:
Fixed date/time formats.
Using the library's pre-defined date & time formats means that additional custom formats cannot be utilized. For example, this library does not include seconds or fractional seconds in formatted time strings. If a script's use case requires displaying the 'seconds' from a time of day, then 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎() must be used directly.
Fixed time zone offset format.
The `formatTime()` function of this library can optionally add the time zone offset at the end of the time string, but the format of the offset cannot be specified. Note: if the default format for time zone offset is not sufficient, the Timezone library can be imported directly to get the time zone offset string in a preferred format.
ADVANTAGES
There are benefits to utilizing this library instead of directly using 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎():
Easy to use from the user's perspective.
The date & time format enums provide a similar look and feel to the "Date format" and "Time hours format" options that already exist in the TradingView chart settings.
Easy to use from the author's perspective.
The exported functions from this library are modeled to behave similarly to the 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎(𝚝𝚒𝚖𝚎, 𝚏𝚘𝚛𝚖𝚊𝚝, 𝚝𝚒𝚖𝚎𝚣𝚘𝚗𝚎) built-in function from Pine Script.
Format quarter of the year.
The date formatting function from this library can display a fiscal quarter if it's included in the user-selected format. This is currently not possible with the built-in 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎().
EXPORTED ENUM TYPES
This section will list the available date/time formats that can be used as a script input. Each enum type has a detailed //@𝚏𝚞𝚗𝚌𝚝𝚒𝚘𝚗 description in the source code to help determine the best choice for your scripts.
Date Format Enums:
𝙳𝚊𝚝𝚎𝙵𝚘𝚛𝚖𝚊𝚝
𝙳𝚊𝚝𝚎𝙵𝚘𝚛𝚖𝚊𝚝𝙳𝚊𝚢𝙾𝚏𝚆𝚎𝚎𝚔𝙰𝚋𝚋𝚛
𝙳𝚊𝚝𝚎𝙵𝚘𝚛𝚖𝚊𝚝𝙳𝚊𝚢𝙾𝚏𝚆𝚎𝚎𝚔𝙵𝚞𝚕𝚕
𝙲𝚞𝚜𝚝𝚘𝚖𝙳𝚊𝚝𝚎𝙵𝚘𝚛𝚖𝚊𝚝
Supporting Date Enums:
𝙳𝚊𝚝𝚎𝙿𝚛𝚎𝚏𝚒𝚡
Time Format Enums:
𝚃𝚒𝚖𝚎𝙵𝚘𝚛𝚖𝚊𝚝
Supporting Time Enums:
𝚃𝚒𝚖𝚎𝙰𝚋𝚋𝚛𝚎𝚟𝚒𝚊𝚝𝚒𝚘𝚗
𝚃𝚒𝚖𝚎𝚂𝚎𝚙𝚊𝚛𝚊𝚝𝚘𝚛
𝚃𝚒𝚖𝚎𝙿𝚘𝚜𝚝𝚏𝚒𝚡
Note: all exported enums have custom titles for each field. This means that the supporting enums could also be exposed to the end-user as script inputs if necessary. The supporting enums are used as optional parameters in this library's formatting functions to allow further customizability.
EXPORTED FUNCTIONS
formatDate(timestamp, format, timezone, prefix, trim)
Converts a UNIX time into a date string formatted according to the selected `format`.
Parameters:
timestamp (series int) : A UNIX time.
format (series DateFormat) : A date format.
timezone (series string) : A UTC/GMT offset or IANA time zone identifier.
prefix (series DatePrefix) : Optional day of week prefix.
trim (series bool) : Optional truncation of numeric month / day.
Returns: Calendar date string using the selected format.
⸻⸻⸻⸻⸻⸻⸻⸻
Required parameters: `timestamp`, `format`.
Note: there is a version of this function for each Date Format enum type. The only difference is the type of the `format` parameter.
Tip: hover over the `formatDate()` function in the Pine Editor to display useful details:
Function description
Parameter descriptions + default values
Example function usage
formatTime(timestamp, format, timezone, trim, separator, postfix, space, offset)
Converts a UNIX time into a formatted time string using the 24-hour clock or 12-hour clock.
Parameters:
timestamp (series int) : A UNIX time.
format (series TimeFormat) : A time format.
timezone (series string) : A UTC/GMT offset or IANA time zone identifier.
trim (series TimeAbbreviation) : Optional truncation of the hour and minute portion.
separator (series TimeSeparator) : Optional time separator.
postfix (series TimePostfix) : Optional format for the AM/PM postfix.
space (series bool) : Optional space between the time and the postfix.
offset (series bool) : Optional UTC offset as a suffix.
Returns: Time of day string using the selected format.
⸻⸻⸻⸻⸻⸻⸻⸻
Required parameters: `timestamp`, `format`.
Note: the `trim`, `postfix`, and `space` optional parameters are not applicable and will be ignored when using the 24-hour clock (`format` = TimeFormat.TWENTY_FOUR_HOURS).
Tip: hover over the `formatTime()` function in the Pine Editor to display useful details:
Function description
Parameter descriptions + default values
Example function usage
Example outputs for combinations of TimeFormat.* enum values & optional parameters
NOTES
This library can be used in conjunction with the Timezone library to increase the usability of scripts that can benefit from allowing the user to input their preferred time zone.
Credits to HoanGhetti for publishing an informative Markdown resource which I referenced to create the formatted function descriptions that pop up when hovering over `formatDate()` and `formatTime()` function calls in the Pine Editor.
Lot Size InfoLot Size Info – Quick Futures Lot Size Display
Overview:
The Lot Size Info indicator helps traders quickly determine the lot size of futures contracts for a given symbol.
How It Works:
- Automatically detects whether the current symbol is a futures contract.
- If a futures contract exists, it fetches and displays the lot size.
- If no futures contract is available, it doesn't display anything.
- The information is displayed in a non-intrusive table at the bottom-right of the chart.
Why Use This Indicator?
✅ Instant Futures Lot Size Visibility – No need to check manually.
✅ Prevents Confusion – Displays nothing when no futures contract exists.
✅ Minimal & Non-Distracting UI – Small floating table that updates in real-time.
🔹 Best for: Futures traders, scalpers, and positional traders who frequently switch between stock and futures charts.
🚀 Add this to your TradingView toolkit today!
XAUUSD Correlation IndicatorXAUUSD Correlation Indicator
Questo indicatore per TradingView calcola e visualizza la correlazione tra il prezzo di XAUUSD (oro) e una serie di altri asset finanziari, tra cui valute (EURUSD, AUDUSD, NZDUSD, GBPUSD), metalli preziosi (platino, argento), indici azionari (SPX500, DJI, NASDAQ) e il dollaro statunitense (DXY).
L'indicatore offre:
1. Correlazione: Calcola la correlazione tra XAUUSD e gli altri asset su un periodo personalizzabile, dove un numero superiore allo 0 indica una correlazione positiva ed un numero inferiore allo 0 indica una correlazione negativa.
2. Variazione percentuale: Mostra la variazione percentuale dei prezzi degli asset rispetto all'apertura.
3. Visualizzazione personalizzabile: Permette di ordinare i dati in base alla correlazione o alla variazione percentuale.
4. Tabella interattiva: I risultati sono visualizzati in una tabella colorata, con opzioni per personalizzare i colori di sfondo, testo e bordi.
Ideale per trader e analisti che vogliono monitorare le relazioni tra l'oro e altri mercati in tempo reale, questo strumento aiuta a identificare opportunità di trading basate su correlazioni e tendenze di mercato.
TRP Stop-Loss and Position SizingScript is based on TRP to see both Long Stop Loss and Short Stop Loss, You can Also adjust the position size based on your capital and percentage risk.
Advanced Adaptive Grid Trading StrategyThis strategy employs an advanced grid trading approach that dynamically adapts to market conditions, including trend, volatility, and risk management considerations. The strategy aims to capitalize on price fluctuations in both rising (long) and falling (short) markets, as well as during sideways movements. It combines multiple indicators to determine the trend and automatically adjusts grid parameters for more efficient trading.
How it Works:
Trend Analysis:
Short, long, and super long Moving Averages (MA) to determine the trend direction.
RSI (Relative Strength Index) to identify overbought and oversold levels, and to confirm the trend.
MACD (Moving Average Convergence Divergence) to confirm momentum and trend direction.
Momentum indicator.
The strategy uses a weighted scoring system to assess trend strength (strong bullish, moderate bullish, strong bearish, moderate bearish, sideways).
Grid System:
The grid size (the distance between buy and sell levels) changes dynamically based on market volatility, using the ATR (Average True Range) indicator.
Grid density also adapts to the trend: in a strong trend, the grid is denser in the direction of the trend.
Grid levels are shifted depending on the trend direction (upwards in a bear market, downwards in a bull market).
Trading Logic:
The strategy opens long positions if the trend is bullish and the price reaches one of the lower grid levels.
It opens short positions if the trend is bearish and the price reaches one of the upper grid levels.
In a sideways market, it can open positions in both directions.
Risk Management:
Stop Loss for every position.
Take Profit for every position.
Trailing Stop Loss to protect profits.
Maximum daily loss limit.
Maximum number of positions limit.
Time-based exit (if the position is open for too long).
Risk-based position sizing (optional).
Input Options:
The strategy offers numerous settings that allow users to customize its operation:
Timeframe: The chart's timeframe (e.g., 1 minute, 5 minutes, 1 hour, 4 hours, 1 day, 1 week).
Base Grid Size (%): The base size of the grid, expressed as a percentage.
Max Positions: The maximum number of open positions allowed.
Use Volatility Grid: If enabled, the grid size changes dynamically based on the ATR indicator.
ATR Length: The period of the ATR indicator.
ATR Multiplier: The multiplier for the ATR to fine-tune the grid size.
RSI Length: The period of the RSI indicator.
RSI Overbought: The overbought level for the RSI.
RSI Oversold: The oversold level for the RSI.
Short MA Length: The period of the short moving average.
Long MA Length: The period of the long moving average.
Super Long MA Length: The period of the super long moving average.
MACD Fast Length: The fast period of the MACD.
MACD Slow Length: The slow period of the MACD.
MACD Signal Length: The period of the MACD signal line.
Stop Loss (%): The stop loss level, expressed as a percentage.
Take Profit (%): The take profit level, expressed as a percentage.
Use Trailing Stop: If enabled, the strategy uses a trailing stop loss.
Trailing Stop (%): The trailing stop loss level, expressed as a percentage.
Max Loss Per Day (%): The maximum daily loss, expressed as a percentage.
Time Based Exit: If enabled, the strategy exits the position after a certain amount of time.
Max Holding Period (hours): The maximum holding time in hours.
Use Risk Based Position: If enabled, the strategy calculates position size based on risk.
Risk Per Trade (%): The risk per trade, expressed as a percentage.
Max Leverage: The maximum leverage.
Important Notes:
This strategy does not guarantee profits. Cryptocurrency markets are volatile, and trading involves risk.
The strategy's effectiveness depends on market conditions and settings.
It is recommended to thoroughly backtest the strategy under various market conditions before using it live.
Past performance is not indicative of future results.