Smart % Levels📈 Smart % Levels – Visualize Significant Percentage Moves
What it does:
This indicator plots horizontal levels based on a percentage change from the previous day's close (or open, if selected). It allows traders to visualize price movements relative to meaningful thresholds like ±1%, ±2%, etc.
What makes it different:
Unlike other level indicators, Smart % Levels only displays the relevant levels based on current price action. This avoids clutter by showing only the levels that are being approached or crossed by the current price. It's a clean and dynamic way to visualize key price zones for intraday analysis.
How it works:
- Select between using the previous day's Close or Open as the reference
- Choose the percentage spacing between levels (e.g., 1%, 0.5%, etc.)
- Enable optional labels to see the exact percentage of each level
- Automatically filters levels to only show those between yesterday's price and today's current price
- Includes customization for colors, line styles, widths, and opacity
Best for:
Day traders and scalpers who want a quick, clean view of how far the current price has moved from yesterday’s reference, without being overwhelmed by unnecessary lines.
Extra notes:
- The levels are recalculated each day at the market open
- All graphics reset at the start of each session to maintain clarity
- This script avoids repainting by only plotting levels relative to available historical data (no lookahead)
This tool is for informational purposes only and should not be considered as financial advice. Always do your own research before making trading decisions.
Portfolio management
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!
Cartera SuperTrends v4 PublicDescription
This script creates a screener with a list of ETFs ordered by their average ROC in three different periods representing 4, 6 and 8 months by default. The ETF
BIL
is always included as a reference.
The previous average ROC value shows the calculation using the closing price from last month.
The current average ROC value shows the calculation using the current price.
The previous average column background color represents if the ETF average ROC is positive or negative.
The current average column background color represents if the ETF average ROC is positive or negative.
The current average column letters color represents if the current ETF average ROC is improving or not from the previous month.
Changes from V2 to V3
Added the option to make the calculation monthly, weekly or daily
Changes from V3 to V4
Adding up to 25 symbols
Highlight the number of tickers selected
Highlight the sorted column
Complete refactor of the code using a matrix of arrays
Options
The options available are:
Make the calculation monthly, weekly or daily
Adjust Data for Dividends
Manual calculation instead of using ta.roc function
Sort table
Sort table by the previous average ROC or the current average ROC
Number of tickers selected to highlight
First Period in months, weeks or days
Second Period in months, weeks or days
Third Period in months, weeks or days
Select the assets (max 25)
Usage
Just add the indicator to your favorite indicators and then add it to your chart.
Trading Capital Management for Option SellingTrading Capital Management for Option Selling
This Pine Script indicator helps manage trading capital allocation for option selling strategies based on price percentile ranking. It provides dynamic allocation recommendations for index options (NIFTY and BANKNIFTY) and individual stock positions.
Key Features:
- Dynamic buying power (BP) allocation based on close price percentile
- Flexible index allocation between NIFTY and BANKNIFTY
- Automated calculation of recommended number of stock positions
- Risk management through position size limits
- Real-time INDIA VIX monitoring
Main Parameters:
1. Window Length: Period for percentile calculation (default: 252 days)
2. Thresholds: Low (30%) and High (70%) percentile thresholds
3. Capital Settings:
- Trading Capital: Total capital available
- Max BP% per Stock: Maximum allocation per stock position
4. Buying Power Range:
- Low Percentile BP%: Base BP usage at low percentile
- High Percentile BP%: Maximum BP usage at high percentile
5. Index Allocation:
- NIFTY/BANKNIFTY split ratio
- Minimum and maximum allocation thresholds
Display:
The indicator shows two tables:
1. Common Metrics:
- Total BP Usage with percentage
- Current INDIA VIX value
- Current Close Price Percentile
2. Capital Allocation:
- Index-wise BP allocation (NIFTY and BANKNIFTY)
- Stock allocation pool
- Recommended number of stock positions with BP per stock
Usage:
This indicator helps traders:
1. Scale positions based on market conditions using price percentile
2. Maintain balanced exposure between indices and stocks
3. Optimize capital utilization while managing risk
4. Adjust position sizing dynamically with market volatility
Killzones (Box Style, Custom Colors) - NY TimeThis indicator visually highlights the 3 main trading sessions ("killzones") — Asia, London, and New York — on any intraday chart using box overlays that automatically adjust to price action and time, locked to America/New_York timezone.
📅 Killzones Defined:
Killzone NY Time Purpose
Asia Session 7:00 PM – 10:00 PM (Previous Day) Preps for overnight moves, often shows low volatility or accumulation
London Session 2:00 AM – 5:00 AM Often sets the daily high/low, high volatility
NY Session 7:00 AM – 10:00 AM Big volume from US open, news events, major moves
Each killzone is shown with a colored box that:
Begins at the exact killzone open time
Ends at the killzone close
Expands vertically to encompass all highs and lows that occur within the session
All Forex Sessions (SAST Accurate) + LabelsFor traders in South Africa
Uses timestamp("Africa/Johannesburg", ...) — this locks the session window to true SAST time
The session now perfectly aligns from 14:00 to 18:00 local time no matter what time zone your TradingView chart is in
Also shows start and end vertical lines only when the session opens and closes
EM 5Y Gov. Bond YieldThis indicator calculates and displays the weighted average of 5-year government bond yields from various emerging market (EM) countries. The weighting is based on each country’s government bond market size, ensuring that larger bond markets have a more significant influence on the final yield.
ATR Stop BufferThis will show you the daily Average True Range in ticks and then will show you 2% and 10% of the daily ATR rounded up. This is to use for your stop buffer beyond your buy or sell zone.
Kelly Weight with Custom Win RateFor Tony outlining Kelly Weight formula lllllllllllllllllllllllllllllllllll
Minimalist Trading Plan ChecklistMinimalist Trading Plan Checklist
A clean, customizable indicator to monitor your trading plan.
Features:
Checklist: Monitor bias, narrative, context, entry.
Timeframes: Set or leave blank (❌).
Risk-Reward Ratio: Display in a neat box.
News Checkbox: Toggle for high-impact events.
Customizable: Adjust colors and layout.
Stay organized and focused on your strategy with this minimalist tool.
Short and sweet! Let me know if you need further tweaks. 😊
Avg.ROC TableThis indicator calculates the average Rate of Change (ROC) for up to 30 user-selected assets over a specified number of candles. It then ranks the assets—assigning rank 1 to the asset with the highest average ROC (strongest momentum) and rank 30 to the asset with the lowest. The results are displayed in a clean, easy-to-read table split into two stacks of 15 assets each, allowing you to quickly see which assets are performing best.
Binance Leveraged Liquidations ApproximationBinance Leveraged Liquidations Approximation (BLLA)
The Binance Leveraged Liquidations Approximation (BLLA) indicator is a tool designed to estimate liquidation levels for leveraged trading on Binance. It calculates the approximate prices at which liquidations could occur for long and short positions, based on the entry price and leverage levels selected by the user.
Key Features:
Liquidation Level Calculation:
Estimates liquidation prices for multiple leverage levels (e.g., 20x, 10x, 5x, etc.).
Supports both long and short positions.
Customization:
Allows the user to manually input the entry price or automatically calculate it as the midpoint between the low and high of a defined period.
Leverage levels are configurable, enabling the indicator to adapt to different trading strategies.
Clear Visualization:
Displays liquidation levels directly on the chart, with labels indicating the corresponding leverage.
Uses distinct colors for long positions (yellow) and short positions (blue).
Recommended Use:
Risk Management: Helps identify liquidation levels to adjust stop-loss orders and manage risk in leveraged trading.
Market Analysis: Provides a quick overview of key levels where significant price movements might occur due to mass liquidations.
Settings:
Entry Price: Enter manually or leave at 0.0 to calculate automatically.
Leverage: Configure desired leverage levels (e.g., 20x, 10x, 5x, etc.).
Transparency and Display: Adjust the transparency of the lines and the number of bars displayed.
Quick Instructions:
Add the indicator to your chart.
Enter the entry price or leave it at 0.0 to calculate automatically.
Configure leverage levels according to your strategy.
Observe liquidation levels on the chart and use them to manage your risk.
Note:
This indicator is an approximation and does not guarantee absolute accuracy of liquidation levels, as these may vary depending on market conditions and exchange policies.
The Investment Clock Orbital GraphThe Investment Clock Orbital Graph is an advanced visualization tool designed to help traders and investors track economic cycles using a dynamic scatter plot of GDP growth vs. CPI inflation rates.
This indicator is a fusion of two powerful TradingView indicators:
LuxAlgo ’s Relative Strength Scatter Plot – A robust scatter plot for tracking relative strength.
The Investment Clock Indicator – A cycle-based approach to market rotation. This indicator contains more information regarding The Investment Clock.
By combining these approaches, the Investment Clock Orbital Graph enables traders to visualize economic momentum and inflationary trends in a unique, orbital-style scatter plot.
Key Features & Improvements
Orbital Graph Representation – Displays GDP growth and CPI inflation as a dynamic, evolving scatter plot, showing how the economy moves through different phases.
Quadrant-Based Market Regimes – Identifies four key economic phases:
1)🔥 Overheating (High Growth, High Inflation)
2)📉 Stagflation (Low Growth, High Inflation)
3)🤒 Recovery (High Growth, Low Inflation)
4)🎈 Reflation (Low Growth, Low Inflation)
Data-Driven Analysis – Utilizes FRED (Federal Reserve Economic Data) for accurate real-world GDP & CPI data.
Trailing Path of Economic Evolution – Tracks historical economic cycles over time to show momentum and cyclical movements.
Customizable Parameters – Set sustainable GDP growth and inflation thresholds, adjust trail length, and fine-tune scatter plot resolution.
Auto-Labeled Quadrants & Revised Accurate Market Guidance – Each quadrant includes newly updated tooltips and annotations (like ETF suggestions) to help traders make informed decisions.
Live Macro Forecasting Tool – Helps traders anticipate future market conditions, rate hikes/cuts, and sector rotations.
How to Use for Trading Decisions
The Investment Clock Orbital Graph helps traders and macro investors by identifying market phases and providing insights into asset class performance during different economic conditions.
📌 Step 1: Identify the Current Quadrant
Locate the most recent point on the orbital graph to see if the economy is in Overheating, Stagflation, Recovery, or Reflation.
📌 Step 2: Forecast Market Trends
The trajectory of the points can predict upcoming economic shifts:
Overheating → Stagflation ➡️ Expect economic slowdowns, bearish stock markets.
Stagflation → Reflation ➡️ Interest rate cuts likely, bonds and defensive stocks perform well.
Reflation → Recovery ➡️ Risk-on rally, technology and cyclicals perform best.
Recovery → Overheating ➡️ Commodities surge, inflation rises, and central banks intervene.
📌 Step 3: Align Trading & Investing Strategies
🔥 Overheating – Favor commodities & energy (Oil, Industrial Stocks, Materials).
📉 Stagflation – Favor defensive assets (Cash, Utilities, Healthcare).
🤒 Recovery – Favor growth stocks (Technology, Consumer Discretionary).
🎈 Reflation – Favor bonds, value stocks, and financials.
📌 Step 4: Monitor Trends Over Time
The indicator visualizes economic movement over multiple months, allowing traders to confirm long-term trends vs. short-term noise.
The Investment Clock Orbital Graph is an essential macro trading tool, providing a real-time visualization of economic conditions. By tracking GDP growth vs. CPI inflation, traders and investors can align their portfolios with major macroeconomic shifts, predict sector rotations, and anticipate central bank policy changes.
CAPM Alpha & BetaThe CAPM Alpha & Beta indicator is a crucial tool in finance and investment analysis derived from the Capital Asset Pricing Model (CAPM) . It provides insights into an asset's risk-adjusted performance (Alpha) and its relationship to broader market movements (Beta). Here’s a breakdown:
1. How Does It Work?
Alpha:
Definition: Alpha measures the portion of an investment's return that is not explained by market movements, i.e., the excess return over and above what the market is expected to deliver.
Purpose: It represents the value a fund manager or strategy adds (or subtracts) from an investment’s performance, adjusting for market risk.
Calculation:
Alpha is derived from comparing actual returns to expected returns predicted by CAPM:
Alpha = Actual Return − (Risk-Free Rate + β × (Market Return − Risk-Free Rate))
Alpha = Actual Return − (Risk-Free Rate + β × (Market Return − Risk-Free Rate))
Interpretation:
Positive Alpha: The investment outperformed its CAPM prediction (good performance for additional value/risk).
Negative Alpha: The investment underperformed its CAPM prediction.
Beta:
Definition: Beta measures the sensitivity of an asset's returns relative to the overall market's returns. It quantifies systematic risk.
Purpose: Indicates how volatile or correlated an investment is relative to the market benchmark (e.g., S&P 500).
Calculation:
Beta is computed as the ratio of the covariance of the asset and market returns to the variance of the market returns:
β = Covariance (Asset Return, Market Return) / Variance (Market Return)
β = Variance (Market Return) Covariance (Asset Return, Market Return)
Interpretation:
Beta = 1: The asset’s price moves in line with the market.
Beta > 1: The asset is more volatile than the market (higher risk/higher potential reward).
Beta < 1: The asset is less volatile than the market (lower risk/lower reward).
Beta < 0: The asset moves inversely to the market.
2. How to Use It?
Using Alpha:
Portfolio Evaluation: Investors use Alpha to gauge whether a portfolio manager or a strategy has successfully outperformed the market on a risk-adjusted basis.
If Alpha is consistently positive, the portfolio may deliver higher-than-expected returns for the given level of risk.
Stock/Asset Selection: Compare Alpha across multiple securities. Positive Alpha signals that the asset may be a good addition to your portfolio for excess returns.
Adjusting Investment Strategy: If Alpha is negative, reassess the asset's role in the portfolio and refine strategies.
Using Beta:
Risk Management:
A high Beta (e.g., 1.5) indicates higher sensitivity to market movements. Use such assets if you want to take on more risk during bullish market phases or expect higher returns.
A low Beta (e.g., 0.7) indicates stability and is useful in diversifying risk in volatile or bearish markets.
Portfolio Diversification: Combine assets with varying Betas to achieve the desired level of market responsiveness and smooth out portfolio volatility.
Monitoring Systematic Risk: Beta helps identify whether an investment aligns with your risk tolerance. For example, high-Beta stocks may not be suitable for conservative investors.
Practical Application:
Use both Alpha and Beta together:
Assess performance with Alpha (excess returns).
Assess risk exposure with Beta (market sensitivity).
Example: A stock with a Beta of 1.2 and a highly positive Alpha might suggest a solid performer that is slightly more volatile than the market, making it a suitable pick for risk-tolerant, return-maximizing investors.
In conclusion, the CAPM Alpha & Beta indicator gives a comprehensive view of an asset's performance and risk. Alpha enables performance evaluation on a risk-adjusted basis, while Beta reveals the level of market risk. Together, they help investors make informed decisions, build optimal portfolios, and align investments with their risk-return preferences.
Nifty/Gold RatioPrice of NIFTY in GOLD. Highs indicate that Gold is getting cheaper, Lows indicate Nifty is getting cheaper.
Average Daily LiquidityIt is important to ensure sufficient stock trading liquidity so that you have sufficient volume to enter the trade and most importantly sufficient liquidity to exit the trade. Because daily trading liquidity can jump around so much by price changes and volume changes, it is important to smooth out the liquidity by using a moving average. Some use a 5 days (trading week) moving average, others use 10 day (2 weeks), 20 day ("month") and some use 65 day (quarter). The default is 10 days based upon the work of Colin Nicholson (The Aggressive Investor and Building Wealth in the Stock Market). Liquidity line changes color dependent upon the chart background luminescence. The amount you are planning to invest in a stock should have a liquidity of 10 (default) times that amount.
PnL MonitorThe PnL Monitor is a customizable tool designed to help traders track the Profit and Loss (PnL) of up to 20 currency pairs or assets in real-time. This script provides a clear and organized table that displays the entry price, and PnL percentage for each pair, making it an essential tool for monitoring open positions or tracking potential trades.
Key Features:
Multi-Asset Tracking:
Monitor up to 20 currency pairs or assets simultaneously. Simply input the pair symbol and your entry price, and the script will calculate the PnL in real-time.
Dynamic Table Positioning:
Choose where the table appears on your chart with the Table Position input. Options include:
Top Left
Top Right
Bottom Left
Bottom Right
Real-Time PnL Calculation:
The script fetches the current price of each pair and calculates the PnL percentage based on your entry price. Positive PnL is highlighted in green, while negative PnL is highlighted in red.
Exchange and Pair Separation:
The script automatically separates the exchange name (if provided) from the pair symbol, making it easier to identify the source of the data.
Customizable Inputs:
Add or remove pairs as needed.
Leave the price field blank for pairs you don’t want to track.
How to Use:
Input Your Pairs:
In the script settings, input the symbol of the pair (e.g., NASDAQ:AAPL or BTCUSD) and your entry price. Leave the price field blank for pairs you don’t want to track.
Choose Table Position:
Select where you want the table to appear on your chart.
Monitor PnL:
The table will automatically update with the current price and PnL percentage for each pair.
Why Use This Script?
Efficiency: Track multiple pairs in one place without switching charts.
Clarity: Easily identify profitable and losing positions at a glance.
Flexibility: Customize the table to fit your trading style and preferences.
Ideal For:
Forex, crypto, and stock traders managing multiple positions.
Multi Asset Similarity MatrixProvides a unique and visually stunning way to analyze the similarity between various stock market indices. This script uses a range of mathematical measures to calculate the correlation between different assets, such as indices, forex, crypto, etc..
Key Features:
Similarity Measures: The script offers a range of similarity measures to choose from, including SSD (Sum of Squared Differences), Euclidean Distance, Manhattan Distance, Minkowski Distance, Chebyshev Distance, Correlation Coefficient, Cosine Similarity, Camberra Index, Mean Absolute Error (MAE), Mean Squared Error (MSE), Lorentzian Function, Intersection, and Penrose Shape.
Asset Selection: Users can select the assets they want to analyze by entering a comma-separated list of tickers in the "Asset List" input field.
Color Gradient: The script uses a color gradient to represent the similarity values between each pair of indices, with red indicating low similarity and blue indicating high similarity.
How it Works:
The script calculates the source method (Returns or Volume Modified Returns) for each index using the sec function.
It then creates a matrix to hold the current values of each index over a specified window size (default is 10).
For each pair of indices, it applies the selected similarity measure using the select function and stores the result in a separate matrix.
The script calculates the maximum and minimum values of the similarity matrix to normalize the color gradient.
Finally, it creates a table with the index names as rows and columns, displaying the similarity values for each pair of indices using the calculated colors.
Visual Insights:
The indicator provides an intuitive way to visualize the relationships between different assets. By analyzing the color-coded tables, traders can gain insights into:
Which assets are highly correlated (blue) or uncorrelated (red)
The strength and direction of these correlations
Potential trading opportunities based on similarities and differences between assets
Overall, MASM is a powerful tool for market analysis and visualization, offering a unique perspective on the relationships between various assets.
~llama3
Asset Allocation CalculatorOverview
This script is a tool that automatically calculates asset allocation for your investment portfolio. Users can set the weight of multiple assets and monitor the portfolio value in real time based on price fluctuations.
Key Features
Supports input of asset allocation percentages
Dynamic allocation calculation based on real-time price data
Automatically calculates allocated amounts for each asset based on the total investment amount
User-friendly interface with intuitive visual feedback
Settings
Total Capital : Enter the total capital, including the value of assets.
Quantity rounding : Using the rounding function may cause the target allocation to exceed 100%.
Tickers, Weight, Holdings :
To retrieve accurate asset prices, specify both the exchange and the ticker.
If you want to include cash in your portfolio, use $.
Ensure that the total allocation sums to 100%.
Refer to the pre-filled example for the correct format.
Table Settings : You can adjust the table's position, height, font size, and background color.
How to Use
By buying or selling the quantity shown in the Buy column, you can continuously maintain your target allocation.
Hold - Current holdings
Buy - Quantity to buy or sell to reach the target allocation
Target - Quantity aimed for after buying or selling
Caution
It can only calculate for a single currency, so do not mix multiple currency markets.
자산 배분 계산기
소개
이 스크립트는 투자 포트폴리오의 자산 배분을 자동으로 계산해주는 도구입니다. 사용자는 여러 자산의 비중을 설정할 수 있으며, 가격 변동에 따라 포트폴리오 가치를 실시간으로 모니터링할 수 있습니다.
주요 기능
자산 배분 비율 입력 지원
실시간 가격 데이터를 기반으로 한 동적 배분 계산
총 투자 금액을 기준으로 각 자산에 할당된 금액 자동 계산
직관적인 시각적 피드백을 제공하는 사용자 친화적인 인터페이스
설정
Total Capital : 자산 가치를 포함한 총 자본금을 입력하세요.
Quantity rounding : 반올림 기능을 사용하면 목표 비중이 100%를 초과할 수 있습니다.
Tickers, Weight, Holdings :
정확한 자산 가격을 불러오기 위해 거래소와 티커를 함께 입력하세요.
포트폴리오에 현금을 포함하려면 '$'를 사용하세요.
비중 합계가 반드시 100%가 되도록 설정하세요.
예제 형식을 참고하여 올바르게 입력하세요.
한국(원화) 시장을 위한 입력 예시입니다.
KRX:360750, 17.5, 100
KRX:310960, 17.5, 120
KRX:148070, 25, 20
KRX:305080, 25, 10
KRX:139320, 10, 150
UPBIT:BTCKRW, 5, 0.002
$,0,5000000
Table Settings : 테이블의 위치, 높이, 글자 크기 및 배경색을 조정할 수 있습니다.
사용 방법
Buy 열에 표시된 수량만큼 매수 또는 매도하면 목표 비중을 지속적으로 유지할 수 있습니다.
Hold - 현재 보유 수량
Buy - 목표 비중을 맞추기 위해 매수 또는 매도해야 하는 수량
Target - 매수, 매도 후 목표로 하는 수량
주의
한 가지 통화로만 계산할 수 있으니 여러 통화 시장을 혼용하지 마세요.
Consecutive Bullish/Bearish Candles🔍 Overview:
This indicator detects market manipulation and deception by identifying sequences of consecutive bullish or bearish candles. It highlights potential reversal zones where trends may exhaust or trap traders before reversing.
📌 How It Works:
The user can set a custom number of consecutive bullish or bearish candles (default: 5).
If the set number of consecutive green (bullish) or red (bearish) candles appears, the indicator plots a signal on the chart.
This pattern often signals exhaustion, stop hunts, or market traps, making it useful for traders looking for reversal opportunities.
📊 Features:
✅ Customizable candle count for detection
✅ Visual signals (✅ for bullish, ❌ for bearish)
✅ Alerts support for automated notifications
✅ Works on all timeframes and all markets (crypto, stocks, forex)
⚠️ Note:
This indicator does not guarantee reversals but helps identify areas where traders may be trapped and a trend shift is likely. Always use it with other confluence factors like volume, support/resistance, and market sentiment.
🚀 Use this tool to spot market deception and trade smart!
The Ultimate Lot Size Calculator Backstory
I created this Pine Script tool to calculate lot sizes with precision. While there are many lot size calculators available on TradingView, I found that most had significant flaws. I started teaching myself Pine Script over three and a half years ago with the sole purpose of building this tool. My first version was messy and lacked accuracy, so I never published it. I wanted it to be better than any other available tool, but my limited knowledge back then held me back.
Recently, I received a request to create a similar tool, as the current options still fail to deliver the precision and reliability traders need. This inspired me to revisit my original idea. With improved skills and a better understanding of Pine Script, I redesigned the tool from scratch, making it as precise, reliable, and efficient as possible.
This tool features built-in error detection to minimize mistakes and ensure accuracy in lot size calculations. I've spent more time on this project than on any other, focusing on delivering a solution that stands out on TradingView. While I plan to add more features based on user feedback, the current version is already a powerful, dependable, and easy-to-use tool for traders who value precision and efficiency in their lot size calculations.
How to use the tool ?
At first it might seem complicated, but it is quite easy to use the tool. There are two modes: auto and manual. By default, the tool is set on manual mode. When you apply the tool on the chart, it will ask you to choose the entry price, then the stop-loss price, and at last the take-profit price. Select all of them one by one. These values can be changed later.
Settings
There are various setting given for making the tool as flexible as possible. Here is the explanation for some of most important settings. Play with them and make yourself comfortable.
General settings
Auto mode : Use this mode if you want the the risk reward to be fixed and stop loss to be based on ATR. However the stop loss can be changed to be based on user input.
Manual mode : Use this mode if you want full control over entry, stop loss and take profit.
Contract Size : The tool works perfectly for all forex pairs including gold and silver but as the contract size is different for different assets it is difficult to add every single asset into the script manually so i have provided this option. In case you want to calculate lot size for a asset other then forex, gold or silver make sure to change this. Contract size = Quantity of the asset in 1 standerd lot.
Account settings
Automatic mode settings and ATR stop settings
Manual mode settings
Table and risk-reward box settings are pretty much self-explanatory i guess.
Error handling
A lot size calculator is a complex program. There are numerous points where it may fail and produce incorrect results. To make it robust and accurate, these issues must be addressed and managed properly, which practically all existing lot size calculator scripts fail to do.
Golden tip
When the symbol is changed it will display a symbol change warning as the entry, stop loss and take profit price won't change.
There are 2 ways to get fix this. Either manually enter all three values which i hate the most or remove the script from the chart and re-apply the script on chart again.
So to re-apply the indicator in most easy way follow the following instructions:
Note : If you encounter any other error then read the instruction to fix it and if it is an unknow error pleas report it to me in comments or DM.
JMA Quantum Edge: Adaptive Precision Trading System JMA Quantum Edge: Adaptive Precision Trading System - Enhanced Visuals & Risk Management
Get ready to experience a groundbreaking trading strategy that adapts in real-time to market conditions! This powerful, open-source script combines advanced technical analysis with state-of-the-art risk management tools, designed to give you the edge you need in today's dynamic markets.
What It Does:
Adaptive JMA Indicator:
Utilizes a custom Jurik Moving Average (JMA) that adjusts its sensitivity based on market volatility, ensuring you get precise signals even in the most fluctuating environments.
Dynamic Risk Management:
Features built-in support for partial exits (scaling out) to secure profits, along with an optional Kelly Criterion-based position sizing that tailors your exposure based on historical performance metrics.
Robust Error Handling:
Incorporates market condition filters—like minimum volume and maximum allowed gap percentage—to ensure trades are only executed under favorable conditions.
Vivid Visual Enhancements:
Enjoy an animated background that reflects market momentum, dynamic pivot markers, and clearly drawn trend channels. Plus, interactive tables provide real-time performance analytics and detailed error metrics.
Fully Customizable:
With a comprehensive set of inputs, you can easily tailor the strategy to your personal trading style and market preferences. Adjust everything from JMA parameters to refresh intervals for tables and labels!
How to Use It:
Add the Script:
Copy and paste the script into the Pine Script Editor on TradingView and click “Add to Chart.”
Configure Your Settings:
Customize your risk management (capital, commission, position sizing, partial exits, etc.) and tweak the JMA settings to match your preferred trading style. Use the extensive input panel to adjust visuals, alerts, and more.
Backtest & Optimize:
Run the strategy in the Strategy Tester to analyze its historical performance. Monitor real-time analytics and error metrics via the interactive tables, and fine-tune your parameters for optimal performance.
Go Live with Confidence:
Once you're satisfied with the backtest results, use the generated signals for live trading, and let the system help you stay ahead in fast-paced markets!
How to use the imputs:
This cutting-edge strategy is designed to adapt to changing market conditions and offers you complete control over your trading parameters. Here’s a breakdown of what each group of inputs does and how you should use them:
Risk Management & Trade Settings
Recalculate on Every Tick:
What it does: When enabled, the strategy recalculates on every price update.
Recommendation: Leave it true for fast charts.
Initial Capital:
What it does: Sets your starting capital for backtesting, which influences position sizing and performance metrics.
Recommendation: Start with $10,000 (or adjust according to your trading capital).
Commission (%):
What it does: Simulates the cost per trade.
Recommendation: Use a realistic rate (e.g., 0.04%).
Position Size & Quantity Type:
What they do: Define how large each trade will be. Choose between a fixed unit amount or a percentage of equity.
Recommendation: For beginners, the default fixed value is a good start. Experiment later with percentage-based sizing if needed.
Order Comment:
What it does: Adds a label to your orders for easier tracking.
Allow Reverse Orders:
What it does: If disabled, the strategy will close opposing positions before entering a new trade, reducing conflicts.
Enable Dynamic Position Sizing:
What it does: Adjusts trade size based on current volatility.
Recommendation: Beginners may start with this disabled until they understand basic sizing.
Partial Exit Inputs:
What they do:
Enable Partial Exits: When turned on, you can scale out of your position to lock in profits.
Partial Exit Profit (%): The profit percentage that triggers a partial exit.
Partial Exit Percentage: The percentage of your current position to exit. Recommendation: Use defaults (e.g., 5% profit, 50% exit) to secure profits gradually.
Kelly Criterion Option:
What it does: When enabled, adjusts your position sizing using historical performance (win rate and profit factor).
Recommendation: Beginners might leave this disabled until comfortable with backtest performance metrics.
Market Condition Filters:
What they do:
Minimum Volume: Ensures trades occur only when there’s sufficient market activity.
Maximum Gap (%): Prevents trading if there’s an unusually large gap between the previous close and current open. Recommendation: Defaults work well for most markets. If trades seem erratic, consider tightening these limits.
JMA Settings
Price Source:
What it does: The input series for the JMA calculation, typically set to the closing price.
JMA Length:
What it does: Controls the smoothing period of the JMA. Lower values are more sensitive; higher values smooth out the noise. Recommendation: Start with 21.
JMA Phase & Power:
What they do: Adjust how responsive the JMA is. Phase controls timing; power adjusts the intensity. Recommendation: Default settings (63 phase and 3 power) are a balanced starting point.
Visual Settings & Style
Show JMA Line, Pivot Lines, and Pivot Labels:
What they do: Toggle visual elements on your chart for easier signal identification.
Pivot History Count:
What it does: Limits how many historical pivot markers are displayed.
Color Settings (Up/Down Neon Colors):
What they do: Set the visual cues for buy and sell signals.
Pivot Marker & Line Style:
What they do: Choose the style and thickness of your pivot markers and lines.
Show Stats Panel:
What it does: Displays real-time performance and error metrics.
Dynamic Background & Visual Enhancements
Animate Background:
What it does: Changes the background color based on market momentum.
Show Trend Channels & Volume Zones:
What they do: Draw trend channels and highlight areas of high volatility/volume.
Show Data-Rich Labels:
What it does: Displays key metrics like volume, error percentage, and momentum on the chart.
High Volatility Threshold:
What it does: Determines the multiplier for when the chart background should change due to high volatility.
Multi-Timeframe Settings
Higher Timeframe:
What it does: Uses a higher timeframe’s JMA for trend confirmation. Recommendation: Use Daily ('D') or Weekly ('W') for broader trend analysis.
Show HTF Trend Zone & Opacity:
What they do: Display a visual zone from the higher timeframe to help confirm trends.
6. Trailing Stop Settings
Trailing Stop ATR Factor & Offset Multiplier:
What they do: Calculate trailing stops based on the Average True Range (ATR), adjusting stop distances dynamically. Recommendation: Default settings are a good balance but can be fine-tuned based on asset volatility.
Alerts & Notifications
Alerts on Pivot Formation & JMA Crossover:
What they do: Notify you when key events occur.
Dynamic Power Threshold:
What it does: Sets the sensitivity for dynamic alerts.
8. Static Stop Loss / Take Profit
Static Stop Loss (%) & Take Profit (%):
What they do: Allow you to set fixed stop loss or take profit levels. Recommendation: Leave them at 0 to disable if you prefer dynamic risk management, or set them if you have strict risk/reward preferences.
Advanced Settings
ATR Length:
What it does: Determines the period for ATR calculation, impacting trailing stop sensitivity. Recommendation: Start with 14.
Optimization Feedback & Enhanced Error Analysis
Error Metric Length & Error Threshold (%):
What they do: Calculate error metrics (like average error, skewness, and kurtosis) to help you fine-tune the JMA. Recommendation: Use the defaults and adjust if the error metrics seem off during backtesting.
UI - User-Driven Tweaking & Table Customization
Parameter Tweaker Panel, Debug/Performance Table Settings:
What they do: Provide interactive tables that display real-time performance, error metrics, and allow you to monitor strategy parameters.
Refresh Frequency Options (Table & Label Refresh Intervals):
What they do: Set how often the tables and labels update.
Recommendation: Start with an interval of 1 bar; increase it if your chart is too busy.
Important for Beginners:
Default Settings:
All default values have been chosen for balanced performance across different markets. If you ever experience unexpected behavior, start by resetting the inputs to their defaults.
Step-by-Step Adjustments:
Experiment by changing one setting at a time while observing how the strategy’s signals and performance metrics change. This will help you understand the impact of each parameter.
Resetting to Defaults:
If things seem off or you’re not getting the expected results, you can always reset the indicator. Either reload the script or use the “Reset Inputs” option (if available) to revert to the default settings.
Jump in, experiment, and enjoy the power of adaptive precision trading. This strategy is built to grow with your skills—have fun exploring and refining your trading edge!
Happy trading!