DCA KuCoin Strategy Backtesting [ScrimpleAI]This script is a backtester for a Dollar Cost Averaging (DCA) strategy on KuCoin, developed for TradingView. It allows users to simulate recurring investments in an asset, test different configurations, and find the best parameters to maximize performance. The script provides a detailed simulation of a DCA strategy, analyzing the impact of different configurations on investments over time. It is designed to be open-source on TradingView, offering a free tool to optimize the use of DCA bots on KuCoin.
Strategy Settings
The script uses an initial capital of 10,000 euros and sets a commission of 0.07 percent per trade. The invested amount is set as a percentage of equity, supporting up to 100 open trades simultaneously. Orders are processed at the close of each candle, and trading is conducted in euros.
Customizable Parameters
The script allows users to choose the investment interval, ranging from a minimum of one hour to a maximum of two weeks. Users can set the amount invested per trade, with a default value of 1,000 USDT and a minimum of 2 USDT. A maximum investment limit can also be defined, preventing further trades once this limit is reached. Additionally, a profit target is available, expressed as a percentage, indicating the profit level at which all positions will be closed.
Backtesting Period Selection
Users can select a specific time range to test the strategy. The bot will execute trades only within this period.
Strategy Logic
The bot makes the first purchase when no trades are open, using the current closing price to calculate the quantity of assets to buy. Subsequent purchases occur at the specified frequency, provided the invested capital does not exceed the set maximum limit. When total equity surpasses the initial value plus the profit target, the bot closes all positions to secure the profit. A check is implemented to prevent errors related to opening and closing trades simultaneously.
Error Management
The script ensures that the selected timeframe is compatible with the chosen investment interval. If the timeframe is too high compared to the investment frequency, an error is triggered. Additionally, if available capital becomes negative, the script stops execution and suggests modifying the test parameters.
Gestão de carteira
Multi-Asset Ratio (20 vs 5) - LuchapCet indicateur calcule et affiche le ratio entre la somme des prix de plusieurs actifs de base et la somme des prix de plusieurs actifs quote. Vous pouvez sélectionner jusqu'à 20 actifs de base et 5 actifs quote, et activer ou désactiver individuellement chaque actif pour affiner votre analyse. Ce ratio permet d'évaluer rapidement la performance relative de différents groupes d'actifs.
Talha's Pro Signal (Version 5)Talha's Pro Signal – Smart Trading Indicator
🔹 Talha's Pro Signal is a multi-indicator trading strategy that combines EMA, RSI, and MACD to generate reliable BUY & SELL signals for traders.
✅ Key Features:
. EMA (9 & 21): Identifies trend direction and potential entries.
. RSI (14): Analyzes market strength and overbought/oversold conditions.
. MACD (12, 26, 9): Confirms trend momentum and crossovers.
. ATR-Based SL & TP: Smart risk management with stop loss & take profit levels.
. Clear Entry & Exit Signals: Plots precise BUY & SELL labels and arrows on the chart.
🎯 This indicator is suitable for Forex, Stocks, Crypto, and other markets. Always follow your own analysis and risk management before taking a trade.
📌 Free to Use – Happy Trading! 🚀
Talha's Pro Signal – Smart Trading Indicator
🔹 Talha's Pro Signal হল একটি মাল্টি-ইন্ডিকেটর ট্রেডিং স্ট্র্যাটেজি, যা EMA, RSI ও MACD এর সমন্বয়ে নির্ভরযোগ্য BUY ও SELL সিগন্যাল প্রদান করে।
✅ Key Features:
. EMA (9 & 21): ট্রেন্ড ফলো করে সঠিক এন্ট্রি নির্ধারণ করে।
. RSI (14): মার্কেটের শক্তি ও ওভারবট/ওভারসোল্ড কন্ডিশন বিশ্লেষণ করে।
. MACD (12, 26, 9): ট্রেন্ড কনফার্মেশন ও মোমেন্টাম বিশ্লেষণ করে।
. ATR-Based SL & TP: স্মার্ট রিস্ক ম্যানেজমেন্ট।
. Clear Entry & Exit Signals: চার্টে স্পষ্ট BUY & SELL লেবেল ও অ্যারো প্লটিং।
🎯 এই ইন্ডিকেটরটি ফরেক্স, স্টক, ক্রিপ্টোসহ সব মার্কেটে ব্যবহারযোগ্য। ট্রেড নেওয়ার আগে অবশ্যই নিজের এনালাইসিস ও রিস্ক ম্যানেজমেন্ট অনুসরণ করুন।
📌 Free to Use – Happy Trading! 🚀
E LI - Lot Size CalculatorLot size calculator, Save time and efficiency with this lot calculator integrated into trading view, describe your risk in % your capital and the size of your SL and it will calculate everything for you
Position Tracker 1.0Position Tracker 1.0 allows users to input their position using USD, quantity, or a DCA approach while setting take profit (TP) and stop loss (SL) levels based on either fixed dollar values or percentages. The indicator provides optional markers for TP/SL crossings and an entry label showing key trade details. A live tracker can be enabled for real-time P&L updates, and all visual elements are customizable for clarity and preference.
Instructions for Position Tracker 1.0
1. Input Method & Position Details:
* Choose between USD, Quantity, or DCA.
* Enter your entry price, entry time, investment amount, or quantity as needed.
2. TP & SL Setup:
* For each TP (up to 5) and the SL, select whether to use a fixed dollar target or a percentage
target relative to your entry price.
* Enter the corresponding price (if using Dollar) or percentage (if using Percentage).
* For TPs, specify the percentage of your position to sell when the level is hit.
3. Marker & Display Options:
* Toggle the TP and SL crossing markers on or off.
* Adjust which details (Price, Diff, Sell for TP; Price, Diff, Loss for SL) are shown on the labels.
* The entry label always shows the Avg. Cost and can optionally include the quantity, invested
amount, and live tracker (real-time P&L).
4. Visual Customization:
* Change text size, marker size, and colors for profit, loss, TP, and SL lines as desired.
Binance Pseudo Funding FeeThe indicator calculates the Funding Fee for Binance based on the Premium Index provided by TradingView. The calculation formula can be found here: Binance Funding Rate Introduction . This is NOT the official rate visible on binance.com and used for settlements, but rather an estimated rate, which is inherently INACCURATE . The accuracy of the calculation heavily depends on the timeframe, with almost perfect results on minute-based timeframes.
For the most accurate calculations, you need to visit Binance Funding History and fill in the corresponding Interval , Interest Rate , and Funding Cap/Floor settings for the specific symbol in the indicator's settings. I understand this is not convenient, but for now, this is how it works.
The blue bars indicate the settlement time. Funding can be smoothed using moving averages. Both the funding rate and the moving averages are displayed using plot and are labeled, so you can set alerts on them.
Gold Pro StrategyHere’s the strategy description in a chat format:
---
**Gold (XAU/USD) Trend-Following Strategy**
This **trend-following strategy** is designed for trading gold (XAU/USD) by combining moving averages, MACD momentum indicators, and RSI filters to capture sustained trends while managing volatility risks. The strategy uses volatility-adjusted stops to protect gains and prevent overexposure during erratic price movements. The aim is to take advantage of trending markets by confirming momentum and ensuring entries are not made at extreme levels.
---
**Key Components**
1. **Trend Identification**
- **50 vs 200 EMA Crossover**
- **Bullish Trend:** 50 EMA crosses above 200 EMA, and the price closes above the 200 EMA
- **Bearish Trend:** 50 EMA crosses below 200 EMA, and the price closes below the 200 EMA
2. **Momentum Confirmation**
- **MACD (12,26,9)**
- **Buy Signal:** MACD line crosses above the signal line
- **Sell Signal:** MACD line crosses below the signal line
- **RSI (14 Period)**
- **Bullish Zone:** RSI between 50-70 to avoid overbought conditions
- **Bearish Zone:** RSI between 30-50 to avoid oversold conditions
3. **Entry Criteria**
- **Long Entry:** Bullish trend, MACD bullish crossover, and RSI between 50-70
- **Short Entry:** Bearish trend, MACD bearish crossover, and RSI between 30-50
4. **Exit & Risk Management**
- **ATR Trailing Stops (14 Period):**
- Initial Stop: 3x ATR from entry price
- Trailing Stop: Adjusts to lock in profits as price moves favorably
- **Position Sizing:** 100% of equity per trade (high-risk strategy)
---
**Key Logic Flow**
1. **Trend Filter:** Use the 50/200 EMA relationship to define the market's direction
2. **Momentum Confirmation:** Confirm trend momentum with MACD crossovers
3. **RSI Validation:** Ensure RSI is within non-extreme ranges before entering trades
4. **Volatility-Based Risk Management:** Use ATR stops to manage market volatility
---
**Visual Cues**
- **Blue Line:** 50 EMA
- **Red Line:** 200 EMA
- **Green Triangles:** Long entry signals
- **Red Triangles:** Short entry signals
---
**Strengths**
- **Clear Trend Focus:** Avoids counter-trend trades
- **RSI Filter:** Prevents entering overbought or oversold conditions
- **ATR Stops:** Adapts to gold’s inherent volatility
- **Simple Rules:** Easy to follow with minimal inputs
---
**Weaknesses & Risks**
- **Infrequent Signals:** 50/200 EMA crossovers are rare
- **Potential Missed Opportunities:** Strict RSI criteria may miss some valid trends
- **Aggressive Position Sizing:** 100% equity allocation can lead to large drawdowns
- **No Profit Targets:** Relies on trailing stops rather than defined exit targets
---
**Performance Profile**
| Metric | Expected Range |
|----------------------|---------------------|
| Annual Trades | 4-8 |
| Win Rate | 55-65% |
| Max Drawdown | 25-35% |
| Profit Factor | 1.8-2.5 |
---
**Optimization Recommendations**
1. **Increase Trade Frequency**
Adjust the EMAs to shorter periods:
- `emaFastLen = input.int(30, "Fast EMA")`
- `emaSlowLen = input.int(150, "Slow EMA")`
2. **Relax RSI Filters**
Adjust the RSI range to:
- `rsiBullish = rsi > 45 and rsi < 75`
- `rsiBearish = rsi < 55 and rsi > 25`
3. **Add Profit Targets**
Introduce a profit target at 1.5% above entry:
```pine
strategy.exit("Long Exit", "Long",
stop=longStopPrice,
profit=close*1.015, // 1.5% target
trail_offset=trailOffset)
```
4. **Reduce Position Sizing**
Risk a smaller percentage per trade:
- `default_qty_value=25`
---
**Best Use Case**
This strategy excels in **strong trending markets** such as gold rallies during economic or geopolitical crises. However, during sideways or choppy market conditions, the strategy might require manual intervention to avoid false signals. Additionally, integrating fundamental analysis—like monitoring USD weakness or geopolitical risks—can enhance its effectiveness.
---
This strategy offers a balanced approach for trading gold, combining trend-following principles with risk management tailored to the volatility of the market.
1AM CRT (Long)1am utc-5 CRT long execution 2 and 3 am than take profit
1am utc-5 CRT long execution 2 and 3 am than take profit1am utc-5 CRT long execution 2 and 3 am than take profit1am utc-5 CRT long execution 2 and 3 am than take profit1am utc-5 CRT long execution 2 and 3 am than take profit1am utc-5 CRT long execution 2 and 3 am than take profit1am utc-5 CRT long execution 2 and 3 am than take profit1am utc-5 CRT long execution 2 and 3 am than take profit1am utc-5 CRT long execution 2 and 3 am than take profit1am utc-5 CRT long execution 2 and 3 am than take profit
Custom MAFACustom indicator of fang stocks to track other similar ETF's and see fi there are any arbitrage opportunities.
Sharpe and Sortino Ratios with Date RangeThis indicator calculates the Sharpe and Sortino ratios using a chart symbol's periodic price returns.
I added the ability to calculate SORTINO and Sharpe based on CUSTOM DATES within the option menu.
It builds on the script here: by adding this feature.
A little about the Sortino Ratio.
www.nasdaq.com
I want equity market returns, but I don’t want equity market volatility. This is the sentiment many investors naturally feel. This sentiment often grows stronger as one approaches or is in the phase where they desire distributions from their savings to improve lifestyle. This is why there is a need for active management in the investment arena. The desire to control downside volatility, but also participate in the upside growth is a very fundamental human desire. The Sortino Ratio measures how well a particular investment meets this fundamental human desire.
There is the old adage, “volatility is the price you pay for returns.” However, what if we could measure the historical performance of an investment and see if it has given above average returns compared to the downside volatility. This is a simple division problem. It will tell us if the volatility “price we are paying for returns” is good. We can then compare that to other investments to see how they compare.
Let us take the return and subtract the risk-free interest rate and then simply divide that by the downside movement from the average. A basic division problem yielding a number that measures a very basic human desire: How well did this investment do compared to the downside risk it experienced.
In the world of financial analysis and investment management, ratios are abundant. There are many ratios that are truly important to a particular analysis. However, the sheer abundance of ratios that are available often overwhelms the casual investor, leading them to disregard ratios altogether. I would argue for those investors that desire a way to rank an investment by its ability to satisfy this very fundamental human desire, the Sortino Ratio is the number they need to consider.
Disappointing in the marketplace for research, the Sortino Ratio is not featured prominently. It is much easier to find the inflows a particular ETF has experienced than the Sortino Ratio. Inflows are important. They measure how much people are investing into an ETF. However, they are mostly only important to the fund manager, not the investor. What investors care about is the Risk-Adjusted Return. This is the Sortino Ratio.
Rolling CAGRRolling CAGR (Compound Annual Growth Rate) Indicator
This indicator calculates and plots the rolling Compound Annual Growth Rate (CAGR) for any selected data source. CAGR represents the mean annual growth rate of an investment over a specified time period, taking into account the effect of compounding.
Features:
• Customizable data source (default: close price)
• Adjustable time period in years
• Configurable trading days per year (252 for stocks, 365 for crypto)
• Results displayed as percentage values
• Works on daily timeframes
Input Parameters:
• Data Source: Select the price or indicator data to analyze
• Number of Years: Set the lookback period for CAGR calculation
• Trading Days in a Year: Adjust based on market type (252 for stocks, 365 for crypto)
Usage:
Perfect for analyzing long-term growth rates and comparing investment performance across different periods. The indicator provides a rolling view of compound growth, helping traders and investors understand the sustained growth rate of an asset over their chosen timeframe.
Note: This indicator is designed for daily timeframes as CAGR calculations are most meaningful over longer periods.
Formula Used:
CAGR = (End Value / Start Value)^(1/number of years) - 1
Position Size Calculator (MOEX Futures)Описание на русском языке
Этот скрипт для TradingView создан специально для трейдеров, работающих с фьючерсами на Московской бирже. Его основная цель – помочь трейдерам быстро и точно рассчитывать параметры позиции, такие как количество контрактов, риск на сделку, общий размер маржи, а также цены стоп-лосса и тейк-профита.
Функционал:
Расчет цены контракта: учитывает цену актива (в пунктах) и стоимость одного пункта.
Риск на сделку: определяется как процент от общего капитала.
Размер позиции: рассчитывается на основе риска на сделку и стоп-лосса.
Количество контрактов: округляется до целого числа вниз.
Общий размер маржи: определяется исходя из количества контрактов и маржи на один контракт.
Цены стоп-лосса и тейк-профита: вычисляются как для лонг-, так и для шорт-позиций.
Интерактивная таблица: статично отображается в правом верхнем углу графика и обновляется автоматически при изменении входных данных.
Скрипт заточен исключительно под специфику фьючерсов Московской биржи и позволяет трейдерам оптимизировать расчёты, минимизировать ошибки и экономить время.
Description in English
This TradingView script is specifically designed for traders working with futures on the Moscow Exchange. Its primary purpose is to help traders quickly and accurately calculate position parameters, such as the number of contracts, risk per trade, total margin size, and stop-loss and take-profit prices.
Features:
Contract price calculation: Takes into account the asset price (in points) and the price per point.
Risk per trade: Defined as a percentage of the total capital.
Position size: Calculated based on the risk per trade and stop-loss percentage.
Number of contracts: Rounded down to the nearest whole number.
Total margin size: Determined based on the number of contracts and margin per contract.
Stop-loss and take-profit prices: Calculated for both long and short positions.
Interactive table: Statically displayed in the top-right corner of the chart and dynamically updated when input parameters change.
This script is tailored exclusively to the specifics of futures trading on the Moscow Exchange, enabling traders to optimize calculations, minimize errors, and save time.
[Helper] Trade Journal TableThis indicator serves as a starting point for creating a customized trade journal that meets individual requirements. It provides a basic structure for visualizing trade data in table form which can be adapt to specific needs. The trade data must be maintained directly within the script using the Pine Editor.
Basic Structure:
The example table consists of six columns: Date, Entry Price, Exit Price, Profit/Loss (color-coded), Strategy, and Notes. It is displayed centrally on the chart and dynamically adjusts to the number of recorded trades.
Example Data:
To demonstrate its functionality, the indicator includes predefined example trades, which should be replaced with actual trading data. Additional information, such as strategies and notes, can be added to improve trade documentation.
Precision Trade Zone By KittisakThis indicator is designed for Money Management calculations, helping to facilitate risk management in trading, determining suitable leverage based on acceptable risk, and adjusting the Stop Loss level to align with the calculated leverage.
Abbreviation Descriptions
LR : Suitable Leverage.
EP : Entry Price.
BEP : Break-Even Point (a point where you can move your Stop Loss to prevent losses once the price reaches a certain level).
SL : Stop Loss (a recalculated Stop Loss level to match the leverage. You should use this as the Stop Loss price instead of the initial level you set).
TP : Take Profit (a point where you take profit based on the defined risk-reward ratio).
Note
When first activating the indicator, an error may occur, and no output will be displayed. This happens because you must first specify the Entry Price and Stop Loss in the indicator settings.
How Much Leverage Should You Use?
It may seem like a simple question but is difficult to answer.
Method for Calculating Suitable Leverage
Use the formula:
Leverage = Acceptable Loss / (Distance between Entry Price and Stop Loss + (Buy Fee + Sell Fee))
Calculating the Correct Stop Loss Point
(Stop Loss levels will be slightly adjusted or extended)
For Long Positions :
New Stop Loss = Entry Price * (1 - Acceptable Loss / (Calculated Leverage * 100))
For Short Positions :
New Stop Loss = Entry Price * (1 + Acceptable Loss / (Calculated Leverage * 100))
Calculating the Correct Take Profit Point
(Take Profit levels will be slightly adjusted or extended)
For Long Positions :
Take Profit = Entry Price * (1 + (Acceptable Loss / (Calculated Leverage * 100) * RR) + ((Buy Fee + Sell Fee) / 100))
For Short Positions :
Take Profit = Entry Price * (1 - (Acceptable Loss / (Calculated Leverage * 100) * RR) + ((Buy Fee + Sell Fee) / 100))
Benefits of This Calculation
1. Accurate Risk Assessment
The calculated leverage accounts for trading fees. For example, if you aim for a 2% loss, this method ensures the actual loss is exactly 2%, not more (e.g., 2% plus fees).
2. Eliminates Guesswork
Randomly setting leverage can lead to risks because the Stop Loss level may not align with your position. This calculation ensures that the leverage aligns precisely with your desired Stop Loss level.
3. Realistic Profit Targets
For example, with a 2% acceptable loss and a 1:2 RR, you expect a 4% profit. However, without this calculation, fees may reduce your profit below 4%. This method includes fees, ensuring your profit matches the intended target.
Caution
This indicator does not account for slippage or requotes. Use it with caution and allow a buffer for slippage in your calculations.
Indicator นี้มีไว้สำหรับคำนวณ Money Management ซึ่งจะช่วยอำนวยความสะดวกในการจัดการความเสี่ยงในการเทรด การคำนวณ Leverage ที่เหมาะสมกับความเสี่ยงที่คุณยอมรับได้ และจัดการจุด Stop Loss ให้เหมาะสมกับ Leverage นั้น
คำอธิบายเกี่ยวกับคำย่อ
LR หมายถึง Leverage ที่เหมาะสม
EP หมายถึง Entry Price หรือราคาเข้าซื้อ
BEP หมายถึง Break-Even Point หรือจุดคุ้มทุน (คุณสามารถย้าย Stop Loss มาที่จุดนี้เมื่อราคาไปถึงจุดหนึ่งเพื่อป้องกันการขาดทุนได้)
SL หมายถึง Stop Loss (ซึ่งเป็น Stop Loss ที่คำนวณใหม่เพื่อให้ตำแหน่งเหมาะสมกับ Leverage ที่คำนวณได้ คุณควรใช้จุดนี้เพื่อเป็นราคา Stop Loss แทนจุด Stop Loss ที่คุณกำหนดไว้ในตอนแรก)
TP หมายถึง Take Profit (เป็นจุดที่คุณจะขายทำกำไรตาม RR ที่กำหนดไว้)
* หมายเหตุ เมื่อเริ่มเปิด Indicator จะเกิด Error ขึ้น และไม่มีผลลัพท์ใด ๆ แสดงให้เห็น นั่นเป็นเพราะคุณต้องเข้าไปกำหนด Entry Price และ Stop Loss ในการตั้งค่าของ Indicator เสียก่อน
ต้องใช้ Leverage เท่าไหร่? มันเป็นคำถามที่ดูเหมือนง่าย แต่ตอบยาก
วิธีคำนวณ Leverage ที่เหมาะสม ใช้สมการคือ
Levarage = การขาดทุนที่ยอมรับได้ / (ระยะห่างระหว่าง Entry Price และ Stop Loss + (ค่าธรรมเนียมซื้อ + ค่าธรรมเนียมขาย))
นำผลลัพท์ Leverage ที่ได้มาคำนวณเพื่อหาจุด Stop Loss ที่ถูกต้อง (จุดของ Stop Loss จะมีการยืดขยายออกไปเล็กน้อย) โดยใช้สมการ
ตำแหน่ง Stop Loss ใหม่ = Entry Price * (1 - การขาดทุนที่ยอมรับได้ / (Leverage ที่คำนวณได้ * 100)) // สำหรับ Long
ตำแหน่ง Stop Loss ใหม่ = Entry Price * (1 + การขาดทุนที่ยอมรับได้ / (Leverage ที่คำนวณได้ * 100)) // สำหรับ Short
นำผลลัพท์ Leverage ที่ได้มาคำนวณเพื่อหาจุด Take Profit ที่ถูกต้อง (จุดของ Take Profit จะมีการยืดขยายออกไปเล็กน้อย) โดยใช้สมการ
ตำแหน่ง Take Profit = Entry Price * (1 + (การขาดทุนที่ยอมรับได้ / (Leverage ที่คำนวณได้ * 100) * RR) + ((ค่าธรรมเนียมซื้อ + ค่าธรรมเนียมขาย) / 100)) // สำหรับ Long
ตำแหน่ง Take Profit = Entry Price * (1 - (การขาดทุนที่ยอมรับได้ / (Leverage ที่คำนวณได้ * 100) * RR) + ((ค่าธรรมเนียมซื้อ + ค่าธรรมเนียมขาย) / 100)) // สำหรับ Short
ข้อดีของการคำนวณคือ
1. คุณจะได้ค่า Leverage ที่เหมาะสมกับความเสี่ยงที่คุณยอมรับได้โดยรวมค่าธรรมเนียมเข้าไปในนั้นแล้ว นั่นหมายความว่า ความสูญเสียจะเป็น 2% (ตามตัวอย่าง) จริง ๆ ไม่ใช่ 2% และถูกหักค่าธรรมเนียมเพิ่มอีก กลายเป็นสูญเสียมากกว่า 2%
2. การตั้ง Leverage มั่ว ๆ กลายเป็นความเสี่ยง นั่นเพราะตำแหน่งของ Stop Loss ไม่ได้อยู่ในจุดที่ควรจะเป็น การคำนวณนี้ช่วยให้คุณได้ Leverage ในตำแหน่ง Stop Loss ที่คุณต้องการโดยแท้จริง
3. ผลกำไรที่ได้รับตรงกับความต้องการจริง ๆ เช่น การขาดทุนที่ยอมรับได้ 2% และ RR 1:2 สิ่งที่คุณคิดคือกำไร 4% แต่จริง ๆ แล้วไม่ถึง 4% นั่นเพราะว่าโดนหักค่าธรรมเนียมไปส่วนหนึ่ง การคำนวณนี้ได้รวมค่าธรรมเนียมให้แล้ว คุณจึงได้กำไรที่ 4% อย่างถูกต้องตามต้องการ
ข้อควรระวัง
Indicator นี้ไม่ได้มีการควบคุมความเสี่ยงในเรื่องของ slippage หรือ requote โปรดใช้งานอย่างระมัดระวังและมีการเผื่อระยะสำหรับ slippage ด้วย
ATR-Based Suitability CheckerPurpose:
This indicator helps traders identify the most suitable timeframe for trading by comparing fees to market volatility (ATR). Instead of filtering out specific assets or strategies, it focuses on finding optimal trading conditions for the selected timeframe. It is designed to adapt dynamically, ensuring that traders can align their approach with the current market environment.
Key Features:
Dynamic ATR Analysis: Measures volatility using the Average True Range (ATR) and evaluates how fees impact potential profitability across timeframes.
Fee-to-ATR Ratio: Calculates the proportion of fees to ATR, highlighting conditions where fees are too large relative to price movements.
Visual Feedback: **Red Background:** Indicates unsuitable trading conditions where fees dominate. **Green Background:** Highlights suitable conditions for trading efficiency. Markers provide quick visual identification of suitability.
Custom Transparency: Enables users to adjust the background’s transparency for better chart visibility.
How to Use:
Timeframe Optimization: When volatility rises, price movements become larger, making shorter timeframes more suitable for trading. Conversely, during periods of low volatility, longer timeframes are preferable to avoid overtrading within a narrow price range.
Spot & Leverage Trading: For spot trading, this tool identifies conditions where fees (e.g., 0.25%-0.3%) might excessively impact profitability. For instance, if ATR is comparable to fees, the trading environment may not be ideal. In leveraged trading, the indicator helps assess whether the current volatility supports your chosen leverage level, ensuring that leverage does not amplify undue risks.
Efficiency Focus: The indicator emphasizes finding a balance between market conditions and your trading strategy. Not all timeframes need to be "suitable" at all times; instead, it highlights the best opportunities based on current market dynamics. Utilize the suitability ratio across different timeframes to guide and adjust your trading strategies effectively.
Input Parameters:
ATR Length: Defines the period for ATR calculation (default: 14).
Fee Percentage (%): Trading fee as a percentage of the closing price (default: 0.1%).
Unsuitable Threshold (% of 1 ATR): Sets the maximum acceptable fee-to-ATR ratio for suitable conditions (default: 20%).
Background Transparency (0-100): Adjusts the opacity of the background highlight (default: 80).
Who Should Use This:
This tool is ideal for traders seeking to align their strategy with market conditions by finding the most suitable timeframe. It applies to both spot and leveraged markets, helping optimize efficiency while managing fees and volatility.
Notes:
The ATR-Based Suitability Checker is a supplementary tool. Combine it with other forms of analysis for comprehensive decision-making.
Regularly adjust the parameters to match your trading preferences and market conditions.
Consistency Rule CalculatorThis script, titled "Consistency Rule Calculator" is designed for use on the TradingView platform. It allows traders to input specific values related to their account, daily highest profit, and a consistency rule (as a decimal).
The script then calculates the "Amount Needed to Withdraw" based on the user's input. This value is calculated using the formula:
Amount Needed to Withdraw = (Daily Highest Profit/Consistency Rule )+ Account Type
Each prop firm has its own consistency rule. Follow their rule, and you will be second to payout!
Additionally, it displays the input values and the calculated amount in a customizable table on the chart. The table is formatted with colors for clarity, and it provides a motivational quote about successful trading. Plus, user can adjust the table's position on the screen.
Bear Market LevelMarks the bear market level. Calculated as 20% drop from highs. Useful on indices to determine technical Bull or Bear markets.
BTC vs Mag7 Combined IndexThis Mag7 Combined Index script is a custom TradingView indicator that calculates and visualizes the collective performance of the Magnificent 7 (Mag7) stocks—Apple, Microsoft, Alphabet, Amazon, NVIDIA, Tesla, and Meta (red line) compared to Bitcoin (blue line). It normalizes the daily closing prices of each stock to their initial value on the chart, scales them into percentages, and then computes their simple average to form a combined index. The result is plotted as a single red line, offering a clear view of the aggregated performance of these influential stocks over time compared to Bitcoin.
This indicator is ideal for analyzing the overall market impact of Bitcoin compared to the Mag7 stocks.
Simple Average Price & Target ProfitThis script is designed to help users calculate and visualize the weighted average price of an asset based on multiple entry points, along with the target price and the potential profit. The user can input specific prices for three different entries, along with the percentage of total investment allocated to each price point. The script then calculates the weighted average price based on these entries and displays it on the chart. Additionally, it calculates the potential profit at a given target price, which is plotted on the chart.
Market Regime DetectorMarket Regime Detector
The Market Regime Detector is a tool designed to help traders identify and adapt to the prevailing market environment by analyzing price action in relation to key macro timeframe levels. This indicator categorizes the market into distinct regimes—Bullish, Bearish, or Reverting—providing actionable insights to set trading expectations, manage volatility, and align strategies with broader market conditions.
What is a Market Regime?
A market regime refers to the overarching state or condition of the market at a given time. Understanding the market regime is critical for traders as it determines the most effective trading approach. The three main regimes are:
Bullish Regime:
Characterized by upward momentum where prices are consistently trending higher.
Trading strategies often focus on buying opportunities and trend-following setups.
Bearish Regime:
Defined by downward price pressure and declining trends.
Traders typically look for selling opportunities or adopt risk-off strategies.
Reverting Regime:
Represents a consolidation phase where prices move within a defined range.
Ideal for mean-reversion strategies or range-bound trading setups.
Key Features of the Market Regime Detector:
Dynamic Market Regime Detection:
Identifies the market regime based on macro timeframe high and low levels (e.g., weekly or monthly).
Provides clear and actionable insights for each regime to align trading strategies.
Visual Context for Price Levels:
Plots the macro high and low levels on the chart, allowing traders to visualize critical support and resistance zones.
Enhances understanding of volatility and trend boundaries.
Regime Transition Alerts:
Sends alerts only when the market transitions into a new regime, ensuring traders are notified of meaningful changes without redundant signals.
Alert messages include clear regime descriptions, such as "Market entered a Bullish Regime: Price is above the macro high."
Customizable Visualization:
Background colors dynamically adjust to the current regime:
Blue for Reverting.
Aqua for Bullish.
Fuchsia for Bearish.
Option to toggle high/low line plotting and background highlights for a tailored experience.
Volatility and Expectation Management:
Offers insights into market volatility by showing when price action approaches, exceeds, or reverts within macro timeframe levels.
Helps traders set realistic expectations and adjust their strategies accordingly.
Use Cases:
Trend Traders: Identify bullish or bearish regimes to capture sustained price movements.
Range Traders: Leverage reverting regimes to trade between defined support and resistance zones.
Risk Managers: Use macro high and low levels as dynamic stop-loss or take-profit zones to optimize trade management.
The Market Regime Detector equips traders with a deeper understanding of the market environment, making it an essential tool for informed decision-making and strategic planning. Whether you're trading trends, ranges, or managing risk, this indicator provides the clarity and insights needed to navigate any market condition.
Dynamic Risk-Adjusted Performance Ratios with TableWith this indicator, you have everything you need to monitor and compare the Sharpe ratio, Sortino ratio, and Omega ratio across multiple assets—all in one place. This tool is designed to help save time and improve efficiency by letting you track up to 15 assets simultaneously in a fully customizable table. You can adjust the lookback period to fit your trading strategy and get a clearer picture of how your assets perform over time. Instead of switching between charts, this indicator puts all the critical information you need at your fingertips.
Sharpe Ratio -
Helps evaluate the overall efficiency of investments by comparing the average return to the total risk (measured by the standard deviation of all returns). Essentially, it tells you how much excess return you’re getting for each unit of risk you’re taking. A higher Sharpe ratio means you’re getting better risk-adjusted performance—something you’ll want to aim for in your portfolio.
Sortino Ratio -
Goes a step further by focusing only on downside risk—because let’s face it, no one worries about positive volatility. This ratio is calculated by dividing the average return by the standard deviation of only the negative returns. Perfect for those concerned about avoiding losses rather than chasing extreme gains. It gives you a sharper view of how well your assets are performing relative to the risks you’re trying to avoid.
Omega Ratio -
Offers a unique perspective by comparing the sum of positive returns to the absolute sum of negative returns. It’s a straightforward way to see if your wins outweigh your losses. A higher Omega ratio means your positive returns significantly exceed the downside, which is exactly what you want when building a strong, reliable portfolio.
This indicator is perfect for traders who want to streamline their decision-making process and gain an edge. Bringing together these three critical ratios into a single user-defined table makes it easy to compare and rank assets at a glance. Whether optimizing a portfolio or looking for the best opportunities, this tool helps you stay ahead by focusing on risk-adjusted returns. The customizable lookback period lets you tailor the analysis to fit your unique trading approach, giving you insights that align with your goals. If you’re serious about making data-driven decisions and improving your trading outcomes, this indicator is a game-changer for your toolkit.
HMA Buy Sell Signals - Profit ManagerNote : Settings should be adjusted according to the selected time frame. Try to find the best setting according to the profitability rate
Overall Functionality
This script combines several trading tools to create a comprehensive system for trend analysis, trade execution, and performance tracking. Users can identify market trends using specific moving averages and RSI indicators while managing profit and loss levels automatically.
Trend Detection and Trade Signals
Hull Moving Averages (HMA):
Two HMAs (a faster one and a slower one) are used to determine the market trend.
A buy signal is generated when the faster HMA crosses above the slower HMA.
Conversely, a sell signal is triggered when the faster HMA crosses below the slower one.
Visual Feedback:
Trend lines on the chart change color to reflect the trend direction (e.g., green for upward trends and red for downward trends).
Trade Levels and Management
Entry, Take-Profit, and Stop-Loss Levels:
When the trend shifts upwards, the script calculates entry, take-profit, and stop-loss levels based on the opening price.
Similarly, for downward trends, these levels are determined for short trades.
Commission Tracking:
Each trade includes a commission cost, which is factored into net profit and loss calculations.
Dynamic Labels:
Entry, take-profit, and stop-loss levels are visually marked on the chart for easier tracking.
Performance Tracking
Profit and Loss Tracking:
The script keeps a running total of profits, losses, and commissions for both long and short trades.
It also calculates the net profit after all costs are considered.
Performance Table:
A table is displayed on the chart summarizing:
The number of trades.
Total profit and loss for long and short positions.
Commission costs.
Net profit.
Fractal Support and Resistance
Dynamic Lines:
The script identifies the most recent significant highs and lows using fractals.
It draws support and resistance lines that automatically update as new fractals form.
Simplified Visuals:
The chart always shows the last two support and resistance lines, keeping the visualization clean and focused.
RSI-Based Signals
Overbought and Oversold Levels:
RSI is used to identify overbought (above 80) and oversold (below 20) conditions.
The script generates buy signals at oversold levels and sell signals at overbought levels.
Chart Indicators:
Arrows and labels appear on the chart to highlight these RSI-based opportunities.
Customization
The script allows users to customize key parameters such as:
Moving average lengths for trend detection.
Take-profit and stop-loss percentages.
Timeframes for backtesting.
Starting capital and commission rates.
Conclusion
This script is a versatile tool for traders, combining trend detection, automated trade management, and visual feedback. It simplifies decision-making by providing clear signals and tracking performance metrics, making it suitable for both beginners and experienced traders.
* The most recently drawn fractals represent potential support and resistance levels. If the price aligns with these levels at the time of entering a trade, it may indicate a likelihood of reversal. In such cases, it’s advisable to either avoid entering the trade altogether or proceed with increased caution.