Milvetti_Pineconnector_LibraryLibrary "Milvetti_Pineconnector_Library"
This library has methods that provide practical signal transmission for Pineconnector.Developed By Milvetti
buy(licenseId, symbol, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a buy order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
sell(licenseId, symbol, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a buy order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
buyLimit(licenseId, symbol, pending, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a buy limit order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
pending (float) : Computing pending order entry price. EA Options: Pips, Specified Price, Percentage
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
buyStop(licenseId, symbol, pending, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a buy stop order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
pending (float) : Computing pending order entry price. EA Options: Pips, Specified Price, Percentage
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
sellLimit(licenseId, symbol, pending, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a sell limit order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
pending (float) : Computing pending order entry price. EA Options: Pips, Specified Price, Percentage
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
sellStop(licenseId, symbol, pending, risk, sl, tp, beTrigger, beOffset, trailTrig, trailDist, trailStep, atrTimeframe, atrTrigger, atrPeriod, atrMultiplier, atrShift, spread, accFilter, secret, comment)
Create a sell stop order message
Parameters:
licenseId (string) : License Id. This is a unique identifier found in the Pineconnector Licensing Dashboard.
symbol (string) : Symbol. Default is syminfo.ticker
pending (float) : Computing pending order entry price. EA Options: Pips, Specified Price, Percentage
risk (float) : Risk. Function depends on the “Volume Type” selected in the EA
sl (float) : StopLoss. Place stop-loss. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
tp (float) : TakeProfit. Place take-profit. Computation is based on the Target Type selected in the EA. Default is 0(inactive)
beTrigger (float) : Breakeven will be activated after the position gains this number of pips. Ensure > 0
beOffset (float) : Offset from entry price. 0 means the SL will be placed exactly at entry price. 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades.
trailTrig (int) : Trailing stop-loss will be activated after a trade gains this number of pips. Default is 0(inactive)
trailDist (int) : SL will be opened at traildist after trailtrig is met, even if you do not have a SL placed.. Default is 0(inactive)
trailStep (int) : Moves trailing stop-loss once price moves to favourable by a specified number of pips. Default is 0(inactive)
atrTimeframe (string) : ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close. Default is Timeframe.Period
atrTrigger (float) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default is 0(inactive)
atrPeriod (int) : ATR averaging period. Default is 0
atrMultiplier (float) : Multiple of ATR to utilise in the new SL computation. Default is 1
atrShift (float) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default is 0
spread (float) : Enter the position only if the spread is equal or less than the specified value in pips. Default is 0(inactive)
accFilter (float) : Enter the position only if the account requirement is met. Default is 0(inactive)
secret (string)
comment (string) : Comment. Add a string into the order’s comment section. Default is "Symbol+Timeframe"
Strategy
Milvetti_TraderPost_LibraryLibrary "Milvetti_TraderPost_Library"
This library has methods that provide practical signal transmission for traderpost.Developed By Milvetti
cancelOrders(symbol)
This method generates a signal in JSON format that cancels all orders for the specified pair. (If you want to cancel stop loss and takeprofit orders together, use the “exitOrder” method.
Parameters:
symbol (string)
exitOrders(symbol)
This method generates a signal in JSON format that close all orders for the specified pair.
Parameters:
symbol (string)
createOrder(ticker, positionType, orderType, entryPrice, signalPrice, qtyType, qty, stopLoss, stopType, stopValue, takeProfit, profitType, profitValue, timeInForce)
This function is designed to send buy or sell orders to traderpost. It can create customized orders by flexibly specifying parameters such as order type, position type, entry price, quantity calculation method, stop-loss, and take-profit. The purpose of the function is to consolidate all necessary details for opening a position into a single structure and present it as a structured JSON output. This format can be sent to trading platforms via webhooks.
Parameters:
ticker (string) : The ticker symbol of the instrument. Default value is the current chart's ticker (syminfo.ticker).
positionType (string) : Determines the type of order (e.g., "long" or "buy" for buying and "short" or "sell" for selling).
orderType (string) : Defines the order type for execution. Options: "market", "limit", "stop". Default is "market"
entryPrice (float) : The price level for entry orders. Only applicable for limit or stop orders. Default is 0 (market orders ignore this).
signalPrice (float) : Optional. Only necessary when using relative take profit or stop losses, and the broker does not support fetching quotes to perform the calculation. Default is 0
qtyType (string) : Determines how the order quantity is calculated. Options: "fixed_quantity", "dollar_amount", "percent_of_equity", "percent_of_position".
qty (float) : Quantity value. Can represent units of shares/contracts or a dollar amount, depending on qtyType.
stopLoss (bool) : Enable or disable stop-loss functionality. Set to `true` to activate.
stopType (string) : Specifies the stop-loss calculation type. Options: percent, "amount", "stopPrice", "trailPercent", "trailAmount". Default is "stopPrice"
stopValue (float) : Stop-loss value based on stopType. Can be a percentage, dollar amount, or a specific stop price. Default is "stopPrice"
takeProfit (bool) : Enable or disable take-profit functionality. Set to `true` to activate.
profitType (string) : Specifies the take-profit calculation type. Options: "percent", "amount", "limitPrice". Default is "limitPrice"
profitValue (float) : Take-profit value based on profitType. Can be a percentage, dollar amount, or a specific limit price. Default is 0
timeInForce (string) : The time in force for your order. Options: day, gtc, opg, cls, ioc and fok
Returns: Return result in Json format.
addTsl(symbol, stopType, stopValue, price)
This method adds trailing stop loss to the current position. “Price” is the trailing stop loss starting level. You can leave price blank if you want it to start immediately
Parameters:
symbol (string)
stopType (string) : Specifies the trailing stoploss calculation type. Options: "trailPercent", "trailAmount".
stopValue (float) : Stop-loss value based on stopType. Can be a percentage, dollar amount.
price (float) : The trailing stop loss starting level. You can leave price blank if you want it to start immediately. Default is current price.
1H NAS100USD StrategyThis is an experimental NAS100USD ( OANDA:NAS100USD ) strategy made with straightforward entering criteria.
It works best on the 1H Chart , but it can also provide good results on higher timeframes.
The risk-to-reward ratio is 1:20 , which means the win rate is not as high as other strategies, so I would recommend only risking 0.5% of the balance on your tests, especially if you're a funded trader with a 10% maximum drawdown.
Results from 2 years of backtesting on the 1H timeframe (2023-2024):
Number of Trades: 101
Return: +$115.39%
Win rate: 27.72%
Maximum Drawdown: 6.62%
*Results with a 0.5% risk per trade ($100,000 balance) and Pyramiding settings set to 2.
Feel free to deep backtest this and make further improvements.
Cheers!
Hold Time With Percentage Drop Catastrophic ExitStrategy Name: Volatile Market Minimum-Hold & Catastrophic Drop Exit Strategy
Description:
This is a strategy designed to operate effectively within volatile trading environments, with specific rules that balance patience with protection from risk. It looks to capitalize on breakout conditions but provides a failsafe in the event of a sudden severe price decline.
Key Features:
Volatility-Based Entry Criteria:
This strategy is based on Bollinger Bands, ATR, VWAP, and MACD in trying to find breakout opportunities with increased volatility in the markets. It demands that the price go over the upper Bollinger Band when ATR indicates increased turbulence and that MACD signals upward momentum. In this way, it selects trades with high follow-through likelihoods, especially under trending conditions.
Minimum Holding Period:
Once a long position is initiated, the strategy imposes a strict "no-sell" period in bars. This means that, under normal circumstances, it will not close the position. This encourages the trade to mature, reducing the likelihood of premature exits caused by minor pullbacks or intraday noise.
Volume Confirmation:
A relative volume filter ensures that breakouts aren't occurring in low-liquidity conditions. In doing so, the strategy is only looking to enter when market participation is well above average, thereby increasing the odds of price moves being legitimate and sustainable.
Catastrophic Drop Exit:
The strategy includes a "catastrophic drop" mechanism to help mitigate severe, unexpected losses. If the price falls below a user-defined percentage of the entry price—sufficiently large to indicate a major market breakdown—it will override the minimum hold rule and immediately close the position. This helps protect capital if the market suddenly turns sharply negative.
User Configuration:
All the key parameters, which include the minimum hold duration, catastrophic drop percentage, Bollinger Band settings, MACD lengths, and ATR-based stop/target multiples, are user-editable. Traders can adjust the aggressiveness, holding time, and risk controls of the strategy to fit their specific risk tolerance, trading style, and the volatility profile of the markets in which they're participating.
Intended Use Case:
This strategy is more suitable for traders operating in more volatile markets, with frequent whipsaws and fast price moves. It tries to capture the upside of a volatile breakout while minimizing the downside from a sudden price collapse by balancing a forced hold period against the flexibility of a catastrophic drop exit.
Note:
This approach is in line with all automated or rules-based approaches: extensive backtesting and parameter optimization, followed by thorough forward-testing on paper, is very strongly advised before going into live market conditions. Also, adjust parameters to better suit your instrument of choice, timeframe, and your criteria of personal risk management.
DAILY Supertrend + EMA Crossover with RSI FilterThis strategy is a technical trading approach that combines multiple indicators—Supertrend, Exponential Moving Averages (EMAs), and the Relative Strength Index (RSI)—to identify and manage trades.
Core Components:
1. Exponential Moving Averages (EMAs):
Two EMAs, one with a shorter period (fast) and one with a longer period (slow), are calculated. The idea is to spot when the faster EMA crosses above or below the slower EMA. A fast EMA crossing above the slow EMA often suggests upward momentum, while crossing below suggests downward momentum.
2. Supertrend Indicator:
The Supertrend uses Average True Range (ATR) to establish dynamic support and resistance lines. These lines shift above or below price depending on the prevailing trend. When price is above the Supertrend line, the trend is considered bullish; when below, it’s considered bearish. This helps ensure that the strategy trades only in the direction of the overall trend rather than against it.
3. RSI Filter:
The RSI measures momentum. It helps avoid buying into markets that are already overbought or selling into markets that are oversold. For example, when going long (buying), the strategy only proceeds if the RSI is not too high, and when going short (selling), it only proceeds if the RSI is not too low. This filter is meant to improve the quality of the trades by reducing the chance of entering right before a reversal.
4. Time Filters:
The strategy only triggers entries during user-specified date and time ranges. This is useful if one wants to limit trading activity to certain trading sessions or periods with higher market liquidity.
5. Risk Management via ATR-based Stops and Targets:
Both stop loss and take profit levels are set as multiples of the ATR. ATR measures volatility, so when volatility is higher, both stops and profit targets adjust to give the trade more breathing room. Conversely, when volatility is low, stops and targets tighten. This dynamic approach helps maintain consistent risk management regardless of market conditions.
Overall Logic Flow:
- First, the market conditions are analyzed through EMAs, Supertrend, and RSI.
- When a buy (long) condition is met—meaning the fast EMA crosses above the slow EMA, the trend is bullish according to Supertrend, and RSI is below the specified “overbought” threshold—the strategy initiates or adds to a long position.
- Similarly, when a sell (short) condition is met—meaning the fast EMA crosses below the slow EMA, the trend is bearish, and RSI is above the specified “oversold” threshold—it initiates or adds to a short position.
- Each position is protected by an automatically calculated stop loss and a take profit level based on ATR multiples.
Intended Result:
By blending trend detection, momentum filtering, and volatility-adjusted risk management, the strategy aims to capture moves in the primary trend direction while avoiding entries at excessively stretched prices. Allowing multiple entries can potentially amplify gains in strong trends but also increases exposure, which traders should consider in their risk management approach.
In essence, this strategy tries to ride established trends as indicated by the Supertrend and EMAs, filter out poor-quality entries using RSI, and dynamically manage trade risk through ATR-based stops and targets.
DemaRSI StrategyThis is a repost to a old script that cant be updated anymore, the request was made on Feb, 27, 2016.
Here's a engaging description for the tradingview script:
**DemaRSI Strategy: A Proven Trading System**
Join thousands of traders who have already experienced the power of this highly effective strategy. The DemaRSI system combines two powerful indicators - DEMA (Double Exponential Moving Average) and RSI (Relative Strength Index) - to generate profitable trades with minimal risk.
**Key Features:**
* **Trend-Following**: Our algorithm identifies strong trends using a combination of DEMA and RSI, allowing you to ride the waves of market momentum.
* **Risk Management**: The system includes built-in stop-loss and take-profit levels, ensuring that your gains are protected and losses are minimized.
* **Session-Based Trading**: Trade during specific sessions only (e.g., London or New York) for even more targeted results.
* **Customizable Settings**: Adjust the length of moving averages, RSI periods, and other parameters to suit your trading style.
**What You'll Get:**
* A comprehensive strategy that can be used with any broker or platform
* Easy-to-use interface with customizable settings
* Real-time performance metrics and backtesting capabilities
**Start Trading Like a Pro Today!**
This script is designed for intermediate to advanced traders who want to take their trading game to the next level. With its robust risk management features, this strategy can help you achieve consistent profits in various market conditions.
**Disclaimer:** This script is not intended as investment advice and should be used at your own discretion. Trading carries inherent risks, and losses are possible.
~Llama3
MicuRobert EMA Cross StrategyThis is a repost of a old strategy that cant be updated anymore, it was a request for a user made in Oct, 6, 2015
Here's a possible engaging description for the tradingview script:
**MicuRobert EMA Cross V2: A Powerful Trading Strategy**
Join the ranks of successful traders with this advanced strategy, designed to help you profit from market trends. The MicuRobert EMA Cross V2 combines two essential indicators - Exponential Moving Average (EMA) and Divergence EMA (DEMA) - to generate buy and sell signals.
**Key Features:**
* **Trading Session Filter**: Only trade during your preferred session, ensuring you're in sync with market conditions.
* **Trailing Stop**: Automatically adjust stop-loss levels to lock in profits or limit losses.
* **Customizable Trade Size**: Set the size of each trade based on your risk tolerance and trading goals.
**How it Works:**
The script uses two EMAs (5-period and 34-period) to identify trends. When the shorter EMA crosses above the longer one, a buy signal is generated. Conversely, when the shorter EMA falls below the longer one, a sell signal is triggered. The strategy also incorporates divergence analysis between price action and the EMAs.
**Visual Aids:**
* **EMA Plots**: Visualize the two EMAs on your chart to gauge market momentum.
* **Buy/Sell Signals**: See when buy or sell signals are generated, along with their corresponding entry prices.
* **Trailing Stop Lines**: Monitor stop-loss levels as they adjust based on price action.
**Get Started:**
Download this script and start trading like a pro! With its robust features and customizable settings, the MicuRobert EMA Cross V2 is an excellent addition to any trader's arsenal.
~Llama3
EMA SCALPING SUITE v1.0 [1M-5M]EMA SCALPING SUITE v1.0
A scalping indicator designed for quick entries on lower timeframes, combining EMA
stacks with volume confirmation and automatic risk management levels.
CORE FEATURES:
1. EMA Stack System:
- 50 EMA (Blue): Fastest trend
- 100 EMA (Yellow): Entry trigger line
- 150 EMA (Orange): Stop loss reference
- 200 EMA (Red): Base trend
2. Entry System:
- LONG: When price dips to 100 EMA during bullish fan
- SHORT: When price rises to 100 EMA during bearish fan
- Signals shown as triangles at entry points
3. Risk Management:
- Auto Stop Loss: 150 EMA (red line)
- Auto Take Profit: Based on RR ratio (green line)
- Entry Price Marker: Current close (blue line)
4. Volume Confirmation:
- High volume dots (>1.5x average)
- Filters out weak signals
- Adjustable sensitivity
HOW IT WORKS:
1. Wait for EMAs to fan out (trend alignment)
2. Look for price to touch 100 EMA
3. Check for volume confirmation
4. Enter when signal appears
5. Use auto-generated SL and TP levels
BEST TIMEFRAMES:
- Primary: 1 minute
- Secondary: 3-5 minutes
- Not recommended: >15 minutes
RECOMMENDED SETTINGS:
- Volume Filter: ON
- Volume Multiplier: 1.5
- Risk:Reward: 1.5
Gold Friday Anomaly StrategyThis script implements the " Gold Friday Anomaly Strategy ," a well-known historical trading strategy that leverages the gold market's behavior from Thursday evening to Friday close. It is a backtesting-focused strategy designed to assess the historical performance of this pattern. Traders use this anomaly as it captures a recurring market tendency observed over the years.
What It Does:
Entry Condition: The strategy enters a long position at the beginning of the Friday trading session (Thursday evening close) within the defined backtesting period.
Exit Condition: Friday evening close.
Backtesting Controls: Allows users to set custom backtesting periods to evaluate strategy performance over specific date ranges.
Key Features:
Custom Backtest Periods: Easily configurable inputs to set the start and end date of the backtesting range.
Fixed Slippage and Commission Settings: Ensures realistic simulation of trading conditions.
Process Orders on Close: Backtesting is optimized by processing orders at the bar's close.
Important Notes:
Backtesting Only: This script is intended purely for backtesting purposes. Past performance is not indicative of future results.
Live Trading Recommendations: For live trading, it is highly recommended to use limit orders instead of market orders, especially during evening sessions, as market order slippage can be significant.
Default Settings:
Entry size: 10% of equity per trade.
Slippage: 1 tick.
Commission: 0.05% per trade.
Kairos StrategyKairos meaning: The right or critical moment
Overview
Kairos Strategy combines multiple technical indicators and filters to create a robust framework for identifying, confirming, and managing trade entries in both trending and ranging markets. The strategy's core revolves around Hull Moving Average (HMA) variants for primary trend detection, supported by VWMA, SMMA, and ZLSMA for precision in signal confirmation. The integration of Parabolic SAR, ATR-based Stop Loss, and RSI filters ensures accurate entry points and risk control. This multi-layered approach provides flexibility and reliability across timeframes and market conditions.
Methodology
The Kairos Strategy employs a systematic approach to analyze market dynamics:
Primary Trend Identification
The Hull Moving Average (HMA) and its variants (THMA and EHMA) detect major trends.
Users can adjust sources like VWMA, SMMA, and ZLSMA for improved accuracy and trend clarity.
Multi-Indicator Integration
Parabolic SAR signals align with price direction to identify actionable trade zones.
RSI Filters ensure trades occur during optimal momentum conditions, avoiding overbought/oversold areas.
Dynamic Risk Management
ATR-based Stop Loss adapts to volatility, ensuring proper risk/reward ratios.
A customizable trailing stop follows price movements, locking profits while minimizing risk.
Signal Filtering
To enhance reliability, entries are validated by avoiding conditions where price interacts directly with the moving averages.
Customization and Flexibility
The Kairos Strategy empowers traders to adapt to different trading styles and market environments through an array of customizable settings. Each component of the strategy is fine-tuned for flexibility and precision, ensuring it meets the diverse needs of its users.
Configurable Indicators and Sources
Select from multiple moving average options, including LSMA, VWMA, SMMA, VAMA, and ZLSMA, for trend identification and crossover signals.
Adjust the length, smoothing type, and multiplier settings for each indicator to suit various market conditions and timeframes.
Incorporate higher timeframes for broader trend validation without sacrificing detail on lower timeframes.
Risk-Reward Optimization
Define distinct risk-reward ratios for both long and short trades, allowing for tailored approaches to each market scenario.
Enable ATR-based stop-loss calculations for adaptive risk management that responds to market volatility.
Utilize bar-based stop-loss levels for simpler, price-action-driven risk placement.
Strategy Logic
The Kairos Strategy's multi-layered logic is designed to maximize trading opportunities while minimizing false signals:
Entry Conditions
Crossover Signals: The strategy identifies buy or sell signals when a selected moving average crosses over the Hull MA in the direction of the trend.
Momentum Validation: RSI filters ensure that entries are aligned with favorable momentum conditions, reducing exposure to false signals during choppy markets.
Trend Alignment: Parabolic SAR confirms that entries align with the current price trend, adding an additional layer of validation.
Price Interaction Check: The strategy avoids signals when price touches key levels, such as the moving averages or crossover sources, ensuring cleaner entries.
Exit Conditions
Stop-Loss Placement: Choose between ATR-based or bar-based stop-loss calculations, ensuring exits are optimized for risk control.
Take-Profit Targets: Automatically calculated based on customizable risk-reward ratios, providing a consistent framework for locking in gains.
Trailing Stops: Optional trailing stops dynamically adjust with price movement, preserving profits as trends evolve.
Key Benefits
Versatility Across Markets: Effective in both trending and ranging conditions, with settings adaptable to any trading style.
Enhanced Signal Accuracy: Multi-indicator validation and dynamic filtering reduce noise and improve entry timing.
Robust Risk Management: Advanced stop-loss and risk-reward configurations safeguard capital while optimizing trade potential.
User-Friendly Interface: Intuitive settings and customizable visuals make the strategy accessible to both novice and experienced traders.
Use Cases
Trend Trading: Utilize the Hull MA and its variants to capture long-term trends with precision and confidence.
Scalping: Leverage shorter timeframes and the strategy's adaptive indicators for quick, high-frequency trades.
Swing Trading: Combine multi-timeframe analysis and dynamic stop-loss settings to capture medium-term market moves.
Backtest Results
Symbol: BTCUSDT.P Bitcoin / TetherUS PREPERTUAL CONTRACT Binance
Timeframe: 1h
Operating window: Date range of backtests is 2022.01.08 - 2024.11.26. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.07% and accounts for possible slippage over 5 ticks.
Initial capital: 1000 USDT
Percent of capital used in every trade: 100 USDT on 30x leverage = 3000 USDT
Maximum Single Profit: 463.95 USDT
Maximum Single Position Loss: 219.34 USDT
Net Profit: +7,302.60 USDT (730.26%)
Total Trades: 156 (52.56% Win rate)
Profit Factor: 2.443
Maximum Drawdown: 640.29 USDT (-29.65%)
Average Profit per Trade: 46.81 USDT (+1.56%)
I recommend this strategy for leverage trading, that's why the trading properties are set this way!
Disclaimer
This tool is designed for educational and informational purposes, reflecting Kairos dedication to empowering traders with knowledge. Keep in mind that past performance is not indicative of future results. Always test strategies in a simulated environment before applying them in live markets.
ATR-based TP/SL with Dynamic RREnglish
This indicator combines the power of the Average True Range (ATR) with dynamic calculations for Take Profit (TP) and Stop Loss (SL) levels, offering a clear visualization of trading opportunities and their respective Risk-Reward Ratios (RRR).
Features:
Dynamic TP/SL Calculation:
TP and SL levels are derived using user-defined ATR multipliers for precise positioning.
Multipliers are flexible, allowing traders to adjust according to their strategies.
Risk-Reward Ratio (RRR):
Automatically calculates and displays the RRR for each trade signal.
Helps traders quickly assess if a trade aligns with their risk management plan.
Entry Conditions:
Buy signals occur when the closing price crosses above the 20-period Simple Moving Average (SMA).
Sell signals occur when the closing price crosses below the 20-period SMA.
Visual Aids:
Red and green lines indicate Stop Loss and Take Profit levels.
Blue and orange labels show the RRR for long and short trades, respectively.
How It Works:
The indicator uses the ATR to calculate TP and SL levels:
TP: Adjusted based on the desired Risk-Reward Ratio (RR).
SL: Proportional to the ATR multiplier.
Entry signals are plotted with "BUY" or "SELL" markers, while the respective TP/SL levels are drawn as horizontal lines.
Why Use This Indicator?
Perfect for traders who value precise risk management.
Helps identify trades with favorable RRR (e.g., greater than 1.5 or 2.0).
Ideal for swing traders, day traders, and scalpers looking to automate their decision-making process.
Customization:
ATR Length: Control the sensitivity of ATR-based calculations.
ATR Multipliers: Set the TP and SL distances relative to the ATR.
Desired RRR: Define the risk/reward ratio you aim to achieve.
Important Notes:
The indicator does not place trades automatically; it is for visual and analytical purposes.
Always backtest and combine it with additional analysis for best results.
French
Cet indicateur combine la puissance de l’Average True Range (ATR) avec des calculs dynamiques pour les niveaux de Take Profit (TP) et de Stop Loss (SL), tout en offrant une visualisation claire des opportunités de trading et de leurs Ratios Risque/Rendement (RRR).
Fonctionnalités :
Calcul Dynamique des TP/SL :
Les niveaux de TP et SL sont calculés à l'aide de multiplicateurs ATR définis par l’utilisateur pour une position précise.
Les multiplicateurs sont personnalisables pour s'adapter à votre stratégie de trading.
Ratio Risque/Rendement (RRR) :
Calcule et affiche automatiquement le ratio RRR pour chaque signal de trade.
Permet aux traders d’évaluer rapidement si un trade correspond à leur plan de gestion des risques.
Conditions d'Entrée :
Les signaux d'achat apparaissent lorsque le prix de clôture traverse au-dessus de la moyenne mobile simple (SMA) à 20 périodes.
Les signaux de vente apparaissent lorsque le prix de clôture traverse en dessous de la SMA à 20 périodes.
Aides Visuelles :
Lignes rouges et vertes pour indiquer les niveaux de Stop Loss et de Take Profit.
Étiquettes bleues et orange pour afficher le RRR des trades longs et courts, respectivement.
Comment Cela Fonctionne :
L'indicateur utilise l’ATR pour calculer les niveaux TP et SL :
TP : Calculé dynamiquement en fonction du ratio risque/rendement souhaité (RRR).
SL : Proportionnel au multiplicateur ATR défini par l’utilisateur.
Les signaux d’entrée sont représentés par des étiquettes "BUY" ou "SELL", tandis que les niveaux de TP/SL sont tracés sous forme de lignes horizontales.
Pourquoi Utiliser Cet Indicateur ?
Idéal pour les traders soucieux d’une gestion rigoureuse des risques.
Identifie les opportunités de trades avec des RRR favorables (par exemple, supérieurs à 1.5 ou 2.0).
Convient aux swing traders, day traders et scalpeurs souhaitant automatiser leur processus de décision.
Personnalisation :
Longueur de l’ATR : Contrôlez la sensibilité des calculs basés sur l’ATR.
Multiplicateurs ATR : Ajustez les distances TP et SL par rapport à l’ATR.
Ratio RRR souhaité : Définissez le ratio risque/rendement que vous visez.
Remarques Importantes :
Cet indicateur n’exécute pas de trades automatiquement ; il est destiné à un usage visuel et analytique uniquement.
Toujours backtester et combiner avec une analyse supplémentaire pour de meilleurs résultats.
parametre par type de trading:
1. Pour les Scalpers :
Style de trading : Trades rapides sur de petites variations de prix, souvent sur des unités de temps courtes (1 min, 5 min).
Recommandations de paramètres :
ATR Length : 7 (plus court pour réagir rapidement à la volatilité).
Multiplicateur SL : 1.0 (Stop Loss proche pour limiter les pertes).
RR souhaité : 1.5 à 2.0 (bon équilibre entre risque et récompense).
Résultat attendu : Des trades fréquents, avec une probabilité raisonnable de toucher le TP tout en limitant les pertes.
2. Pour les Day Traders :
Style de trading : Trades qui durent plusieurs heures dans la journée, souvent sur des unités de temps moyennes (15 min, 1h).
Recommandations de paramètres :
ATR Length : 14 (standard pour capturer une volatilité modérée).
Multiplicateur SL : 1.5 (Stop Loss à distance raisonnable pour supporter les fluctuations intrajournalières).
RR souhaité : 2.0 à 3.0 (ciblez une bonne récompense par rapport au risque).
Résultat attendu : Moins de trades, mais un RR élevé pour compenser les pertes potentielles.
3. Pour les Swing Traders :
Style de trading : Trades qui durent plusieurs jours, souvent sur des unités de temps longues (4h, 1 jour).
Recommandations de paramètres :
ATR Length : 20 (pour capturer des mouvements de volatilité plus larges).
Multiplicateur SL : 2.0 (Stop Loss large pour supporter des fluctuations importantes).
RR souhaité : 3.0 ou plus (ciblez de gros mouvements de prix).
Résultat attendu : Des trades moins fréquents mais potentiellement très lucratifs.
4. Pour les Actifs Volatils (Crypto, Commodités) :
Problème spécifique : Les actifs volatils ont souvent des mouvements brusques.
Recommandations de paramètres :
ATR Length : 7 ou 10 (plus court pour suivre rapidement les variations).
Multiplicateur SL : 1.5 à 2.0 (assez large pour ne pas être déclenché prématurément).
RR souhaité : 1.5 à 2.0 (favorisez des récompenses réalistes sur des mouvements volatils).
Résultat attendu : Trades qui s’adaptent à la volatilité sans sortir trop tôt.
5. Pour les Marchés Stables (Indices, Actions Blue Chip) :
Problème spécifique : Les mouvements sont souvent lents et prévisibles.
Recommandations de paramètres :
ATR Length : 14 ou 20 (capture une volatilité modérée).
Multiplicateur SL : 1.0 à 1.5 (Stop Loss serré pour maximiser l’efficacité).
RR souhaité : 2.0 à 3.0 (ciblez des ratios plus élevés sur des mouvements moins fréquents).
Résultat attendu : Maximisation des profits sur des tendances claires.
Recommandation Générale :
Si vous ne savez pas par où commencer, utilisez ces paramètres par défaut :
ATR Length : 14
Multiplicateur SL : 1.5
RR souhaité : 2.0
GP - SRSI ChannelGP - SRSI Channel Indicator
The GP - SRSI Channel is a channel indicator derived from the Stochastic RSI (SRSI) oscillator. It combines SRSI data from multiple timeframes to analyze minimum, maximum, and closing values, forming a channel based on these calculations. The goal is to identify overbought and oversold zones with color coding and highlight potential trading opportunities by indicating trend reversal points.
How It Works
SRSI Calculation: The indicator calculates the Stochastic RSI values using open, high, low, and close prices from the selected timeframes.
Channel Creation: Minimum and maximum values derived from these calculations are combined across multiple timeframes. The midpoint is calculated as the average of these values.
Color Coding: Zones within the channel are color-coded with a gradient from red to green based on the ratios. Green zones typically indicate selling opportunities, while red zones suggest buying opportunities.
Visual Elements:
The channel boundaries (min/max) are displayed as lines.
Overbought/oversold regions (95-100 and 0-5) are highlighted with shaded areas.
Additional explanatory labels are placed on key levels to guide users.
How to Use
Trading Strategy: This indicator can be used for both trend following and identifying reversal points. Selling opportunities can be evaluated when the channel reaches the upper green zone, while buying opportunities can be considered in the lower red zone.
Timeframe Selection: Users can analyze multiple timeframes simultaneously to gain a broader perspective.
Customization: RSI and Stochastic RSI parameters are adjustable, allowing users to tailor the indicator to their trading strategies.
Important Note
This indicator is for informational purposes only and should not be used as a sole basis for trading decisions. Please validate the results of the indicator with your own analysis.
Silver Bullet ICT Strategy [TradingFinder] 10-11 AM NY Time +FVG🔵 Introduction
The ICT Silver Bullet trading strategy is a precise, time-based algorithmic approach that relies on Fair Value Gaps and Liquidity to identify high-probability trade setups. The strategy primarily focuses on the New York AM Session from 10:00 AM to 11:00 AM, leveraging heightened market activity within this critical window to capture short-term trading opportunities.
As an intraday strategy, it is most effective on lower timeframes, with ICT recommending a 15-minute chart or lower. While experienced traders often utilize 1-minute to 5-minute charts, beginners may find the 1-minute timeframe more manageable for applying this strategy.
This approach specifically targets quick trades, designed to take advantage of market movements within tight one-hour windows. By narrowing its focus, the Silver Bullet offers a streamlined and efficient method for traders to capitalize on liquidity shifts and price imbalances with precision.
In the fast-paced world of forex trading, the ability to identify market manipulation and false price movements is crucial for traders aiming to stay ahead of the curve. The Silver Bullet Indicator simplifies this process by integrating ICT principles such as liquidity traps, Order Blocks, and Fair Value Gaps (FVG).
These concepts form the foundation of a tool designed to mimic the strategies of institutional players, empowering traders to align their trades with the "smart money." By transforming complex market dynamics into actionable insights, the Silver Bullet Indicator provides a powerful framework for short-term trading success
Silver Bullet Bullish Setup :
Silver Bullet Bearish Setup :
🔵 How to Use
The Silver Bullet Indicator is a specialized tool that operates within the critical time windows of 9:00-10:00 and 10:00-11:00 in the forex market. Its design incorporates key principles from ICT (Inner Circle Trader) methodology, focusing on concepts such as liquidity traps, CISD Levels, Order Blocks, and Fair Value Gaps (FVG) to provide precise and actionable trade setups.
🟣 Bullish Setup
In a bullish setup, the indicator starts by marking the high and low of the session, serving as critical reference points for liquidity. A typical sequence involves a liquidity grab below the low, where the price manipulates retail traders into selling positions by breaching a key support level.
This movement is often orchestrated by smart money to accumulate buy orders. Following this liquidity grab, a market structure shift (MSS) occurs, signaled by the price breaking the CISD Level—a confirmation of bullish intent. The indicator then highlights an Order Block near the CISD Level, representing the zone where institutional buying is concentrated.
Additionally, it identifies a Fair Value Gap, which acts as a high-probability area for price retracement and trade entry. Traders can confidently take long positions when the price revisits these zones, targeting the next significant liquidity pool or resistance level.
Bullish Setup in CAPITALCOM:US100 :
🟣 Bearish Setup
Conversely, in a bearish setup, the price manipulates liquidity by creating a false breakout above the high of the session. This move entices retail traders into long positions, allowing institutional players to enter sell orders.
Once the price reverses direction and breaches the CISD Level to the downside, a change of character (CHOCH) becomes evident, confirming a bearish market structure. The indicator highlights an Order Block near this level, indicating the origin of the institutional sell orders, along with an associated FVG, which represents an imbalance zone likely to be revisited before the price continues downward.
By entering short positions when the price retraces to these levels, traders align their strategies with the anticipated continuation of bearish momentum, targeting nearby liquidity voids or support zones.
Bearish Setup in OANDA:XAUUSD :
🔵 Settings
Refine Order Block : Enables finer adjustments to Order Block levels for more accurate price responses.
Mitigation Level OB : Allows users to set specific reaction points within an Order Block, including: Proximal: Closest level to the current price. 50% OB: Midpoint of the Order Block. Distal: Farthest level from the current price.
FVG Filter : The Judas Swing indicator includes a filter for Fair Value Gap (FVG), allowing different filtering based on FVG width: FVG Filter Type: Can be set to "Very Aggressive," "Aggressive," "Defensive," or "Very Defensive." Higher defensiveness narrows the FVG width, focusing on narrower gaps.
Mitigation Level FVG : Like the Order Block, you can set price reaction levels for FVG with options such as Proximal, 50% OB, and Distal.
CISD : The Bar Back Check option enables traders to specify the number of past candles checked for identifying the CISD Level, enhancing CISD Level accuracy on the chart.
🔵 Conclusion
The Silver Bullet Indicator is a cutting-edge tool designed specifically for forex traders who aim to leverage market dynamics during critical liquidity windows. By focusing on the highly active 9:00-10:00 and 10:00-11:00 timeframes, the indicator simplifies complex market concepts such as liquidity traps, Order Blocks, Fair Value Gaps (FVG), and CISD Levels, transforming them into actionable insights.
What sets the Silver Bullet Indicator apart is its precision in detecting false breakouts and market structure shifts (MSS), enabling traders to align their strategies with institutional activity. The visual clarity of its signals, including color-coded zones and directional arrows, ensures that both novice and experienced traders can easily interpret and apply its findings in real-time.
By integrating ICT principles, the indicator empowers traders to identify high-probability entry and exit points, minimize risk, and optimize trade execution. Whether you are capturing short-term price movements or navigating complex market conditions, the Silver Bullet Indicator offers a robust framework to enhance your trading performance.
Ultimately, this tool is more than just an indicator; it is a strategic ally for traders who seek to decode the movements of smart money and capitalize on institutional strategies. With the Silver Bullet Indicator, traders can approach the market with greater confidence, precision, and profitability.
Strategy Tester [Cometreon]The Strategy Tester is a powerful backtesting tool that allows you to evaluate and optimize strategies created with the Strategy Builder or signals generated by the Signal Tester. It offers a comprehensive suite of options for risk management and optimization of trading performance.
Key Features:
Testing strategies on different symbols and timeframes
Advanced risk management with multiple Take Profit and Stop Loss options
Customization of trading sessions and initial capital
Generation of customized alerts for entry, exit, and TP/SL modifications
Technical Details and Customizable Inputs:
Source Entry Long and Short: Select entry conditions for the strategy from the "Signal Tester" or "Strategy Builder".
Source Exit Long and Short: Select exit conditions for the strategy from the "Signal Tester" or "Strategy Builder".
Trading Session: Choose the period in which the strategy will enter positions, selecting from: Months, Days, up to 3 hourly sessions, and the strategy's activity range, i.e., start and end date.
Alert Message: Set custom messages for each type of Alert, such as Entry Long, Exit Short, or Change SL Long
Plot: Choose whether to show Long and Short positions on the chart
Risk Management:
Customize the exits and risk management of your strategy, with a wide range of options including:
Initial Capital: Set the starting capital for the strategy
Quantity: Choose the entry quantity for each type of position, selecting from: Contracts, USD, Percentage of equity, and percentage of initial capital.
Take Profit: Configure up to 4 different Take Profits, choosing each type of level from:
- % : Percentage from the entry price.
- USD : Distance in USD from the entry price.
- Pip : Distance in Pips from the entry price.
- ATR : Set the ATR Take Profit multiplier using the length of the "ATR Period Long".
- Swing : Set the length to calculate the Swing as Take Profit Level
- Risk Reward : Set the Take Profit based on the Risk-Reward of the Stop Loss, vice versa for the Stop Loss (Take Profit or Stop Loss cannot both have the Risk Reward option).
Stop Loss: Set the Stop Loss to reduce the loss in case of defeat, also choosing the type of level as for the "Take Profit".
Break Even: Choose whether to modify the Stop Loss level when the price breaks a certain Take Profit level, you can choose the Stop level, adding or removing (%, USD, or Pip) from the entry level.
Trailing Take Profit: When the price breaks a set price, it allows activating an exit level by subtracting/increasing from the chosen Stop level, the level will continue to update every time the Stop source is updated, for example in Long every time High exceeds the previous one.
Trailing Stop Loss: When the price breaks a set price, it allows activating an exit level by subtracting/increasing from the chosen Stop level, the level will continue to update every time the Stop source is updated, for example in Long every time Low exceeds the previous one.
Exit Before End Session: Allows setting an exit time, for example to exit 1 candle before the end of the daily session.
How to Use The Indicator:
Add the Strategy Tester to the chart
Input signals generated by other TradeLab Beta indicators
Configure risk and capital management settings
Run the strategy backtesting and analyze the results
Optimize the strategy based on the obtained results
Take your trading to the next level with TradeLab Beta's Strategy Tester this powerful backtesting tool and start optimizing your trading strategies today.
Don't waste any more time and visit the link to get access to all Cometreon indicators.
Strategy Builder [Cometreon]The Strategy Builder is an advanced indicator that allows you to create customized trading strategies directly on TradingView. With the ability to define up to five entry conditions and two exit conditions, this tool offers unprecedented flexibility in creating complex strategies.
Key Features:
Creation of strategies with 5 entry conditions and 2 exit conditions
Use of any indicator available on TradingView, including private indicators
Advanced options for signal and condition management
Technical Details and Customizable Inputs:
Activate Signal: Option to activate or deactivate the Long or Short condition
Special Condition:** It's possible to activate a "Special" condition, choosing from:
1) Precedent Signal: Searches for the condition in a previous candle. For example, entering 4 will check the condition in the fourth previous candle.
2) Check Signal: Verifies if the condition has occurred in a certain number of candles. For example, entering 6 will check if the condition has occurred in at least one of the 6 previous candles.
3) Multiple Signal: Checks multiple consecutive conditions. For example, with 3 the condition must occur in all 3 previous candles, unlike the "Check Signal" where a single occurrence is sufficient.
4) Confirm Signal: Checks that the condition has not occurred previously. For example, entering 5 verifies that the condition has not been activated in any of the 5 previous candles.
Source Long and Short: Allows choosing the first value to create the condition, using any indicator on TradingView, including our private indicators with derived signals
Type Long and Short":** Defines the type of condition, with a wide range of intuitive options including:
1) Cross Over Value: Source Long/Short crosses upward the second value.
2) Cross Under Value: Source Long/Short crosses downward the second value.
3) Greater Than: Source Long/Short is greater than the second value.
4) Lower Than: Source Long/Short is less than the second value.
5) Equal To: Source Long/Short is equal to the second value.
6) Increase: Source Long/Short is greater than the previous candle.
7) Decrease: Source Long/Short is less than the previous candle.
8) No Change: Source Long/Short is equal to the previous candle.
9) Change Value: Source Long/Short is different from the previous candle.
Only First: Avoids multiple or repeated signals, excluding a signal if the condition was active in the previous candle.
Type Value: Allows choosing the type of the second value:
1) Normal: allows manually entering a value (for example, 20 or 50).
2) Choose: allows selecting a value from another indicator, as for the first value.
How to Use The Indicator:
Define entry and exit conditions using desired indicators
Configure signal management options for each condition
Test the created strategy directly on the chart or in combination with the Strategy Tester
Unlock the potential of your trading strategies with TradeLab Beta's Strategy Builder start creating customized strategies optimized for your trading goals.
Don't waste any more time and visit the link to get access to all Cometreon indicators.
Signal Tester [Cometreon]Signal Tester is a powerful tool that allows you to analyze and visualize up to 100 historical positions directly on the TradingView chart. This indicator is ideal for quickly testing the effectiveness of trading signals from various sources.
Key Features:
Graphical visualization of entry and exit signals
Support for analysis on different timeframes
Ability to test signals from bots, groups, or personal strategies
Technical Details and Customizable Inputs:
Position Selection : Choose up to 100 recent positions, both long and short, to display signals directly on the chart.
Data Entry : Easily select the date and position type (long/short) in the settings.
How to Use the Indicator:
Enter entry and exit signals in the indicator settings.
Analyze the results directly on the chart.
Add the generated signals to the Strategy Tester to verify their effectiveness.
Start testing your trading signals now with TradeLab Beta's Signal Tester access this powerful tool and take your market analysis to the next level!
Don't waste any more time and visit the link to get access to all Cometreon indicators.
Fractional Accumulation Distribution Strategy🔹 INTRODUCTION:
As traders and investors, we often find ourselves searching for ways to maximize our market positioning—trying to capture the best price, manage risk, and adapt to ever-changing volatility. Through years of working with a variety of traders and investors, a common theme emerged: the most successful market participants were those who accumulated positions strategically over time, rather than relying on one-off, rigid entry points. However, even the best of them struggled to consistently time their entries and exits for optimal results.
That's why I created the Fractional Accumulation/Distribution Strategy (FADS)—an adaptable solution designed to dynamically adjust position sizing and entry points based on changing market conditions, enabling both passive and active market participants to optimize their approach.
The FADS trading strategy combines volatility-based trend detection and adaptive position scaling to maximize profitability across varied market conditions. By using the price ranges from higher timeframes, FADS pinpoints extreme demand and supply zones with a high statistical probability of reversal, making it effective in both high and low volatility environments. By applying adjustable threshold settings, users can focus on meaningful price movements to reduce unnecessary trades. Adaptive position scaling further enhances this approach by adjusting position sizes based on entry level distances, allowing for strategic position building that balances risk and reward in uncertain markets. This systematic scaling begins with smaller positions, expanding as the trend solidifies, creating a refined, robust trading experience.
🔹 FEATURES:
Multi-Timeframe Volatility-Based Trend Detection
Accumulation/Distribution Level Filter
Customizable Period for Highest/Lowest Prices Capture
Adjustable Sensitivity & Frequency in Positioning
Broad control settings of Strategy
Adaptive Position Scaling
🔹 SETTINGS:
Volatility : Determines trading range based on market volatility . Highest range value number of periods.
Factor : Adjusts the width of the Accumulation & Distribution bands separately. The Level Filter feature offers customizable triggering bands, allowing users to fine-tune the initiation point for the Accumulation/Distribution sequence. This flexibility enables traders to align entries more precisely with market conditions, setting optimal thresholds for initiating trade chains, whether in accumulating positions during uptrends or distributing in downtrends.
Lowest : Choose the price source (e.g., Close, Low). Number of bars considered when determining the lowest price level. Selecting the checkbox generate a signal when the price crosses below the previous lowest value for calculating the lowest value used for trade signals.
Highest : Choose the price source (e.g., Close, High). Number of bars considered when determining the highest price levels. Selecting the checkbox generate a signal when the price crosses above the previous highest value for calculating the highest value used for trade signals.
Accumulation Spread : Adjusts the buying frequency sensitivity by setting the distance between entries based on personal risk tolerance. Larger values for less frequent buys; smaller values for more frequent buys.
Distribution Spread : Adjusts the selling frequency sensitivity by setting the distance between exits based on reward preference. Larger values for less frequent sells; smaller values for more frequent sells.
Percentage of Capital Allocation : Sets the portion of total capital used for the initial trade in a strategy. It sets the scale for subsequent trades during accumulation phase.
🔹 APPLICATIONS:
❖ Accumulation and Distribution Phases
Early entries are avoided by initiating accumulation only after a trend reversal is confirmed and price breaks below long-term range.
Position sizes are determined by the distance between consecutive trades, smaller distance results in smaller position sizes and vice versa.
Average position cost is reduced by accumulating larger positions at the lower prices, potentially resulting in improved profitability.
Early exits are avoided by initiating distribution only after trend reversal is confirmed and price breaks above long-term range.
The pace of distribution can be tracked by the violet line that represents average positions during distribution phase
❖ Use Cases (Different than default setting input is used for illustration purposes)
If the starting point of accumulation starts too high for the risk preference, Accumulation Level Filter can be lowered by increasing the 🟢 threshold Factor.
If the starting point of distribution is too low for the reward preference, the Distribution Level Filter can be raised by increasing the 🔴 threshold Factor.
In lower timeframes, positions during the accumulation phase could be purchased at higher levels relative to prior entry positions. To optimize for this, consider extending the period used to capture the lowest prices. Similarly, during the distribution phase, increasing the period for identifying higher prices can improve accuracy.
🔹 Strategy Properties:
Adjusting properties within the script settings is recommended to align with specific accounts and trading platforms, ensuring realistic strategy results.
Balance (default): $100,000
Initial Order Size: 1% of the default balance
Commission: 0.1%
Slippage: 5 Ticks
Backtesting: Backtested using TradingView’s built-in strategy testing tool with default commission rates of 0.1% and slippage of 5 ticks. It reflects average market conditions for Apple Inc. (APPL) on 1-hour timeframe
Disclaimers: Commission and slippage varies with market conditions and brokerage policies. The assumed value may not represent all trading environments.
PAST PERFORMANCE DOESN’T GUARANTEE FUTURE RESULTS!
Disclaimer: Please remember that past performance may not be indicative of future results. Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting. This post and the script don’t provide any financial advice.
This invite-only script is being published as part of my commitment to developing tools that align with TradingView’s community standards. Access requests will be reviewed carefully after the script passes TradingView's moderation process.
Fibonacci ATR Fusion - Strategy [presentTrading]Open-script again! This time is also an ATR-related strategy. Enjoy! :)
If you have any questions, let me know, and I'll help make this as effective as possible.
█ Introduction and How It Is Different
The Fibonacci ATR Fusion Strategy is an advanced trading approach that uniquely integrates Fibonacci-based weighted averages with the Average True Range (ATR) to identify and capitalize on significant market trends.
Unlike traditional strategies that rely on single indicators or static parameters, this method combines multiple timeframes and dynamic volatility measurements to enhance precision and adaptability. Additionally, it features a 4-step Take Profit (TP) mechanism, allowing for systematic profit-taking at various levels, which optimizes both risk management and return potential in long and short market positions.
BTCUSD 6hr Performance
█ Strategy, How It Works: Detailed Explanation
The Fibonacci ATR Fusion Strategy utilizes a combination of technical indicators and weighted averages to determine optimal entry and exit points. Below is a breakdown of its key components and operational logic.
🔶 1. Enhanced True Range Calculation
The strategy begins by calculating the True Range (TR) to measure market volatility accurately.
TR = max(High - Low, abs(High - Previous Close), abs(Low - Previous Close))
High and Low: Highest and lowest prices of the current trading period.
Previous Close: Closing price of the preceding trading period.
max: Selects the largest value among the three calculations to account for gaps and limit movements.
🔶 2. Buying Pressure (BP) Calculation
Buying Pressure (BP) quantifies the extent to which buyers are driving the price upwards within a period.
BP = Close - True Low
Close: Current period's closing price.
True Low: The lower boundary determined in the True Range calculation.
🔶 3. Ratio Calculation for Different Periods
To assess the strength of buying pressure relative to volatility, the strategy calculates a ratio over various Fibonacci-based timeframes.
Ratio = 100 * (Sum of BP over n periods) / (Sum of TR over n periods)
n: Length of the period (e.g., 8, 13, 21, 34, 55).
Sum of BP: Cumulative Buying Pressure over n periods.
Sum of TR: Cumulative True Range over n periods.
This ratio normalizes buying pressure, making it comparable across different timeframes.
🔶 4. Weighted Average Calculation
The strategy employs a weighted average of ratios from multiple Fibonacci-based periods to smooth out signals and enhance trend detection.
Weighted Avg = (w1 * Ratio_p1 + w2 * Ratio_p2 + w3 * Ratio_p3 + w4 * Ratio_p4 + Ratio_p5) / (w1 + w2 + w3 + w4 + 1)
w1, w2, w3, w4: Weights assigned to each ratio period.
Ratio_p1 to Ratio_p5: Ratios calculated for periods p1 to p5 (e.g., 8, 13, 21, 34, 55).
This weighted approach emphasizes shorter periods more heavily, capturing recent market dynamics while still considering longer-term trends.
🔶 5. Simple Moving Average (SMA) of Weighted Average
To further smooth the weighted average and reduce noise, a Simple Moving Average (SMA) is applied.
Weighted Avg SMA = SMA(Weighted Avg, m)
- m: SMA period (e.g., 3).
This smoothed line serves as the primary signal generator for trade entries and exits.
🔶 6. Trading Condition Thresholds
The strategy defines specific threshold values to determine optimal entry and exit points based on crossovers and crossunders of the SMA.
Long Condition = Crossover(Weighted Avg SMA, Long Entry Threshold)
Short Condition = Crossunder(Weighted Avg SMA, Short Entry Threshold)
Long Exit = Crossunder(Weighted Avg SMA, Long Exit Threshold)
Short Exit = Crossover(Weighted Avg SMA, Short Exit Threshold)
Long Entry Threshold (T_LE): Level at which a long position is triggered.
Short Entry Threshold (T_SE): Level at which a short position is triggered.
Long Exit Threshold (T_LX): Level at which a long position is exited.
Short Exit Threshold (T_SX): Level at which a short position is exited.
These conditions ensure that trades are only executed when clear trends are identified, enhancing the strategy's reliability.
Previous local performance
🔶 7. ATR-Based Take Profit Mechanism
When enabled, the strategy employs a 4-step Take Profit system to systematically secure profits as the trade moves in the desired direction.
TP Price_1 Long = Entry Price + (TP1ATR * ATR Value)
TP Price_2 Long = Entry Price + (TP2ATR * ATR Value)
TP Price_3 Long = Entry Price + (TP3ATR * ATR Value)
TP Price_1 Short = Entry Price - (TP1ATR * ATR Value)
TP Price_2 Short = Entry Price - (TP2ATR * ATR Value)
TP Price_3 Short = Entry Price - (TP3ATR * ATR Value)
- ATR Value: Calculated using ATR over a specified period (e.g., 14).
- TPxATR: User-defined multipliers for each take profit level.
- TPx_percent: Percentage of the position to exit at each TP level.
This multi-tiered exit strategy allows for partial position closures, optimizing profit capture while maintaining exposure to potential further gains.
█ Trade Direction
The Fibonacci ATR Fusion Strategy is designed to operate in both long and short market conditions, providing flexibility to traders in varying market environments.
Long Trades: Initiated when the SMA of the weighted average crosses above the Long Entry Threshold (T_LE), indicating strong upward momentum.
Short Trades: Initiated when the SMA of the weighted average crosses below the Short Entry Threshold (T_SE), signaling robust downward momentum.
Additionally, the strategy can be configured to trade exclusively in one direction—Long, Short, or Both—based on the trader’s preference and market analysis.
█ Usage
Implementing the Fibonacci ATR Fusion Strategy involves several steps to ensure it aligns with your trading objectives and market conditions.
1. Configure Strategy Parameters:
- Trading Direction: Choose between Long, Short, or Both based on your market outlook.
- Trading Condition Thresholds: Set the Long Entry, Short Entry, Long Exit, and Short Exit thresholds to define when to enter and exit trades.
2. Set Take Profit Levels (if enabled):
- ATR Multipliers: Define how many ATRs away from the entry price each take profit level is set.
- Take Profit Percentages: Allocate what percentage of the position to close at each TP level.
3. Apply to Desired Chart:
- Add the strategy to the chart of the asset you wish to trade.
- Observe the plotted Fibonacci ATR and SMA Fibonacci ATR indicators for visual confirmation.
4. Monitor and Adjust:
- Regularly review the strategy’s performance through backtesting.
- Adjust the input parameters based on historical performance and changing market dynamics.
5. Risk Management:
- Ensure that the sum of take profit percentages does not exceed 100% to avoid over-closing positions.
- Utilize the ATR-based TP levels to adapt to varying market volatilities, maintaining a balanced risk-reward ratio.
█ Default Settings
Understanding the default settings is crucial for optimizing the Fibonacci ATR Fusion Strategy's performance. Here's a precise and simple overview of the key parameters and their effects:
🔶 Key Parameters and Their Effects
1. Trading Direction (`tradingDirection`)
- Default: Both
- Effect: Determines whether the strategy takes both long and short positions or restricts to one direction. Selecting Both allows maximum flexibility, while Long or Short can be used for directional bias.
2. Trading Condition Thresholds
Long Entry (long_entry_threshold = 58.0): Higher values reduce false positives but may miss trades.
Short Entry (short_entry_threshold = 42.0): Lower values capture early short trends but may increase false signals.
Long Exit (long_exit_threshold = 42.0): Exits long positions early, securing profits but potentially cutting trends short.
Short Exit (short_exit_threshold = 58.0): Delays short exits to capture favorable movements, avoiding premature exits.
3. Take Profit Configuration (`useTakeProfit` = false)
- Effect: When enabled, the strategy employs a 4-step TP mechanism to secure profits at multiple levels. By default, it is disabled to allow users to opt-in based on their trading style.
4. ATR-Based Take Profit Multipliers
TP1 (tp1ATR = 3.0): Sets the first TP at 3 ATRs for initial profit capture.
TP2 (tp2ATR = 8.0): Targets larger trends, though less likely to be reached.
TP3 (tp3ATR = 14.0): Optimizes for extreme price moves, seldom triggered.
5. Take Profit Percentages
TP Level 1 (tp1_percent = 12%): Secures 12% at the first TP.
TP Level 2 (tp2_percent = 12%): Exits another 12% at the second TP.
TP Level 3 (tp3_percent = 12%): Closes an additional 12% at the third TP.
6. Weighted Average Parameters
Ratio Periods: Fibonacci-based intervals (8, 13, 21, 34, 55) balance responsiveness.
Weights: Emphasizes recent data for timely responses to market trends.
SMA Period (weighted_avg_sma_period = 3): Smoothens data with minimal lag, balancing noise reduction and responsiveness.
7. ATR Period (`atrPeriod` = 14)
Effect: Sets the ATR calculation length, impacting TP sensitivity to volatility.
🔶 Impact on Performance
- Sensitivity and Responsiveness:
- Shorter Ratio Periods and Higher Weights: Make the weighted average more responsive to recent price changes, allowing quicker trade entries and exits but increasing the likelihood of false signals.
- Longer Ratio Periods and Lower Weights: Provide smoother signals with fewer false positives but may delay trade entries, potentially missing out on significant price moves.
- Profit Taking:
- ATR Multipliers: Higher multipliers set take profit levels further away, targeting larger price movements but reducing the probability of reaching these levels.
- Fixed Percentages: Allocating equal percentages at each TP level ensures consistent profit realization and risk management, preventing overexposure.
- Trade Direction Control:
- Selecting Specific Directions: Restricting trades to Long or Short can align the strategy with market trends or personal biases, potentially enhancing performance in trending markets.
- Risk Management:
- Take Profit Percentages: Dividing the position into smaller percentages at multiple TP levels helps lock in profits progressively, reducing risk and allowing the remaining position to ride further trends.
- Market Adaptability:
- Weighted Averages and ATR: By combining multiple timeframes and adjusting to volatility, the strategy adapts to different market conditions, maintaining effectiveness across various asset classes and timeframes.
---
If you want to know more about ATR, can also check "SuperATR 7-Step Profit".
Enjoy trading.
Stoch RSI and RSI Buy/Sell Signals with MACD Trend FilterDescription of the Indicator
This Pine Script is designed to provide traders with buy and sell signals based on the combination of Stochastic RSI, RSI, and MACD indicators, enhanced by the confirmation of candle colors. The primary goal is to facilitate informed trading decisions in various market conditions by utilizing different indicators and their interactions. The script allows customization of various parameters, providing flexibility for traders to adapt it to their specific trading styles.
Usefulness
This indicator is not just a mashup of existing indicators; it integrates the functionality of multiple momentum and trend-detection methods into a cohesive trading tool. The combination of Stochastic RSI, RSI, and MACD offers a well-rounded approach to analyzing market conditions, allowing traders to identify entry and exit points effectively. The inclusion of color-coded signals (strong vs. weak) further enhances its utility by providing visual cues about the strength of the signals.
How to Use This Indicator
Input Settings: Adjust the parameters for the Stochastic RSI, RSI, and MACD to fit your trading style. Set the overbought/oversold levels according to your risk tolerance.
Signal Colors:
Strong Buy Signal: Indicated by a green label and confirmed by a green candle (close > open).
Weak Buy Signal: Indicated by a blue label and confirmed by a green candle (close > open).
Strong Sell Signal: Indicated by a red label and confirmed by a red candle (close < open).
Weak Sell Signal: Indicated by an orange label and confirmed by a red candle (close < open).
Example Trading Strategy Using This Indicator
To effectively use this indicator as part of your trading strategy, follow these detailed steps:
Setup:
Timeframe : Select a timeframe that aligns with your trading style (e.g., 15-minute for intraday, 1-hour for swing trading, or daily for longer-term positions).
Indicator Settings : Customize the Stochastic RSI, RSI, and MACD parameters to suit your trading approach. Adjust overbought/oversold levels to match your risk tolerance.
Strategy:
1. Strong Buy Entry Criteria :
Wait for a strong buy signal (green label) when the RSI is at or below the oversold level (e.g., ≤ 35), indicating a deeply oversold market. Confirm that the MACD shows a decreasing trend (bearish momentum weakening) to validate a potential reversal. Ensure the current candle is green (close > open) if candle color confirmation is enabled.
Example Use : On a 1-hour chart, if the RSI drops below 35, MACD shows three consecutive bars of decreasing negative momentum, and a green candle forms, enter a buy position. This setup signals a robust entry with strong momentum backing it.
2. Weak Buy Entry Criteria :
Monitor for weak buy signals (blue label) when RSI is above the oversold level but still below the neutral (e.g., between 36 and 50). This indicates a market recovering from an oversold state but not fully reversing yet. These signals can be used for early entries with additional confirmations, such as support levels or higher timeframe trends.
Example Use : On the same 1-hour chart, if RSI is at 45, the MACD shows momentum stabilizing (not necessarily negative), and a green candle appears, consider a partial or cautious entry. Use this as an early warning for a potential bullish move, especially when higher timeframe indicators align.
3. Strong Sell Entry Criteria :
Look for a strong sell signal (red label) when RSI is at or above the overbought level (e.g., ≥ 65), signaling a strong overbought condition. The MACD should show three consecutive bars of increasing positive momentum to indicate that the bullish trend is weakening. Ensure the current candle is red (close < open) if candle color confirmation is enabled.
Example Use : If RSI reaches 70, MACD shows increasing momentum that starts to level off, and a red candle forms on a 1-hour chart, initiate a short position with a stop loss set above recent resistance. This is a high-confidence signal for potential price reversal or pullback.
4. Weak Sell Entry Criteria :
Use weak sell signals (orange label) when RSI is between the neutral and overbought levels (e.g., between 50 and 64). These can indicate potential short opportunities that might not yet be fully mature but are worth monitoring. Look for other confirmations like resistance levels or trendline touches to strengthen the signal.
Example Use : If RSI reads 60 on a 1-hour chart, and the MACD shows slight positive momentum with signs of slowing down, place a cautious sell position or scale out of existing long positions. This setup allows you to prepare for a possible downtrend.
Trade Management:
Stop Loss : For buy trades, place stop losses below recent swing lows. For sell trades, set stops above recent swing highs to manage risk effectively.
Take Profit : Target nearby resistance or support levels, apply risk-to-reward ratios (e.g., 1:2), or use trailing stops to lock in profits as price moves in your favor.
Confirmation : Align these signals with broader trends on higher timeframes. For example, if you receive a weak buy signal on a 15-minute chart, check the 1-hour or daily chart to ensure the overall trend is not bearish.
Real-World Example: Imagine trading on a 15-minute chart :
For a buy:
A strong buy signal (green) appears when the RSI dips to 32, MACD shows declining bearish momentum, and a green candle forms. Enter a buy position with a stop loss below the most recent support level.
Alternatively, a weak buy signal (blue) appears when RSI is at 47. Use this as a signal to start monitoring the market closely or enter a smaller position if other indicators (like support and volume analysis) align.
For a sell:
A strong sell signal (red) with RSI at 72 and a red candle signals to short with conviction. Place your stop loss just above the last peak.
A weak sell signal (orange) with RSI at 62 might prompt caution but can still be acted on if confirmed by declining volume or touching a resistance level.
These strategies show how to blend both strong and weak signals into your trading for more nuanced decision-making.
Technical Analysis of the Code
1. Stochastic RSI Calculation:
The script calculates the Stochastic RSI (stochRsiK) using the RSI as input and smooths it with a moving average (stochRsiD).
Code Explanation : ta.stoch(rsi, rsi, rsi, stochLength) computes the Stochastic RSI, and ta.sma(stochRsiK, stochSmoothing) applies smoothing.
2. RSI Calculation :
The RSI is computed over a user-defined period and checks for overbought or oversold conditions.
Code Explanation : rsi = ta.rsi(close, rsiLength) calculates RSI values.
3. MACD Trend Filter :
MACD is calculated with fast, slow, and signal lengths, identifying trends via three consecutive bars moving in the same direction.
Code Explanation : = ta.macd(close, macdLengthFast, macdLengthSlow, macdSignalLength) sets MACD values. Conditions like macdLine < macdLine confirm trends.
4. Buy and Sell Conditions :
The script checks Stochastic RSI, RSI, and MACD values to set buy/sell flags. Candle color filters further confirm valid entries.
Code Explanation : buyConditionMet and sellConditionMet logically check all conditions and toggles (enableStochCondition, enableRSICondition, etc.).
5. Signal Flags and Confirmation :
Flags track when conditions are met and ensure signals only appear on appropriate candle colors.
Code Explanation : Conditional blocks (if statements) update buyFlag and sellFlag.
6. Labels and Alerts :
The indicator plots "BUY" or "SELL" labels with the RSI value when signals trigger and sets alerts through alertcondition().
Code Explanation : label.new() displays the signal, color-coded for strength based on RSI.
NOTE : All strategies can be enabled or disabled in the settings, allowing traders to customize the indicator to their preferences and trading styles.
MMRI Chart (Primary)The **Mannarino Market Risk Indicator (MMRI)** is a financial risk measurement tool created by financial strategist Gregory Mannarino. It’s designed to assess the risk level in the stock market and economy based on current bond market conditions and the strength of the U.S. dollar. The MMRI considers factors like the U.S. 10-Year Treasury Yield and the Dollar Index (DXY), which indicate investor confidence in government debt and the dollar's purchasing power, respectively.
The formula for MMRI uses the 10-Year Treasury Yield multiplied by the Dollar Index, divided by a constant (1.61) to normalize the risk measure. A higher MMRI score suggests increased market risk, while a lower score indicates more stability. Mannarino has set certain thresholds to interpret the MMRI score:
- **Below 100**: Low risk.
- **100–200**: Moderate risk.
- **200–300**: High risk.
- **Above 300**: Extreme risk, indicating market instability and potential downturns.
This tool aims to provide insight into economic conditions that may affect asset classes like stocks, bonds, and precious metals. Mannarino often updates MMRI scores and risk analyses in his public market updates.
Z-Score RSI StrategyOverview
The Z-Score RSI Indicator is an experimental take on momentum analysis. By applying the Relative Strength Index (RSI) to a Z-score of price data, it measures how far prices deviate from their mean, scaled by standard deviation. This isn’t your traditional use of RSI, which is typically based on price data alone. Nevertheless, this unconventional approach can yield unique insights into market trends and potential reversals.
Theory and Interpretation
The RSI calculates the balance between average gains and losses over a set period, outputting values from 0 to 100. Typically, people look at the overbought or oversold levels to identify momentum extremes that might be likely to lead to a reversal. However, I’ve often found that RSI can be effective for trend-following when observing the crossover of its moving average with the midline or the crossover of the RSI with its own moving average. These crossovers can provide useful trend signals in various market conditions.
By combining RSI with a Z-score of price, this indicator estimates the relative strength of the price’s distance from its mean. Positive Z-score trends may signal a potential for higher-than-average prices in the near future (scaled by the standard deviation), while negative trends suggest the opposite. Essentially, when the Z-Score RSI indicates a trend, it reflects that the Z-score (the distance between the average and current price) is likely to continue moving in the trend’s direction. Generally, this signals a potential price movement, though it’s important to note that this could also occur if there’s a shift in the mean or standard deviation, rather than a meaningful change in price itself.
While the Z-Score RSI could be an insightful addition to a comprehensive trading system, it should be interpreted carefully. Mean shifts may validate the indicator’s predictions without necessarily indicating any notable price change, meaning it’s best used in tandem with other indicators or strategies.
Recommendations
Before putting this indicator to use, conduct thorough backtesting and avoid overfitting. The added parameters allow fine-tuning to fit various assets, but be careful not to optimize purely for the highest historical returns. Doing so may create an overly tailored strategy that performs well in backtests but fails in live markets. Keep it balanced and look for robust performance across multiple scenarios, as overfitting is likely to lead to disappointing real-world results.
Equilibrium Candles + Pattern [Honestcowboy]The Equilibrium Candles is a very simple trend continuation or reversal strategy depending on your settings.
How an Equilibrium Candle is created:
We calculate the equilibrium by measuring the mid point between highest and lowest point over X amount of bars back.
This now is the opening price for each bar and will be considered a green bar if price closes above equilibrium.
Bars get shaded by checking if regular candle close is higher than open etc. So you still see what the normal candles are doing.
Why are they useful?
The equilibrium is calculated the same as Baseline in Ichimoku Cloud. Which provides a point where price is very likely to retrace to. This script visualises the distance between close and equilibrium using candles. To provide a clear visual of how price relates to this equilibrium point.
This also makes it more straightforward to develop strategies based on this simple concept and makes the trader purely focus on this relationship and not think of any Ichimoku Cloud theories.
Script uses a very simple pattern to enter trades:
It will count how many candles have been one directional (above or below equilibrium)
Based on user input after X candles (7 by default) script shows we are in a trend (bg colors)
On the first pullback (candle closes on other side of equilibrium) it will look to enter a trade.
Places a stop order at the high of the candle if bullish trend or reverse if bearish trend.
If based on user input after X opposite candles (2 by default) order is not filled will cancel it and look for a new trend.
Use Reverse Logic:
There is a use reverse logic in the settings which on default is turned on. It will turn long orders into short orders making the stop orders become limit orders. It will use the normal long SL as target for the short. And TP as stop for the short. This to provide a means to reverse equity curve in case your pair is mean reverting by nature instead of trending.
ATR Calculation:
Averaged ATR, which is using ta.percentile_nearest_rank of 60% of a normal ATR (14 period) over the last 200 bars. This in simple words finds a value slightly above the mean ATR value over that period.
Big Candle Exit Logic:
Using Averaged ATR the script will check if a candle closes X times that ATR from the equilibrium point. This is then considered an overextension and all trades are closed.
This is also based on user input.
Simple trade management logic:
Checks if the user has selected to use TP and SL, or/and big candle exit.
Places a TP and SL based on averaged ATR at a multiplier based on user Input.
Closes trade if there is a Big Candle Exit or an opposite direction signal from indicator.
Script can be fully automated to MT5
There are risk settings in % and symbol settings provided at the bottom of the indicator. The script will send alert to MT5 broker trying to mimic the execution that happens on tradingview. There are always delays when using a bridge to MT5 broker and there could be errors so be mindful of that. This script sends alerts in format so they can be read by tradingview.to which is a bridge between the platforms.
Use the all alert function calls feature when setting up alerts and make sure you provide the right webhook if you want to use this approach.
There is also a simple buy and sell alert feature if you don't want to fully automate but still get alerts. These are available in the dropdown when creating an alert.
Almost every setting in this indicator has a tooltip added to it. So if any setting is not clear hover over the (?) icon on the right of the setting.
The backtest uses a 4% exposure per trade and a 10 point slippage. I did not include a commission cause I'm not personaly aware what the commissions are on most forex brokers. I'm only aware of minimal slippage to use in a backtest. Trading conditions vary per broker you use so always pay close attention to trading costs on your own broker. Use a full automation at your own risk and discretion and do proper backtesting.
SuperATR 7-Step Profit - Strategy [presentTrading] Long time no see!
█ Introduction and How It Is Different
The SuperATR 7-Step Profit Strategy is a multi-layered trading approach that integrates adaptive Average True Range (ATR) calculations with momentum-based trend detection. What sets this strategy apart is its sophisticated 7-step take-profit mechanism, which combines four ATR-based exit levels and three fixed percentage levels. This hybrid approach allows traders to dynamically adjust to market volatility while systematically capturing profits in both long and short market positions.
Traditional trading strategies often rely on static indicators or single-layered exit strategies, which may not adapt well to changing market conditions. The SuperATR 7-Step Profit Strategy addresses this limitation by:
- Using Adaptive ATR: Enhances the standard ATR by making it responsive to current market momentum.
- Incorporating Momentum-Based Trend Detection: Identifies stronger trends with higher probability of continuation.
- Employing a Multi-Step Take-Profit System: Allows for gradual profit-taking at predetermined levels, optimizing returns while minimizing risk.
BTCUSD 6hr Performance
█ Strategy, How It Works: Detailed Explanation
The strategy revolves around detecting strong market trends and capitalizing on them using an adaptive ATR and momentum indicators. Below is a detailed breakdown of each component of the strategy.
🔶 1. True Range Calculation with Enhanced Volatility Detection
The True Range (TR) measures market volatility by considering the most significant price movements. The enhanced TR is calculated as:
TR = Max
Where:
High and Low are the current bar's high and low prices.
Previous Close is the closing price of the previous bar.
Abs denotes the absolute value.
Max selects the maximum value among the three calculations.
🔶 2. Momentum Factor Calculation
To make the ATR adaptive, the strategy incorporates a Momentum Factor (MF), which adjusts the ATR based on recent price movements.
Momentum = Close - Close
Stdev_Close = Standard Deviation of Close over n periods
Normalized_Momentum = Momentum / Stdev_Close (if Stdev_Close ≠ 0)
Momentum_Factor = Abs(Normalized_Momentum)
Where:
Close is the current closing price.
n is the momentum_period, a user-defined input (default is 7).
Standard Deviation measures the dispersion of closing prices over n periods.
Abs ensures the momentum factor is always positive.
🔶 3. Adaptive ATR Calculation
The Adaptive ATR (AATR) adjusts the traditional ATR based on the Momentum Factor, making it more responsive during volatile periods and smoother during consolidation.
Short_ATR = SMA(True Range, short_period)
Long_ATR = SMA(True Range, long_period)
Adaptive_ATR = /
Where:
SMA is the Simple Moving Average.
short_period and long_period are user-defined inputs (defaults are 3 and 7, respectively).
🔶 4. Trend Strength Calculation
The strategy quantifies the strength of the trend to filter out weak signals.
Price_Change = Close - Close
ATR_Multiple = Price_Change / Adaptive_ATR (if Adaptive_ATR ≠ 0)
Trend_Strength = SMA(ATR_Multiple, n)
🔶 5. Trend Signal Determination
If (Short_MA > Long_MA) AND (Trend_Strength > Trend_Strength_Threshold):
Trend_Signal = 1 (Strong Uptrend)
Elif (Short_MA < Long_MA) AND (Trend_Strength < -Trend_Strength_Threshold):
Trend_Signal = -1 (Strong Downtrend)
Else:
Trend_Signal = 0 (No Clear Trend)
🔶 6. Trend Confirmation with Price Action
Adaptive_ATR_SMA = SMA(Adaptive_ATR, atr_sma_period)
If (Trend_Signal == 1) AND (Close > Short_MA) AND (Adaptive_ATR > Adaptive_ATR_SMA):
Trend_Confirmed = True
Elif (Trend_Signal == -1) AND (Close < Short_MA) AND (Adaptive_ATR > Adaptive_ATR_SMA):
Trend_Confirmed = True
Else:
Trend_Confirmed = False
Local Performance
🔶 7. Multi-Step Take-Profit Mechanism
The strategy employs a 7-step take-profit system
█ Trade Direction
The SuperATR 7-Step Profit Strategy is designed to work in both long and short market conditions. By identifying strong uptrends and downtrends, it allows traders to capitalize on price movements in either direction.
Long Trades: Initiated when the market shows strong upward momentum and the trend is confirmed.
Short Trades: Initiated when the market exhibits strong downward momentum and the trend is confirmed.
█ Usage
To implement the SuperATR 7-Step Profit Strategy:
1. Configure the Strategy Parameters:
- Adjust the short_period, long_period, and momentum_period to match the desired sensitivity.
- Set the trend_strength_threshold to control how strong a trend must be before acting.
2. Set Up the Multi-Step Take-Profit Levels:
- Define ATR multipliers and fixed percentage levels according to risk tolerance and profit goals.
- Specify the percentage of the position to close at each level.
3. Apply the Strategy to a Chart:
- Use the strategy on instruments and timeframes where it has been tested and optimized.
- Monitor the positions and adjust parameters as needed based on performance.
4. Backtest and Optimize:
- Utilize TradingView's backtesting features to evaluate historical performance.
- Adjust the default settings to optimize for different market conditions.
█ Default Settings
Understanding default settings is crucial for optimal performance.
Short Period (3): Affects the responsiveness of the short-term MA.
Effect: Lower values increase sensitivity but may produce more false signals.
Long Period (7): Determines the trend baseline.
Effect: Higher values reduce noise but may delay signals.
Momentum Period (7): Influences adaptive ATR and trend strength.
Effect: Shorter periods react quicker to price changes.
Trend Strength Threshold (0.5): Filters out weaker trends.
Effect: Higher thresholds yield fewer but stronger signals.
ATR Multipliers: Set distances for ATR-based exits.
Effect: Larger multipliers aim for bigger moves but may reduce hit rate.
Fixed TP Levels (%): Control profit-taking on smaller moves.
Effect: Adjusting these levels affects how quickly profits are realized.
Exit Percentages: Determine how much of the position is closed at each TP level.
Effect: Higher percentages reduce exposure faster, affecting risk and reward.
Adjusting these variables allows you to tailor the strategy to different market conditions and personal risk preferences.
By integrating adaptive indicators and a multi-tiered exit strategy, the SuperATR 7-Step Profit Strategy offers a versatile tool for traders seeking to navigate varying market conditions effectively. Understanding and adjusting the key parameters enables traders to harness the full potential of this strategy.