ATR Stoploss Finder (multiple lines)This is adapted from the ATR Stoploss Finder by veryfid. I've simply added the option for displaying different multiples of the ATR on the chart simultaneously. This can be useful for quickly identifying various take profit and stoploss points using different multiples of the ATR without having to change indicator settings every time.
Riskmanagment
Profit & Risk CalculatorThe "Profit & Risk Calculator" script in Pine Script (TradingView) is designed to help users calculate potential profit and risk when trading, and to provide alerts when specific price levels are reached (such as entry price, take profit, or stop loss). It includes several components as described below:
1. Input Fields:
The user can manually input various prices: entry price, stop loss price, and take profit price, with steps of 0.25.
There is also an option to input a custom value (e.g., for personal lot sizing) and a total investment amount.
2. Dynamic Lines:
The script draws dynamic horizontal lines for the input prices: entry line (white), stop loss line (red), and take profit line (green).
These lines are automatically updated based on the entered price levels.
3. Labels for the Lines:
Labels are added to the lines to visually indicate the entry, stop loss, and take profit levels on the chart.
4. Long and Short Position Calculations:
The script calculates potential profit and loss for both long (profit if the price goes up) and short (profit if the price goes down) positions.
It also calculates the distance between entry and take profit, and distance between entry and stop loss, along with the risk/reward ratio (RR).
5. Alerts:
The script generates alerts when one of the following conditions is met:
Entry Condition: The price touches or exceeds the entry price (high >= entryPrice).
Stop Loss Condition: The price touches or drops below the stop loss price (low <= stopLossPrice).
Take Profit Condition: The price touches or exceeds the take profit price (high >= takeProfitPrice).
6. Lot Calculations:
The script calculates both micro and mini lot sizes based on a preset table and the custom value.
The results are displayed in a table on the chart.
7. Profit/Risk Table:
The script shows two tables:
One table calculates the profit, loss, and risk/reward ratio based on the input entry price.
A second table shows the same calculations based on the current price.
8. Chart Display:
The script places tables and other visual data on the chart, such as preset values, profit and loss calculations, and the distance from take profit and stop loss to the entry price.
English Explanation of Each Part of the Script
1. Input Fields
The script starts with several input fields where the user can specify the entry price, stop loss price, take profit price, custom value, and investment amount. These values help define the parameters for risk/reward calculations.
2. Dynamic Horizontal Lines
Three horizontal lines are drawn on the chart, representing the entry price, stop loss price, and take profit price. These lines update dynamically based on user input.
3. Dynamic Line Updates
As the user adjusts their inputs, the position of the lines is updated in real-time to match the new price levels. This keeps the chart visually accurate.
4. Labels for Lines
Labels are placed on the chart next to each price line, allowing the user to clearly see which line represents which price level.
5. Long and Short Position Calculations
The script calculates the potential profit or loss for both long (prices go up) and short (prices go down) positions, providing users with an idea of their potential gains or losses.
6. **6. Risk/Reward Ratio Calculation
This calculates the Risk/Reward Ratio (RR) by dividing the distance between the take profit and entry price by the distance between the entry and stop loss price. This gives the trader an idea of how much risk they're taking relative to the potential reward.
7. Alert Conditions
The alert conditions are defined based on the price hitting the set levels:
Entry Condition: If the price goes up and touches the entry level, the alert is triggered.
Stop Loss Condition: If the price drops and hits the stop loss level, the alert is triggered.
Take Profit Condition: If the price rises and reaches the take profit level, the alert is triggered.
8. Alert Configuration
Each condition is linked to an alert that sends a message when the specific price level is touched. The alerts notify the user when the entry, stop loss, or take profit levels are hit.
9. Lot Calculations
The script includes a function that calculates micro and mini lot sizes based on a preset table and a custom value input by the user. This is useful for adjusting lot sizes to the desired amount and determining position sizes for trades.
10. Entry Price-Based Profit & Loss Table
A table is generated on the chart that displays detailed information about the profit, loss, and risk/reward ratio based on the entry price. It helps traders see the potential outcomes for different lot sizes.
11. Current Price-Based Profit & Loss Table
This second table provides similar information as the first but calculates profit, loss, and risk/reward based on the current price. This allows the trader to see how their position performs as the market price changes in real time.
Strategy Framework: 37 Strategies Unified with RM & PS BTCEURStrategy Framework: 37 Strategies Unified with Risk Management and Position Sizing
This comprehensive framework integrates over 37 independent strategies into a single, powerful trading system. Each strategy contributes its unique market perspective, culminating in a holistic decision-making process. The framework is further enhanced with sophisticated risk management and position sizing techniques.
Key Strategies Include:
• Moving average analysis
• Market structure evaluation
• Percentage rank calculations
• Sine wave correlation
• Fourier Frequency Transform (FFT) for signal composition analysis
• Bayesian statistical methods
• Seasonality patterns
• Signal-to-noise ratio assessment
• Horizontal & Indecision levels identification
• Trendlines and channels recognition
• Various oscillator-based strategies
• Open interest analysis
• Volume and volatility measurements
This diverse array of strategies provides a multi-faceted view of the asset, offering a clear and comprehensive understanding of market dynamics.
Optimization and Implementation:
• Each strategy is designed for easy optimization, with a maximum of 4 parameters.
• All strategies produce consistent signal types, which are aggregated for final market direction decisions.
• Individual optimization of each strategy is performed using the Zorro Platform, a professional C++ based tool.
• All strategies are tested to work by themselves with Walk-Forward back testing
• Strategies that don't enhance market regime definition are excluded, ensuring efficiency.
Two-Tiered Approach:
1. Market Regime Identification: The combined output of all strategies determines the market regime, visually represented by a color-coded cloud.
2. Trade Execution: Based on the identified regime, the system applies different entry and exit rules, employing trend-following in bull markets and mean reversion in bear markets.
This framework is optimized for cryptocurrencies, including BTC and ETH and others, offering a robust solution for trading in these volatile markets.
The color of the cloud encodes the market regime as determined by the 37 strategies, guiding the application of distinct trading rules for bull and bear markets.
This invitation-only TradingView script represents a culmination of extensive research and optimization, designed to provide serious traders with a powerful tool for navigating the complex cryptocurrency markets.
The strategy comes pre-configured with optimized parameters by default, so there's no need to make any adjustments. However, it’s important to use the timeframes and exchanges selected on screen . Also, a Premium account with 20.000 bars is needed since since starting points are important for the parameter optimizations. If you have any questions or concerns about the strategy, feel free to reach out.
For automation, I recommend using a tool like Autoview . The strategy is fully compatible with automated trading; you just need to select your exchange and set the maximum order size you're comfortable trading.
Free Month for Testing:
You are eligible for a free one-month trial to test the strategy before committing. This allows you to fully explore its capabilities without any immediate cost.
________________________________________
Important Information:
This is a premium script with access granted on an invite-only basis.
To request access or if you have further questions, please send me a direct message. There is a free month allowance for testing purposes.
Please note that this script involves complex calculations, and on rare occasions, you may encounter an error message from TradingView stating, "Calculation Takes Too Long." This is usually due to a temporary issue with server resources. If this happens, simply modify any parameter of the indicator and revert it back—this should resolve the issue.
________________________________________
General Disclaimer:
Trading stocks, futures, Forex, options, ETFs, cryptocurrencies, or any other financial instrument involves significant risks and rewards. You must be fully aware of the risks involved and be willing to accept them before participating in these markets.
Do not trade with money you cannot afford to lose. This communication is not a solicitation or an offer to buy or sell any financial instrument.
No guarantees are made regarding potential profits or losses from any account. Past performance of any trading strategy or methodology is not necessarily indicative of future results.
Intramarket Difference Index StrategyIntramarket Difference Indicator (IDI) Strategy:
In layman’s terms this strategy compares two indicators across (correlated) markets and exploits their differences.
📍 Import Notes:
This Strategy calculates trade position size independently, this means that the ‘Order size’ input in the ‘Properties’ tab will have no effect on the strategy. Why ? because this allows us to define custom position size algorithms which we can use to improve our risk management and equity growth over time. Here we have the option to have fixed quantity or fixed percentage of equity ATR (Average True Range) based stops in addition to the turtle trading position size algorithm.
‘Pyramiding’ does not work for this strategy’, similar to the order size input togeling this input will have no effect on the strategy as the strategy explicitly defines the maximum order size to be 1.
This strategy is not perfect, and as of writing of this post I have not traded this algo.
Always take your time to backtests and debug the strategy.
🔷 The IDI Strategy:
By default this strategy pulls data from your current TV chart and then compares it to the base market, be default BINANCE:BTCUSD . The strategy pulls SMA and RSI data from either market (we call this the difference data), standardizes the data (solving the different unit problem across markets) such that it is comparable and then differentiates the data, calling the result of this transformation and difference the Intramarket Difference (ID). The formula for the the ID is
ID = market1_diff_data - market2_diff_data (1)
Where
market(i)_diff_data = diff_data / ATR(j)_market(i)^0.5,
where i = {1, 2} and j = the natural numbers excluding 0
Formula (1) interpretation is the following
When ID > 0: this means the current market outperforms the base market
When ID = 0: Markets are at long run equilibrium
When ID < 0: this means the current market underperforms the base market
To form the strategy we define one of two strategy type’s which are Trend and Mean Revesion respectively.
🔸 Trend Case:
Given the ‘‘Strategy Type’’ is equal to TREND we define a threshold for which if the ID crosses over we go long and if the ID crosses under the negative of the threshold we go short.
The motivating idea is that the ID is an indicator of the two symbols being out of sync, and given we know volatility clustering, momentum and mean reversion of anomalies to be a stylised fact of financial data we can construct a trading premise. Let's first talk more about this premise.
For some markets (cryptocurrency markets - synthetic symbols in TV) the stylised fact of momentum is true, this means that higher momentum is followed by higher momentum, and given we know momentum to be a vector quantity (with magnitude and direction) this momentum can be both positive and negative i.e. when the ID crosses above some threshold we make an assumption it will continue in that direction for some time before executing back to its long run equilibrium of 0 which is a reasonable assumption to make if the market are correlated. For example for the BTCUSD - ETHUSD pair, if the ID > +threshold (inputs for MA and RSI based ID thresholds are found under the ‘‘INTRAMARKET DIFFERENCE INDEX’’ group’), ETHUSD outperforms BTCUSD, we assume the momentum to continue so we go long ETHUSD.
In the standard case we would exit the market when the IDI returns to its long run equilibrium of 0 (for the positive case the ID may return to 0 because ETH’s difference data may have decreased or BTC’s difference data may have increased). However in this strategy we will not define this as our exit condition, why ?
This is because we want to ‘‘let our winners run’’, to achieve this we define a trailing Donchian Channel stop loss (along with a fixed ATR based stop as our volatility proxy). If we were too use the 0 exit the strategy may print a buy signal (ID > +threshold in the simple case, market regimes may be used), return to 0 and then print another buy signal, and this process can loop may times, this high trade frequency means we fail capture the entire market move lowering our profit, furthermore on lower time frames this high trade frequencies mean we pay more transaction costs (due to price slippage, commission and big-ask spread) which means less profit.
Note it is possible that after printing a buy the strategy then prints many sell signals before returning to a buy, which again has the same implications. The image below showcases the theory above, by allowing our winner to run we may capture more profit.
Valid trades are denoted by solid green and red arrows respectively and all other valid trades which occur within the original signal are light green and red small arrows, if we were to close our trades when the IDI returns to its equilibrium of 0 our average bars per trade would be very low and we would not capture the general trend.
Note by capturing the sum of many momentum moves we are essentially following the trend hence the trend following strategy type.
Here we also print the IDI (with default strategy settings with the MA difference type), we can see that by letting our winners run we may catch many valid momentum moves, that results in a larger final pnl that if we would otherwise exit based on the equilibrium condition.
Note if you would like to plot the IDI separately copy and paste the following code in a new Pine Script indicator template.
indicator("IDI")
// INTRAMARKET INDEX
var string g_idi = "intramarket diffirence index"
ui_index_1 = input.symbol("BINANCE:BTCUSD", title = "Base market", group = g_idi)
// ui_index_2 = input.symbol("BINANCE:ETHUSD", title = "Quote Market", group = g_idi)
type = input.string("MA", title = "Differrencing Series", options = , group = g_idi)
ui_ma_lkb = input.int(24, title = "lookback of ma and volatility scaling constant", group = g_idi)
ui_rsi_lkb = input.int(14, title = "Lookback of RSI", group = g_idi)
ui_atr_lkb = input.int(300, title = "ATR lookback - Normalising value", group = g_idi)
ui_ma_threshold = input.float(5, title = "Threshold of Upward/Downward Trend (MA)", group = g_idi)
ui_rsi_threshold = input.float(20, title = "Threshold of Upward/Downward Trend (RSI)", group = g_idi)
//>>+----------------------------------------------------------------+}
// CUSTOM FUNCTIONS |
//<<+----------------------------------------------------------------+{
// construct UDT (User defined type) containing the IDI (Intramarket Difference Index) source values
// UDT will hold many variables / functions grouped under the UDT
type functions
float Close // close price
float ma // ma of symbol
float rsi // rsi of the asset
float atr // atr of the asset
// the security data
getUDTdata(symbol, malookback, rsilookback, atrlookback) =>
indexHighTF = barstate.isrealtime ? 1 : 0
= request.security(symbol, timeframe = timeframe.period,
expression = [close , // Instentiate UDT variables
ta.sma(close, malookback) ,
ta.rsi(close, rsilookback) ,
ta.atr(atrlookback) ])
data = functions.new(close_, ma_, rsi_, atr_)
data
// Intramerket Difference Index
idi(type, symbol1, malookback, rsilookback, atrlookback, mathreshold, rsithreshold) =>
threshold = float(na)
index1 = getUDTdata(symbol1, malookback, rsilookback, atrlookback)
index2 = getUDTdata(syminfo.tickerid, malookback, rsilookback, atrlookback)
// declare difference variables for both base and quote symbols, conditional on which difference type is selected
var diffindex1 = 0.0, var diffindex2 = 0.0,
// declare Intramarket Difference Index based on series type, note
// if > 0, index 2 outpreforms index 1, buy index 2 (momentum based) until equalibrium
// if < 0, index 2 underpreforms index 1, sell index 1 (momentum based) until equalibrium
// for idi to be valid both series must be stationary and normalised so both series hae he same scale
intramarket_difference = 0.0
if type == "MA"
threshold := mathreshold
diffindex1 := (index1.Close - index1.ma) / math.pow(index1.atr*malookback, 0.5)
diffindex2 := (index2.Close - index2.ma) / math.pow(index2.atr*malookback, 0.5)
intramarket_difference := diffindex2 - diffindex1
else if type == "RSI"
threshold := rsilookback
diffindex1 := index1.rsi
diffindex2 := index2.rsi
intramarket_difference := diffindex2 - diffindex1
//>>+----------------------------------------------------------------+}
// STRATEGY FUNCTIONS CALLS |
//<<+----------------------------------------------------------------+{
// plot the intramarket difference
= idi(type,
ui_index_1,
ui_ma_lkb,
ui_rsi_lkb,
ui_atr_lkb,
ui_ma_threshold,
ui_rsi_threshold)
//>>+----------------------------------------------------------------+}
plot(intramarket_difference, color = color.orange)
hline(type == "MA" ? ui_ma_threshold : ui_rsi_threshold, color = color.green)
hline(type == "MA" ? -ui_ma_threshold : -ui_rsi_threshold, color = color.red)
🔸 Mean Reversion Case:
We stated prior that mean reversion of anomalies is an standerdies fact of financial data, how can we exploit this ?
We exploit this by normalizing the ID by applying the Ehlers fisher transformation. We now assume our series is approximately normally distributed. To form the strategy we employ the same logic as for e the z score, if the FT normalized ID >< 2.5 or -2.5 respectively we buy or short respectively. We also employ the same exit conditions (fixed ATR stop and trailing Donchian Trailing stop)
🔷 Position Sizing:
If ‘‘Fixed Risk From Initial Balance’’ is toggled true this means we risk a fixed percentage of our initial balance, if false we risk a fixed percentage of our equity (current balance).
Note we also employ a volatility adjusted position sizing formula, the turtle training method which is defined as follows.
Turtle position size = (1/ r * ATR * DV) * C
Where,
r = risk factor coefficient (default is 20)
ATR(j) = risk proxy, over j times steps
DV = Dollar Volatility, where DV = (1/Asset Price) * Capital at Risk
🔷 Risk Management:
Correct money management means we can limit risk and increase reward (theoretically). Here we employ
Max loss and gain per day
Max loss per trade
Max number of consecutive losing trades until trade skip
To read more see the tooltips (info circle).
Note the ATR stop losses and take profits are defined, with the prior being default.
ATR SL and TP defined
🔷 Hurst Regime (Regime Filter):
The Hurst Exponent (H) aims to segment the market into three different states, Trending (H > 0.5), Random Geometric Brownian Motion (H = 0.5) and Mean Reverting / Contrarian (H < 0.5). In my interpretation this can be used as a trend filter that eliminates market noise.
We utilize the trending and mean reverting based states, as extra conditions required for valid trades both strategy types respectively, in the process increasing our trade entry quality.
🔷 Example model Architecture:
Here is an example of one configuration of this strategy, combining all aspect discussed in this post.
QTY@RISK VWAP based calculationVWAP Volatility-Based Risk Management Calculator for Intraday Trading
Overview
This script is an innovative tool designed to help traders manage risk effectively by calculating position sizes and stop-loss levels using the Volume Weighted Average Price (VWAP) and its standard deviation (StdDev). Unlike traditional methods that rely on time-based calculations, this approach is time-independent within the intraday timeframe, making it particularly useful for traders seeking precision and efficiency.
Key Concepts
VWAP (Volume Weighted Average Price): VWAP is a trading benchmark that represents the average price a security has traded at throughout the day, based on both volume and price. It provides insight into the average price level over a specific period, helping traders understand the market trend.
StdDev (Standard Deviation): In the context of VWAP, the standard deviation measures the volatility around the VWAP. It provides a quantifiable range that traders can use to set stop-loss levels, ensuring they are neither too tight nor too loose.
How the Script Works
1. VWAP Calculation: The script calculates the VWAP continuously as the market trades, integrating both price and volume data.
2. Volatility Measurement: It then computes the standard deviation of the VWAP, giving a measure of market volatility.
3. Stop-Loss Calculation: Using user-defined StdDev factors, the script calculates two stop-loss levels. These levels adjust dynamically based on market conditions, ensuring they remain relevant throughout the trading session.
4. Position Sizing: By incorporating your risk tolerance, the script determines the appropriate position size. This ensures that your maximum loss per trade does not exceed your predefined risk value.
How to Use the Calculator
1. Select Two VWAP StdDev Factors: Choose two standard deviation factors for calculating stop-loss levels. For example, you might choose 0.5 and 0.75 to set conservative and aggressive stop-losses respectively.
2. Set Your Trading Account Size: Enter your total trading capital. For example, $50,000.
3. Maximum Lot Size: Define the maximum number of shares you are willing to trade in a single position. For instance, 200 shares.
4. Risk Value per Trade: Input the maximum amount of money you are willing to risk on a single trade. For instance, $50.
5. Plotting Options: If you wish to visualize the stop-loss levels, enable the plot option and choose the price base for the plot, such as the closing price or the average of the high and low prices (hl2).
Example of Use
1. Initial Setup: After the market opens, wait for at least 15 minutes to ensure the VWAP has stabilized with sufficient volume data.
2. Parameter Configuration: Input your desired parameters into the calculator. For instance:
- VWAP StdDev Factors: 0.5 and 0.75
- Trading Account Size: $50,000
- Maximum Lot Size: 200 shares
- Risk Value per Trade: $50
- Plot Option: On, using "hl2" or "close" as the price base
3. Execution: Based on the inputs, the script calculates the position size and stop-loss levels. If the calculated stop-loss falls within the selected VWAP StdDev range, it will provide you with precise stop-loss prices.
4. Trading: Use the calculated position size and stop-loss levels to execute your trades confidently, knowing that your risk is managed effectively.
Advantages for Traders
- Time Independence: By relying on VWAP and its StdDev, the calculations are not dependent on specific time intervals, making them more adaptable to real-time trading conditions.
- Focus on Strategy: Novice traders can focus more on their trading strategies rather than getting bogged down with complex calculations.
- Dynamic Adjustments: The script adjusts stop-loss levels dynamically based on evolving market conditions, providing more accurate and relevant risk management.
- Flexibility: Traders can tailor the calculator to their risk preferences and trading style by adjusting the StdDev factors and risk parameters.
By incorporating these concepts and using this risk management calculator, traders can enhance their trading efficiency, improve their risk management, and ultimately make more informed trading decisions.
RSI Multi Strategies With Overlay SignalsHello everyone,
In this indicator, you will find 6 different entry and exit signals based on the RSI :
Entry into overbought and oversold zones
Exit from overbought and oversold zones
Crossing the 50 level
RSI cross RSI MA below or above the 50 level
RSI cross RSI MA in the overbought or oversold zones
RSI Divergence
With the signals identified, you can create your own strategy . (If you have any suggestions, please mention them in the comments).
Beyond these signals, you can set SL (Stop Loss) and TP (Take Profit) levels to better manage your positions.
SL Methods:
Percentage: The stop loss is determined by the percentage you specify.
ATR : The stop level is determined based on the Average True Range (ATR).
TP Methods:
Percentage: The take profit is determined by the percentage you specify.
RR ( Risk Reward ): The take profit level is determined based on the distance from the stop level.
You can mix and match these options as you like.
What makes the indicator unique and effective is its ability to display the RSI in the bottom chart and the signals, SL (Stop Loss), and TP (Take Profit) levels in the overlay chart simultaneously. This feature allows you to manage your trading quickly and easily without the need for using two separate indicators.
Let's try out a few strategies together.
My entry signal: RSI Entered OS (Oversold) Zone
My exit signal: RSI Entered OB (Overbought) Zone
I'm not using a stoploss for this strategy ("Fortune favors the brave").
Let's keep ourselves safe by adding a stop loss.
I'm adding an ATR-based stop loss.
I think it's better now.
If you have any questions or suggestions about the indicator, you can contact me.
Cheers
Risk Management Chart█ OVERVIEW
Risk Management Chart allows you to calculate and visualize equity and risk depend on your risk-reward statistics which you can set at the settings.
This script generates random trades and variants of each trade based on your settings of win/loss percent and shows it on the chart as different polyline and also shows thick line which is average of all trades.
It allows you to visualize and possible to analyze probability of your risk management. Be using different settings you can adjust and change your risk management for better profit in future.
It uses compound interest for each trade.
Each variant of trade is shown as a polyline with color from gradient depended on it last profit.
Also I made blurred lines for better visualization with function :
poly(_arr, _col, _t, _tr) =>
for t = 1 to _t
polyline.new(_arr, false, false, xloc.bar_index, color.new(_col, 0 + t * _tr), line_width = t)
█ HOW TO USE
Just add it to the cart and expand the window.
█ SETTINGS
Start Equity $ - Amount of money to start with (your equity for trades)
Win Probability % - Percent of your win / loss trades
Risk/Reward Ratio - How many profit you will get for each risk(depends on risk per trade %)
Number of Trades - How many trades will be generated for each variant of random trading
Number of variants(lines) - How many variants will be generated for each trade
Risk per Trade % -risk % of current equity for each trade
If you have any ask it at comments.
Hope it will be useful.
TanHef RanksTanHef Ranks: A numeric compass to market tops and bottoms.
█ Simple Explanation:
This indicator is designed to signal 'buy low and sell high' opportunities through numerical rankings, where larger numbers represent stronger signals. These numbered rankings are negative for potential ‘buy’ opportunities and positive for possible ‘sell’ moments.
█ Understanding Numerical Rankings:
The numerical rankings (from +18 to -18) identify and take advantage of market tendencies of prices reverting back to their historical average, also known as mean reversion. It operates on a simple principle: smaller values signal a potential for short-term mean reversion, while larger values suggest a probable shift in both short and long-term mean reversion. These values are derived from a careful analysis of both short and long-term mean reversions, providing traders with a nuanced understanding of market movements.
█ Analyzing Numeric Ranking Extremes:
The historical occurrences of numeric rankings are recorded into a table to help identify the previous extreme rankings (for example anything -10/+10 is considered extreme), which historically signal key turning points in market movements. The previously extreme rankings offer insights into potential end-of trend scenarios or trend reversals, thereby attempting to make high-probability trading decisions.
█ Risk Management Integration:
This indicator combined with disciplined risk management, offers a more secure trading approach. Applying a stop-loss near lows after entries on the oversold side (negative rankings) protects from large losses. Additionally, once prices reach overbought territories (positive rankings) applying a tight stop-loss helps to lock in profits while continuing exposure to the aggressive upwards momentum.
█ Calculation Methodology:
The indicator evaluates market momentum by analyzing upward and downward movements. It does this by referencing the 10 'length' input parameters, where 'length' refers to the number of price bars referenced. Each 'length' increases in value to analyze trends from short to long-term. A numerical rank is given when these trends align, with higher ranks requiring agreement across both short and longer-term lengths. This alignment across different time periods helps to ensure the indicator's signals are robust.
█ Indicator Stability (No Repainting):
When a price bar closes, its associated ranking is fixed and remains unchanged (some other indicators repaint, which means signals can change after a bar closes). While a price bar is open, its numeric ranking may increase in absolute value but never decrease towards zero, ensuring further stability. This stability and consistency is crucial for reliable back-testing and real-time analysis. Notably, in the highly improbable scenario where a ranking may exhibit both a positive and negative value simultaneously during extreme volatility, both the positive and negative numeric ranking is displayed.
█ Practical Application:
Pro Tip: Use at a minimum -4/+4 rank as potential basic buy/sell signals. Higher absolute numeric rankings are ideal as they indicate stronger reversal potential due to higher rankings identifying longer period reversals.
Entry Scenario: Refer to the chart below. The -9 ranking (3 occurrences in the table) indicates potential oversold conditions, suggesting a buy. Add a stop-loss near recent lows to protect against losses.
Exit Scenario: Refer to the chart below. The +7 ranking (6 occurrences in the table) indicates potential overbought conditions, suggesting a sell. Place a stop-loss to protect profits and remain exposed to further gains.
█ Indicator Settings:
Additional Timeframe: Allows users to include an extra timeframe's data in the analysis for more nuanced insights.
Lengths: Defines the periods over which the indicator calculates its rankings, affecting the sensitivity and time horizon of the signals.
Max Number Calculated: Sets the upper limit for the numerical rankings the indicator can output, tuning the extremity of the signals it identifies. (Reducing improves indicator load time)
Visual Styling (Current Timeframe): Customizes the appearance of the indicator's output on the chart for the selected timeframe, enhancing visibility and readability.
Table Settings: Adjusts the display properties of the table that lists numerical rankings, including its visibility, location, and size on the chart.
Indicator Display Type: Selects the mode in which the indicator presents its data, either overlaying the main chart or in a separate pane as an oscillator.
Alerts: Configures the conditions and frequency at which the indicator will trigger trading alerts, based on the numeric rankings and user-defined parameters.
█ How To Access:
You can see the Author's Instructions below to get access.
VaR Market Sentiment by TenozenHello there! I am excited to share with you my new trading concept implemented in the "VaR Market Sentiment" indicator. But before that, let me explain what VaR is. VaR, or Value at Risk, is an indicator that helps you identify the worst-case scenario of a market movement based on a percentile/confidence level. This means that it calculates the worst moves, whether it's a buy or sell, based on the timeframe you're using.
Now, let's discuss how VaR Market Sentiment works. It uses a historical VaR to calculate the worst move either if the market goes up or down based on a percentile/confidence level. The default setting is the 95th percentile, which means that the market is unlikely to hit your SL level within the day if you're using a daily timeframe, etc.
To determine the strength of a candle, it subtracts the value of both sides based on the returns of the current timeframe with the VaR value (Bullish VaR - Bullish Returns, Bearish VaR - Bearish Returns). If the result is above the mean, the current candle is potentially weak. Conversely, if the result is below the mean, the current candle is potentially strong. The deviation shows critical sentiments, where if the market is above the deviation, it means that the current candle is really weak. If it's below the deviation, it means that the current candle is really strong.
It's important to note that this indicator needs other supporting indicators such as trend-following or mean reversion indicators based on your trading style. Also, as a follow-up to my previous concept, I called out that the market has what's called "power." And for now, I conclude that VaR Market Sentiment is the "power."
I'm going to share more helpful indicators in the future! I hope this indicator will be helpful for you guys! Ciao!
QTY@RISKWhat it does:
This indicator calculates the amount of shares to take at a predefined risk according to market volatility based on ATR.
This should help novice traders focus more on their trades and strategies instead of spending too much time calculating parameters.
How it works:
You have some configuration parameters
1. Number of candles used to calculate the ATR
2. ATR calculation method (SMA, RMA, EMA, WMA)
3. How much you want to risk in $.
4. Safety factor on ATR, to get a buffer
5. Size of your capital to be able to calculate the maximum amount of shares
6. Shares limit, if you have a certain limit of shares to take
The formula is simple:
Is the RISK/ATR * price > Equity ? then take the Equity/price
otherwise: SHARES = RISK/(ATR * safety_factor)
How to use it:
This indicator is most useful for intraday timeframe. If you trade on 1m, then use it in this timeframe
Forex Risk CalculatorForex Risk Calculator 's logical is bring the differential between Entry price and Stoploss price, your acceptable risk and your account size to calculate the loss size first then convert to the 'Lot size' and have another feature like auto scale static target calculate by your loss size with RRR (Risk Reward Ratio). Give you to get easier to manage your orders.
Key Features:
📈 Real-time Risk Assessment: Enter the amount you are willing to risk, and Forex Risk Calculator will calculate the appropriate position size for your trade in real-time.
🎯 Target Lines and Static Target Prices based on RRR: Set your desired Risk-Reward Ratio (RRR), and let Forex Risk Calculator auto-generate target prices according to your RRR. Additionally, place target lines to visualize the expected profit if the price hits that line.
⚙️ Customizable Parameters: Adjust risk percentage, RRR, and other parameters to tailor the tool to your trading strategy.
👁️ User-Friendly Interface: Forex Risk Calculator features an easy-to-use and intuitive interface for both beginners and seasoned traders.
Usage:
Step 1: Place your entry price
Step 2: Place your stoploss price
Step 3: Place your target price
Step 4: Confirm your account detail
Step 5: Bring the 'Lot size' to use
Parameter:
Initial account size
Risk percent
Entry price
Stop price
Target price
Show your target price
Show static target prices
Number of your static target prices
Table position
Text size
Background color
Text color
Border color
Output:
Chart
Entry price line
Stop loss price line (loss in USD)
Target price line (profit in USD)
Table
Account size
Risk percent
Entry price
Stoploss price
Lot size
Mason’s Line IndicatorThe Macon Strategy is an idea conceived by Didier Darcet , co-founder of Gavekal Intelligence Software. Inspired by the Water Level, an instrument used by masons to check the horizontality or verticality of a wall. This method aims to measure the psychology of financial markets and determine if the market is balanced or tilting towards an unfavorable side, focusing on the behavioral risk of markets rather than economic or political factors.
The strategy examines the satisfaction and frustration of investors based on the distance between the low and high points of the market over a period of one year. Investor satisfaction is influenced by the current price of the index and the path taken to reach that price. The distance to the low point provides satisfaction, while the distance to the high point generates frustration. The balance between the two dictates investors’ desire to hold or sell their positions.
To refine the strategy, it is important to consider the opinion of a group of investors rather than just one individual. The members of a hypothetical investor club invest successively throughout the past year. The overall satisfaction of the market on a given day is a democratic expression of all participants.
If the overall satisfaction is below 50%, investors are frustrated and sell their positions. If it is above, they are satisfied and hold their positions. The position of the group of investors relative to the high and low points represents the position of the air bubble in the water level. Market performance is measured day by day based on participant satisfaction or dissatisfaction.
In conclusion, memory, emotions, and decision-making ability are closely linked, and their interaction influences investment decisions. The Macon Strategy highlights the importance of the behavioral dimension in understanding financial market dynamics. By studying investor behavior through this strategy, it is possible to better anticipate market trends and make more informed investment decisions.
Presentation of the Mason’s Line Indicator:
The main strategy of this indicator is to measure the average satisfaction of investors based on the position of an imaginary air bubble in a tube delimited by the market’s highs and lows over a given period. After calculating the satisfaction level, it is then normalized between 0 and 1, and a moving average can be used to visualize trends.
Key features:
Calculation of highs and lows over a user-defined period.
Determination of the position of the air bubble in the tube based on the closing price.
Calculation of the average satisfaction of investors over a selected period.
Normalization of the average satisfaction between 0 and 1.
Visualization of normalized or non-normalized average satisfaction levels, as well as their corresponding moving averages.
User parameters:
Period for min and max (days) : Sets the period over which highs and lows will be calculated (1 to 365 days).
Period for average satisfaction (days) : Determines the period over which the average satisfaction of investors will be calculated (1 to 365 days).
Period for SMA : Sets the period of the simple moving average used to smooth the data (1 to 1000 days).
Bubble_value : Adjustment of the air bubble value, ranging from 0 to 1, in increments of 0.025.
Normalized average satisfaction : Option to choose whether to display the normalized or non-normalized average satisfaction.
Please note that the Mason’s Line Indicator is not a guarantee of future market performance and should be used in conjunction with proper risk management. Always ensure that you have a thorough understanding of the indicator’s methodology and its limitations before making any investment decisions. Additionally, past performance is not indicative of future results.
TENKAN SCALPER STRATEGYTENKAN SCALP is a fully automatic trading system.
It is a continuation of our previous ichimoku release. This time however we throw out the rule book and use ICHIMOKU in a very different way.
It applies non traditional money management tactics.
While most trading strategies rely on a stop loss and a take profit target to manage risk. This strategy uses either no stop loss at all or a time based stop loss.
You might ask yourself the question why would you keep a trade open if it goes against you? Here are a phew reasons why the script does what it does.
Forex Markets consolidate most of the time. If you wait long enough your Take Profit will get hit anyways most of the time
You don't have to risk everything per trade. I keep my orders small so to keep some powder to get into some more trades
All the extra trades you take while one trade is in drawdown limit the drawdown as they provide cashflow
On lower timeframes the markets are so chaotic that a stop loss is very likely to get hit by a wick
About backtest below
This backtest uses a spread of 2 pips for entries and a default position size of 100% of equity. This is only possible on exchanges where spread is low and you have 10:1 leverage or more. It does not represent results obtainable without leverage. Do take into account that there are a lot of forex exchanges that provide this leverage, however a 2 pip spread is not always guaranteed and only applies to major pairs.
This backtest does not use the TIME BASED STOPS functionality.
Always start with small position sizing and see how the strategy performs before adding risk.
Explanation of variables:
Chikou(lagging span): pink line, this is price plotted 26 bars ago. People ignore the power of this it is crucial to see how chikou behaves towards past price action as seen in the chart below where we got an entry at red arrow because chikou bounced from past fractal bottom.
Kijun-Sen(base line): Black line or color coded line. This is the equilibrium of last 26 candles. To me this is the most important line in the system as it attracts price.
Kijun = (Highest high of 26 periods + Lowest low of 26 periods) ÷ 2
Tenkan-Sen(conversion line): Blue line. This is the equilibrium of last 9 candles. In a strong uptrend price stays above this line.
Tenkan = (Highest high of 9 periods + Lowest low of 9 periods) ÷ 2
Senkou A (Leading span A)= Pink cloud line, this is the average of the 2 components projected 26 bars in the future.
Senkou A = (Tenkan + Kijun) ÷ 2
Senkou B (Leading span B) = Green cloud line, this is the 52 day equilibrium projected 26 bars in the future.
Senkou B = (Highest high of prior 52 periods + Lowest low of prior 52 periods) ÷ 2
projection: Script uses same function for variable calculation and substracts a number on each next bar as to make a projection of where the variable will be in future bars if price stayed the same. This works as ICHIMOKU calculations use the middle point of a past set of data. The shorter that amount of bars will be in line with the data that it will be restricted to in future if price stayed the same.
Detection of Market Environment
To enter trades the script uses a lot of ICHIMOKU concepts. Contrary to how most people trade ICHIMOKU this script takes an environment that ICHIMOKU identifies as trending upwards and shorts in that environment. The same will be applied to a downtrend where it will open LONGS.
List of CRITERIA for a trend:
Grapling Hook: this is a component based on the chikou span (closing price displaced 26 bars into the past). The script will use an ATR based range to define a possible future projection to the CHIKOU line. For a market to be bullish there should be no price action happening within this area. Market is free to move upwards. Vice versa for bearish .
Kumo Cloud: script will check if price is above the cloud for bullish trend and below cloud for bearish trend .
Chikou above Kijun: script will check if the chikou line is above the KIJUN line of 26 bars ago. This is further confirmation that price is trending high enough compared to it's past data. Vice versa for downtrend.
Kijun projection: script will check if past Kijun is lower than future projected Kijun. This to ensure we get an equilibrium in our favour in the future. Vice versa for downtrend
Tenkan projection: script will check if future Tenkan-sen will be higher than Kijun-sen for an uptrend. Vice versa for downtrend.
Cloud projection: script will check if in 9 bars the Senkou Span A will be higher than Senkou Span B for an uptrend. Vice versa for downtrend.
Example:
This script does not visualise the prediction lines like I show in the example. I show them here to clarify how the script works.
Usage
Backtests are not indicative of future results, although a trader may want to use a strategy script to have a deeper understanding of how their strategy responds to varying market conditions, or as a tool for identifying possible flaws for a strategy that may be indicative of good or bad performance in the future.
Strategy Settings:
Minimum Body Size (atr): this is the minimum ATR a signal bar needs to be for entry. This is useful because our TP is based on previous bar.
Lot size per trade: this setting does not impact backtest. It is used to for the signals to let tradingconnect.com know your position size.
Direction: do you want to trade longs or shorts. I personally use both a long bot and a short bot at the same time.
Positions Allowed: the amount of positions the script will keep open as a maximum. You do not want to open too many positions, this is for risk management.
Close all positions at drawdown: if total open positions loss gets to this % target it will close all positions.
MetaTrader Prefix: when the script sends a signal it will put this text right before the symbol name from syminfo.ticker
MetaTrader Suffix: when the script sends a signal it will put this text right after the symbol name from syminfo.ticker
Charts below are some examples on how the script handles orders on default settings:
without time based SL
with time based SL
how it handles pyramiding
www.tradingview.com
Tradingconnector.com:
For full automation of the forex market the script uses this connector to execute trade on MT4. The alerts the script sends using the alerts() function call are structured in a way tradingconnector will recognise and send directly to MT4. You can find documentation about this tool on their own website.
Personal recommendation is to start with a minimum lot size and track performance, if you are comfortable scale the size up. You can do that by increasing the lot size setting in the script and making a new alert. Make sure to delete the old one.
How to access
You can see the Author's Instructions below to visit our telegram to get more information on how to get access.
Basic Position Calculator (BPC)In trading, proper position sizing is essential to managing risk and maximizing returns. The script provided is a Basic Position Calculator that allows traders to quickly and easily calculate their position size, stop loss, take profit, and risk reward ratio for a given trade.
The script starts by defining several inputs for the user to customize the calculations. The first input is the "Account Size", which specifies the total amount of funds available for the trade. The next input is "Risk Amount %", which is the percentage of the account size that the trader is willing to risk per trade. The "Stop Loss" input specifies the maximum amount of loss that the trader is willing to accept, while the "Reward" input is the desired profit target for the trade. Finally, there is a "Position" input that allows the user to specify where on the chart the table of calculations will be displayed.
The script then calculates the position size, stop loss, take profit and risk reward ratio using the user-specified inputs. The position size is calculated by dividing the risk amount by the stop loss. The stop loss is calculated by multiplying the stop loss percentage by the close price, and the take profit is calculated by multiplying the stop loss percentage by the close price and the reward. Risk-reward ratio is the ratio of amount of profit potential to the amount of risk in a trade.
The script then creates a table and displays the calculated values on the chart at the specified location. The table includes the following information: account size, position size, account risk %, stop loss, stop loss %, take profit, take profit % and risk reward ratio. This allows the trader to quickly and easily see all the key calculations for their trade in one place.
Overall, the Basic Position Calculator script is a valuable tool for any trader looking to quickly and easily calculate their position size, stop loss, take profit, and risk reward ratio for a given trade. The ability to customize the inputs and display the calculations on the chart makes it a useful and user-friendly tool for managing risk and maximizing returns.
TrapulatorA position size, stop loss and take profit calculator to make forex trading easier.
Utilizes the symbol, payout rates, etc.
How to Use:
Go to the indicator's settings and change the "Settings" and "Entry" sections. After saving your settings, the values will be drawn in a table on the chart.
This has been republished, so that it has the correct name. You can't change the name of scripts once they've been published as far as I'm aware. So, this version of the script will receive updates, and the Trap Calculator will just be a 1.0 version, that's available.
There are default values within the calculator, so use at your own risk and do your own due diligence. This is public so that you can use it to make a calculator that better suits your needs if you want.
6 Multi-Timeframe Supertrend with Heikin Ashi as Source
This is a multiple multi-timeframe version of famous supertrernd only with Heikin Ashi as source. Atr which stands in the heart of supertrend is calculated based on heikin-ashi bars which omits a great deal of noises.
with 6 multiplication of the supertrend, its simply much easier to spot trend direction or use it as trailing stop with several levels available.
this is a great tool to assess and manage your risk and calculate your position volume if you use the heikin ashi supertrend as your stoploss.
SUPPORT RESISTANCE STRATEGY [5MIN TF]A SUPPORT RESISTANCE BREAKOUT STRATEGY for 5 minute Time-Frame , that has the time condition for Indian Markets
The Timing can be changed to fit other markets, scroll down to "TIME CONDITION" to know more.
The commission is also included in the strategy .
The basic idea is when ,
1) Price crosses above Resistance Level ,indicated by Red Line, is a Long condition.
2) Price crosses below Support Level ,indicated by Green Line , is a Short condition.
3) Candle high crosses above ema1, is a part of the Long condition .
4) Candle low crosses below ema1, is a part of the Short condition .
5) Volume Threshold is an added confirmation for long/short positions.
6) Maximum Risk per trade for the intraday trade can be changed .
7) Default qty size is set to 50 contracts , which can be changed under settings → properties → order size.
8) ATR is used for trailing after entry, as mentioned in the inputs below.
// ═════════════════════════//
// ————————> INPUTS <————————— //
// ═════════════════════════//
→ L_Bars ———————————> Length of Resistance / Support Levels.
→ R_Bars ———————————> Length of Resistance / Support Levels.
→ Volume Break ———————> Volume Breakout from range to confirm Long/Short position.
→ Price Cross Ema —————> Added condition as explained above (3) and (4).
→ ATR LONG —————————> ATR stoploss trail for Long positions.
→ ATR SHORT ————————> ATR stoploss trail for Short positions.
→ RISK ————————————> Maximum Risk per trade intraday.
The strategy was back-tested on TCS ,the input values and the results are mentioned under "BACKTEST RESULTS" below.
// ═════════════════════════ //
// ————————> PROPERTIES<——————— //
// ═════════════════════════ //
Default_qty_size ————> 50 contracts , which can be changed under
Settings
↓
Properties
↓
Order size
// ═══════════════════════════════//
// ————————> TIME CONDITION <————————— //
// ═══════════════════════════════//
The time can be changed in the script , Add it → click on ' { } ' → Pine editor→ making it a copy [right top corner} → Edit the line 27.
The Indian Markets open at 9:15am and closes at 3:30pm.
The 'time_cond' specifies the time at which Entries should happen .
"Close All" function closes all the trades at 3pm , at the open of the next candle.
To change the time to close all trades , Go to Pine Editor → Edit the line 92 .
All open trades get closed at 3pm , because some brokers don't allow you to place fresh intraday orders after 3pm .
// ═══════════════════════════════════════════════ //
// ————————> BACKTEST RESULTS ( 100 CLOSED TRADES )<————————— //
// ═══════════════════════════════════════════════ //
INPUTS can be changed for better Back-Test results.
The strategy applied to NSE:TCS ( 5 min Time-Frame and contract size 50) gives us 60% profitability , as shown below
It was tested for a period a 6 months with a Profit Factor of 1.8 ,net Profit of 30,000 Rs profit .
Sharpe Ratio : 0.49
Sortino Ratio : 1.4
The graph has a Linear Curve with Consistent Profits.
The INPUTS are as follows,
1) L_Bars —————————> 4
2) R_Bars —————————> 4
3) Volume Break ————> 5
4) Price Cross Ema ——> 100
5) ATR LONG ——————> 2.4
6) ATR SHORT —————> 2.6
7) RISK —————————> 2000
8) Default qty size ——> 50
NSE:TCS
Save it to favorites.
Apply it to your charts Now !!
Thank You ☺ NSE:TCS
Manual Stop Loss / Risk Management PanelHere is a panel where you enter the desired stop-loss price, the amount you would like to risk and it spits out what you should trade to only lose that amount if the stop-loss is hit.
Ultimate risk management toolHow to use:
Use the cursor to select the time, entry, stop loss, and target position. Then a window will pop up and type the trading fee or any other things you want to adjust to calculate the actual reward/risk ratio according to the price you selected.
Known error:
Settings of this script can't be saved as default might due to the interactive price selection function. If anyone knows how to fix it, please let me know.
feature:
1. Dynamic profit label can move up and down vertically on the right-hand side of the box.
2. The breakeven line can tell you you can move your stop loss to the entry price when the price reaches it.
3. Calculate the actual reward/risk ratio based on the trading fee. The calculator only calculates the actual Risk/Reward Ratio, which might be helpful for scalpers.
4. When the price touches sl or tp, that side of the box will be highlighted. Sometimes it doesn't work but I will try my best to fix it. Feel free to share your idea to help me to fix it.
5. Price alert. This tool compares with the alert function but reopens it if you want to change the alert price.
Smart SizingSmart Sizing is a simple indicator designed for stock traders to quickly see how many shares you should ideally trade to have an equal amount of risk on all of your trades. It uses your inputted values along with the ATR to determine the right amount of shares you should trade. Since every stock has a different level of volatility just simply buying 100 shares for every trade for example or an equal $ amount like $10,000 will leave your portfolio with concentrated risk in some stocks. If the more volatile stocks turn out to be losers then the wins from the less volatile stocks may not cover the losses, however if your positions were sized according to the volatility of each stock it may have resulted in being profitable overall instead.
That's what the Smart Sizing indicator does, it tells you directly on the chart in a small table and right next to the indicator a value that is how many shares to trade according to your account value and risk objectives. You simply enter in your account value in the indicator settings (I update mine everyday), what % of your account you want to risk, and what ATR Length and Timeframe you wish to use. For example, if you entered your account value at $10,000 with risk percentage at 1% and if you used the daily ATR which was 0.50 then it would show as 200 shares (10,000 x 0.01) / 0.50 = 200 and by trading 200 shares that means if the stock went against you by 1 daily ATR it would equal 1% of your account. So if you used a ATR trailing stop or a fixed stop based on the ATR this indicator can help you determine what your correct position size should be so you can practice good risk management.
Take the example below of two stocks with an almost identical price, Citigroup $C with a last traded price of $50.03 and Exelon $EXC with a last traded price of $50.02, you can see the Smart Sizing indicator is showing to trade 59 shares on Citigroup and 130 shares on Exelon, even though both stocks have almost the same stock price the different recommended position size is because Citigroup is much more volatile than Exelon which is a electric utility.
Please note this indicator is designed for stocks but could also be used for forex but shouldn't be used for futures. It can be used on any timeframe with stocks worldwide.
Jared.
Disclaimer: All my scripts and content are for educational purposes only. I'm not a financial advisor and do not give personal finance advice. Past performance is no guarantee of future performance. Please trade at your own risk.
Full strategy AllinOne with risk management MACD RSI PSAR ATR MAHey, I am glad to present you one of the strategies where I put a lot of time in it.
This strategy can be adapted to all type of timecharts like scalping, daytrading or swing.
The context is the next one :
First we have the ATR to calculate our TP/SL points. At the same time we have another rule once we enter(we enter based on % risk from total equity, in this example 1%, at the same time, lowest ammount for this example is 0.1 lots, but can be modified to 0.01), so we can exit both by tp/sl points, or by losing 1% of our equity or winning 1% of our total equity. It's dinamic.
The strategy is made from
Trend direction :
PSAR
First confirmation point :
Crossover between 10EMA and Bollinger bands middle point
Second confirmation
MACD histogram
Third confirmation
RSI overbought/oversold levels
For entries : we check trend with psar, then once ema cross bb middle point, we confirm together with rsi level for overbought/oversold and macd histogram ( > 0 or <0).
We exit, when we have opposite sign, like from buy to sell or sell to buy, or when we reach tp/sl points, or when we reach % basaed equity points.
It can be changed to be fixed lots, or fixed tp/sl , you just have to uncomment the size from entries, and tp/sl lines.
At the same time, it has the possibility if one desires, to trade only concrete forex session like european, asian and so on for intraday trading.
Hope you enjoy it.
Let me know how it goes.