Nifty 3-min Options Pro Strategy (Fixed Version)This strategy is designed specifically for high-probability intraday options trading on the Nifty 3-5 minute chart.
It intelligently combines CPR (Central Pivot Range) and VWAP to define the market's bias (bullish or bearish) and detects Inside Bar Breakouts to pinpoint low-risk, high-reward entries.
The strategy automatically:
Identifies Buy Signals for CE (Call Options) when conditions are bullish.
Identifies Buy Signals for PE (Put Options) when conditions are bearish.
Plots dynamic CPR and VWAP levels on the chart.
Applies ATR-based Stop Loss and trailing stop loss for risk management.
Generates real-time alerts for quick trading actions.
The trading logic is time-filtered to operate only during optimal intraday hours (9:00 AM to 2:30 PM), avoiding low-volume traps and volatile close sessions.
Designed to help traders capture strong directional moves early, this strategy is perfect for Nifty scalpers and intraday options traders aiming for consistent profitability.
Indicators and strategies
Sharpe Ratio Forced Selling StrategyThis study introduces the “Sharpe Ratio Forced Selling Strategy”, a quantitative trading model that dynamically manages positions based on the rolling Sharpe Ratio of an asset’s excess returns relative to the risk-free rate. The Sharpe Ratio, first introduced by Sharpe (1966), remains a cornerstone in risk-adjusted performance measurement, capturing the trade-off between return and volatility. In this strategy, entries are triggered when the Sharpe Ratio falls below a specified low threshold (indicating excessive pessimism), and exits occur either when the Sharpe Ratio surpasses a high threshold (indicating optimism or mean reversion) or when a maximum holding period is reached.
The underlying economic intuition stems from institutional behavior. Institutional investors, such as pension funds and mutual funds, are often subject to risk management mandates and performance benchmarking, requiring them to reduce exposure to assets that exhibit deteriorating risk-adjusted returns over rolling periods (Greenwood and Scharfstein, 2013). When risk-adjusted performance improves, institutions may rebalance or liquidate positions to meet regulatory requirements or internal mandates, a behavior that can be proxied effectively through a rising Sharpe Ratio.
By systematically monitoring the Sharpe Ratio, the strategy anticipates when “forced selling” pressure is likely to abate, allowing for opportunistic entries into assets priced below fundamental value. Exits are equally mechanized, either triggered by Sharpe Ratio improvements or by a strict time-based constraint, acknowledging that institutional rebalancing and window-dressing activities are often time-bound (Coval and Stafford, 2007).
The Sharpe Ratio is particularly suitable for this framework due to its ability to standardize excess returns per unit of risk, ensuring comparability across timeframes and asset classes (Sharpe, 1994). Furthermore, adjusting returns by a dynamically updating short-term risk-free rate (e.g., US 3-Month T-Bills from FRED) ensures that macroeconomic conditions, such as shifting interest rates, are accurately incorporated into the risk assessment.
While the Sharpe Ratio is an efficient and widely recognized measure, the strategy could be enhanced by incorporating alternative or complementary risk metrics:
• Sortino Ratio: Unlike the Sharpe Ratio, the Sortino Ratio penalizes only downside volatility (Sortino and van der Meer, 1991). This would refine entries and exits to distinguish between “good” and “bad” volatility.
• Maximum Drawdown Constraints: Integrating a moving window maximum drawdown filter could prevent entries during persistent downtrends not captured by volatility alone.
• Conditional Value at Risk (CVaR): A measure of expected shortfall beyond the Value at Risk, CVaR could further constrain entry conditions by accounting for tail risk in extreme environments (Rockafellar and Uryasev, 2000).
• Dynamic Thresholds: Instead of static Sharpe thresholds, one could implement dynamic bands based on the historical distribution of the Sharpe Ratio, adjusting for volatility clustering effects (Cont, 2001).
Each of these risk parameters could be incorporated into the current script as additional input controls, further tailoring the model to different market regimes or investor risk appetites.
References
• Cont, R. (2001) ‘Empirical properties of asset returns: stylized facts and statistical issues’, Quantitative Finance, 1(2), pp. 223-236.
• Coval, J.D. and Stafford, E. (2007) ‘Asset Fire Sales (and Purchases) in Equity Markets’, Journal of Financial Economics, 86(2), pp. 479-512.
• Greenwood, R. and Scharfstein, D. (2013) ‘The Growth of Finance’, Journal of Economic Perspectives, 27(2), pp. 3-28.
• Rockafellar, R.T. and Uryasev, S. (2000) ‘Optimization of Conditional Value-at-Risk’, Journal of Risk, 2(3), pp. 21-41.
• Sharpe, W.F. (1966) ‘Mutual Fund Performance’, Journal of Business, 39(1), pp. 119-138.
• Sharpe, W.F. (1994) ‘The Sharpe Ratio’, Journal of Portfolio Management, 21(1), pp. 49-58.
• Sortino, F.A. and van der Meer, R. (1991) ‘Downside Risk’, Journal of Portfolio Management, 17(4), pp. 27-31.
Scalping Strategy with Fixed CooldownThis is a sample scalping strategy is designed for short-term trading on lower timeframes.
Entry Signals: Utilizes Hull Moving Average (HullMA) crossovers to generate buy and sell signals.
Filters:
-Bollinger Bands and RSI to avoid overbought or oversold conditions.
-VWAP to confirm trend direction, ensuring trades align with momentum.
Cooldown Mechanism: Implements a bar-based cooldown period to prevent immediate re-entries after trade closures, reducing the risk of overtrading.
Express Generator StrategyExpress Generator Strategy
Pine Script™ v6
The Express Generator Strategy is an algorithmic trading system that harnesses confluence from multiple technical indicators to optimize trade entries and dynamic risk management. Developed in Pine Script v6, it is designed to operate within a user-defined backtesting period—ensuring that trades are executed only during chosen historical windows for targeted analysis.
How It Works:
- Entry Conditions:
The strategy relies on a dual confirmation approach:- A moving average crossover system where a fast (default 9-period SMA) crossing above or below a slower (default 21-period SMA) average signals a potential trend reversal.
- MACD confirmation; trades are only initiated when the MACD line crosses its signal line in the direction of the moving average signal.
- An RSI filter refines these signals by preventing entries when the market might be overextended—ensuring that long entries only occur when the RSI is below an overbought level (default 70) and short entries when above an oversold level (default 30).
- Risk Management & Dynamic Position Sizing:
The strategy takes a calculated approach to risk by enabling the adjustment of position sizes using:- A pre-defined percentage of equity risk per trade (default 1%, adjustable between 0.5% to 3%).
- A stop-loss set in pips (default 100 pips, with customizable ranges), which is then adjusted by market volatility measured through the ATR.
- Trailing stops (default 50 pips) to help protect profits as the market moves favorably.
This combination of volatility-adjusted risk and equity-based position sizing aims to harmonize trade exposure with prevailing market conditions.
- Backtest Period Flexibility:
Users can define the start and end dates for backtesting (e.g., January 1, 2020 to December 31, 2025). This ensures that the strategy only opens trades within the intended analysis window. Moreover, if the strategy is still holding a position outside this period, it automatically closes all trades to prevent unwanted exposure.
- Visual Insights:
For clarity, the strategy plots the fast (blue) and slow (red) moving averages directly on the chart, allowing for visual confirmation of crossovers and trend shifts.
By integrating multiple technical indicators with robust risk management and adaptable position sizing, the Express Generator Strategy provides a comprehensive framework for capturing trending moves while prudently managing downside risk. It’s ideally suited for traders looking to combine systematic entries with a disciplined and dynamic risk approach.
Gaussian Channel StrategyGaussian Channel Strategy — User Guide
1. Concept
This strategy builds trades around the Gaussian Channel. Based on Pine Script v4 indicator originally published by Donovan Wall. With rework to v6 Pine Script and adding entry and exit functions.
The channel consists of three dynamic lines:
Line Formula Purpose
Filter (middle) N-pole Gaussian filter applied to price Market "equilibrium"
High Band Filter + (Filtered TR × mult) Dynamic upper envelope
Low Band Filter − (Filtered TR × mult) Dynamic lower envelope
A position is opened when price crosses a user-selected line in a user-selected direction.
When the smoothed True Range (Filtered TR) becomes negative, the raw bands can flip (High drops below Low).
The strategy automatically reorders them so the upper band is always above the lower band.
Visual colors still flip, but signals stay correct.
2. Entry Logic
Choose a signal line for longs and/or shorts: Filter, Upper band, or Lower band.
Choose a cross direction (Cross Up or Cross Down).
A signal remains valid for Lookback bars after the actual cross, as long as price is still on the required side of the line.
When the opposite signal appears, the current position is closed or reversed depending on Reverse on opposite.
3. Parameters
Group Setting Meaning
Source & Filter Source Price series used (close, hlc3, etc.)
Poles (N) Number of Gaussian filter poles (1-9). More poles ⇒ smoother but laggier
Sampling Period Main period length of the channel
Filtered TR Multiplier Width of the bands in fractions of smoothed True Range
Reduced Lag Mode Adds a lag-compensation term (faster but noisier)
Fast Response Mode Blends 1-pole & N-pole outputs for quicker turns
Signals Long → signal line / Short → signal line Which line generates signals
Long when price / Short when price Direction of the cross
Lookback bars for late entry Bars after the cross that still allow an entry
Trading Enable LONG/SHORT-side trades Turn each side on/off
On opposite signal: reverse True: reverse -- False: flat
Misc Start trading date Ignores signals before this timestamp (back-test focus)
4. Quick Start
Add the strategy to a chart. Default: hlc3, N = 4, Period = 144.
Select your signal lines & directions.
Example: trend trading – Long: Filter + Cross Up, Short: Filter + Cross Down.
Disable either side if you want long-only or short-only.
Tune Lookback (e.g. 3) to catch gaps and strong impulses.
Run Strategy Tester, optimise period / multiplier / stops (add strategy.exit blocks if needed).
When satisfied, connect alerts via TradingView webhooks or use the builtin broker panel.
5. Notes
Commission & slippage are not preset – adjust them in Properties → Commission & Slippage.
Works on any market and timeframe, but you should retune Sampling Period and Multiplier for each symbol.
No stop-loss / take-profit is included by default – feel free to add with strategy.exit.
Start trading date lets you back-test only recent history (e.g. last two years).
6. Disclaimer
This script is for educational purposes only and does not constitute investment advice.
Use entirely at your own risk. Back-test thoroughly and apply sound risk management before trading real capital.
ES Stoch RSI [Krypt] Strategy//@version=6
strategy("ES Stoch RSI Strategy", overlay=false, precision=1)
// Constants
PI = 3.14159265359
// Functions
drop1st(src) =>
var float x = na
x := na(src ) ? na : src
xlowest(src, len) =>
var float x = src
for i = 1 to len - 1
v = src
if na(v)
break
x := math.min(x, v)
x
xhighest(src, len) =>
var float x = src
for i = 1 to len - 1
v = src
if na(v)
break
x := math.max(x, v)
x
xstoch(c, h, l, len) =>
float xlow = xlowest(l, len)
float xhigh = xhighest(h, len)
100 * (c - xlow) / (xhigh - xlow)
Stochastic(c, h, l, length) =>
float rawsig = xstoch(c, h, l, length)
math.min(math.max(rawsig, 0.0), 100.0)
xrma(src, len) =>
var float sum = na
sum := (src + (len - 1) * nz(sum , src)) / len
xrsi(src, len) =>
msig = nz(ta.change(src), 0.0)
up = xrma(math.max(msig, 0.0), len)
dn = xrma(math.max(-msig, 0.0), len)
rs = up / dn
100.0 - 100.0 / (1.0 + rs)
EhlersSuperSmoother(src, lower) =>
a1 = math.exp(-PI * math.sqrt(2) / lower)
coeff2 = 2 * a1 * math.cos(math.sqrt(2) * PI / lower)
coeff3 = -math.pow(a1, 2)
coeff1 = (1 - coeff2 - coeff3) / 2
var float filt = na
filt := nz(coeff1 * (src + nz(src , src)) + coeff2 * nz(filt , src) + coeff3 * nz(filt , src))
// Inputs
smoothK = input.int(10, minval=1, title="K")
smoothD = input.int(3, minval=1, title="D")
lengthRSI = input.int(14, minval=1, title="RSI Length")
lengthStoch = input.int(14, minval=1, title="Stochastic Length")
showsignals = input.bool(true, title="Buy/Sell Signals")
src = input.source(close, title="Source")
ob = 80
os = 20
midpoint = 50
// Indicator Calculations
price = math.log(drop1st(src))
rsi1 = xrsi(price, lengthRSI)
rawsig = Stochastic(rsi1, rsi1, rsi1, lengthStoch)
sig = EhlersSuperSmoother(rawsig, smoothK)
ma = ta.sma(sig, smoothD)
// Strategy Logic
mm1 = ta.change(ta.change(ma))
mm2 = ta.change(ta.change(ma ))
ms1 = ta.change(ta.change(sig))
ms2 = ta.change(ta.change(sig ))
sellsignals = showsignals and (mm1 + ms1 < 0 and mm2 + ms2 < 0) and ta.crossunder(sig, ma) and sig > midpoint
buysignals = showsignals and (mm1 + ms1 > 0 and mm2 + ms2 > 0) and ta.crossover(sig, ma) and sig < midpoint
if (buysignals)
strategy.close("Short")
strategy.entry("Long", strategy.long)
if (sellsignals)
strategy.close("Long")
strategy.entry("Short", strategy.short)
// Exits
if (sellsignals)
strategy.close("Long")
if (buysignals)
strategy.close("Short")
// Plots
plot(sig, color=color.blue, title="K")
plot(ma, color=color.orange, title="D")
lineOB = hline(ob, title="Upper Band", color=color.gray)
lineOS = hline(os, title="Lower Band", color=color.gray)
fill(lineOB, lineOS, color=color.new(color.purple, 90))
ploff = 4
plot(buysignals ? sig - ploff : na, style=plot.style_circles, color=color.new(color.blue, 0), linewidth=3, title="Buy Signal")
plot(sellsignals ? sig + ploff : na, style=plot.style_circles, color=color.new(color.red, 0), linewidth=3, title="Sell Signal")
Price Flip StrategyPrice Flip Strategy with User-Defined Ticker Max/Max
This strategy leverages an inverted price calculation based on user-defined maximum and minimum price levels over customizable lookback periods. It generates buy and sell signals by comparing the previous bar's original price to the inverted price, within a specified date range. The script plots key metrics, including ticker max/min, original and inverted prices, moving averages, and HLCC4 averages, with customizable visibility toggles and labels for easy analysis.
Key Features:
Customizable Inputs: Set lookback periods for ticker max/min, moving average length, and date range for signal generation.
Inverted Price Logic: Calculates an inverted price using ticker max/min to identify trading opportunities.
Flexible Visualization: Toggle visibility for plots (e.g., ticker max/min, prices, moving averages, HLCC4 averages) and last-bar labels with user-defined colors and sizes.
Trading Signals: Generates buy signals when the previous original price exceeds the inverted price, and sell signals when it falls below, with alerts for real-time notifications.
Labeling: Displays values on the last bar for all plotted metrics, aiding in quick reference.
How to Use:
Add to Chart: Apply the script to a TradingView chart via the Pine Editor.
Configure Settings:
Date Range: Set the start and end dates to define the active trading period.
Ticker Levels: Adjust the lookback periods for calculating ticker max and min (e.g., 100 bars for max, 100 for min).
Moving Averages: Set the length for exponential moving averages (default: 20 bars).
Plots and Labels: Enable/disable specific plots (e.g., Inverted Price, Original HLCC4) and customize label colors/sizes for clarity.
Interpret Signals:
Buy Signal: Triggered when the previous close price is above the inverted price; marked with an upward label.
Sell Signal: Triggered when the previous close price is below the inverted price; marked with a downward label.
Set Alerts: Use the built-in alert conditions to receive notifications for buy/sell signals.
Analyze Plots: Review plotted lines (e.g., ticker max/min, HLCC4 averages) and last-bar labels to assess price behavior.
Tips:
Use in trending markets by enabling ticker max for uptrends or ticker min for downtrends, as indicated in tooltips.
Adjust the label offset to prevent overlapping text on the last bar.
Test the strategy on a demo account to optimize lookback periods and moving average settings for your asset.
Disclaimer: This script is for educational purposes and should be tested thoroughly before use in live trading. Past performance is not indicative of future results.
Ultimate SuperTrend ProThe ultimate script works correctly while maintaining all the original features:
Customizable Inputs:
Separate input groups for SuperTrend, visualization, profit booking, and risk management
Adjustable ATR length and multiplier
Cloud opacity control
ATR-Based Cloud Visualization:
Bullish trend shows green cloud between upper band and upper band - 0.5 ATR
Bearish trend shows red cloud between lower band and lower band + 0.5 ATR
Adjustable opacity for better chart visibility
Profit Booking System:
Calculates profit booking levels based on ATR multiplier
Visual markers (circles) show where to take profits
Arrows appear when price hits profit booking level
Fully customizable color and ratio
Enhanced Risk Management:
ATR-based stop loss system
Visual indication of stop levels in the info table
Option to disable stop loss if desired
Improved Visual Feedback:
Cleaner signal markers
Comprehensive info table showing current status
Distance to profit booking level displayed
Strategy Integration:
Automatically exits positions at profit booking levels
Stop loss protection
Clear alert conditions
RSI-WMA + EMA Trend Filter | SL/TP DynamicA Simple Edge in Trending Markets
Base on RSI & WMA (RSI) Cross with EMA for trend filter.
Yüzde 5 Kar ve Yüzde 2 Zarar Stop Stratejisi15 dk grafikte rsi,hacim,bollinger bantları kullanarak strateji oluşturur.
MTF Supertrend + Gann HL Strategy//@version=5
strategy("MTF Supertrend + Gann HL Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === Inputs ===
atrPeriod = input.int(10, "ATR Period")
factor = input.float(3.0, "Supertrend Multiplier")
gannLength = input.int(10, "Gann HL Period")
// === Timeframes ===
higherTF = "15"
lowerTF = "5"
// === Supertrend & Gann HL (15m) ===
= request.security(syminfo.tickerid, higherTF, ta.supertrend(factor, atrPeriod))
gannHigh15 = request.security(syminfo.tickerid, higherTF, ta.highest(high, gannLength))
gannLow15 = request.security(syminfo.tickerid, higherTF, ta.lowest(low, gannLength))
// === Supertrend & Gann HL (5m) for exit ===
= request.security(syminfo.tickerid, lowerTF, ta.supertrend(factor, atrPeriod))
gannHigh5 = request.security(syminfo.tickerid, lowerTF, ta.highest(high, gannLength))
gannLow5 = request.security(syminfo.tickerid, lowerTF, ta.lowest(low, gannLength))
// === Entry Conditions (15m) ===
longEntry = close > st15 and close > gannHigh15
shortEntry = close < st15 and close < gannLow15
// === Exit Conditions (5m) ===
longExit = close < st5 and close < gannHigh5
shortExit = close > st5 and close > gannLow5
// === Execute Strategy ===
if (longEntry)
strategy.entry("Long", strategy.long)
if (shortEntry)
strategy.entry("Short", strategy.short)
if (longExit)
strategy.close("Long")
if (shortExit)
strategy.close("Short")
// === Optional Plots ===
plot(st15, color=dir15 ? color.green : color.red, title="Supertrend 15m")
Yüzde 5 Kar ve Yüzde 2 Zarar Stop Stratejisi15 dk grafikde rsi,bollinger bantları,fiyat,hacim kullanarak işlem yapmak için kullanılabilir.
Estrategia Martillo / Estrella Fugaz by RouroThis strategy is based on the detection of reversal candlesticks:
Hammer in bearish zones
Shooting Star in bullish zones
Both candles indicate a possible change in trend, but you don't enter directly. Instead, this strategy awaits confirmation through a breakout of the high or low of the pattern candlestick.
📌 Entry Conditions:
Hammer → LONG Entry if the next candle breaks the hammer candle's high.
Shooting Star → SHORT Entry if the next candle breaks the low of the star candle.
Optionally, a time filter can be activated (e.g. operate only from 08:00 to 14:00 UTC).
🎯 Dynamic TP and SL:
The Stop Loss is placed at the end of the pattern (low or high) or, if desired, on a configurable previous candle.
Take Profit is automatically calculated with a configurable Risk/Reward (RR) ratio (default 2:1).
👁️ 🗨️ Visually includes:
Arrows marking confirmed entries.
Colored border on the candles that meet the pattern.
Visual shadow in the active time range.
Statistics panel showing:
Backtest Start Date
Number of Winning/Losing Trades
Maximum Streaks
Success rate
RR ratio used
⚙️ Configurable parameters:
Minimum wick/body ratio to define patterns
Choice between using SL in pattern or X candles back
Ratio RR
Operating hours with UTC offset
Show or hide TP/SL on the chart
📌 Ideal for:
Intraday and swing traders trading in reversal zones
Assets such as indices, gold, crude oil, forex, and cryptos
Traders who prefer confirmation before entering
✨ Author: Rouro
Do you like strategy? Don't forget to leave a like and follow me for more ideas like this!
📩 For suggestions, improvements or collaborations: leave your comment 👇
Ichimoku Chikou Breakout Strategy v2The Zerep indicator, which identifies compression and breakout zones based on the behavior of the lagging span within an Ichimoku framework.
Nirvana Mode PRO v2 - FULL AUTONİRVANAPROV2 INDİKATOR H4RSI_TRENDBOT
emaFast = ta.ema(close, 8)
emaSlow = ta.ema(close, 21)
rsi = ta.rsi(close, 14)
= ta.supertrend(2.0, 10)
volAvg = ta.sma(volume, 10)
volSpike = volume > volAvg * 1.5
Dettsec Strategy SMThe DETTSEC SilverMic Strategy is a precision-engineered trend-following system designed to identify key market reversals using dynamic ATR-based stop levels. Built with the aim of riding trends while avoiding noise and false signals, this strategy uses the Average True Range (ATR) to calculate adaptive stop zones that respond to market volatility. With a combination of smart trailing logic and visual aids, it offers traders clear entry signals and real-time direction tracking.
At the core of this strategy lies a dual-layer stop system. When the market is trending upwards, the strategy calculates a Long Stop by subtracting the ATR from the highest price (or close, depending on user settings) over a specified period. Conversely, in a downtrend, it calculates a Short Stop by adding ATR to the lowest price (or close). These stops are not static — they trail in the direction of the trend and only reset when a reversal is confirmed, ensuring the system remains adaptive yet stable.
The strategy detects trend direction based on price behavior relative to these stops. When the price closes above the Short Stop, the system identifies a potential bullish reversal and shifts into a long mode. Similarly, a close below the Long Stop flips the system into a bearish mode. These directional changes trigger Buy or Sell signals, plotted clearly on the chart with optional label markers and circular highlights.
To enhance usability, the strategy includes visual elements such as color-filled backgrounds indicating the active trend state (green for long, red for short). Traders can customize whether to display Buy/Sell labels, use closing prices for extremum detection, and highlight state changes. Additionally, real-time alerts are built-in for direction changes and trade entries — empowering traders to stay informed even when off the charts.
Whether you're a manual trader seeking confirmation for your entries, or an algo-enthusiast automating entries based on clean signals, the DETTSEC SilverMic Strategy is designed to deliver clarity, reliability, and precision. As always, it's optimized for performance and simplicity
Nirvana Mode PRO v2//@version=5
strategy("Nirvana Mode PRO v2", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, calc_on_every_tick=true)
// === İndikator ===
emaFast = ta.ema(close, 8)
emaSlow = ta.ema(close, 21)
rsi = ta.rsi(close, 14)
= ta.supertrend(2.0, 10)
volAvg = ta.sma(volume, 10)
volSpike = volume > volAvg * 1.5
⚡ High-Frequency Pro Strategy | Enhanced Filtersfind the supply ondemand for Gold and the best areat to import
Gold Bollinger Bands Strategy [1H]Bollinger Bands in TradingView. This strategy enters:
Long when the price closes below the lower Bollinger Band (suggesting oversold).
Short when the price closes above the upper Bollinger Band (suggesting overbought).
It exits when the price returns to the middle band.
Scalping Súper Oscilador by Rouro [Actualizado]This scalping strategy is designed to detect overbought and oversold zones using a custom Super Oscillator that combines five classic indicators: RSI, Stochastic, CCI, ROC, and Williams %R, with adjustable thresholds.
⚙️ How does it work? Entry signal: Buy: when the oscillator rises from the oversold zone (-0.8) and the candlestick is bullish. Sell: when the oscillator goes down from the overbought zone (0.8) and the candlestick is bearish. Time filter: possibility to operate only in a configurable time slot (e.g. from 10:00 to 12:00 local time). Dynamic SL/TP: Stop Loss is calculated using the low/high of the last X candles, and the Take Profit according to a configurable Risk/Reward Ratio. One operation per signal, with no overlaps.
🧠 Visuals and Panels: Visual oscillator with smooth EMA. Indicator traffic light that shows the individual status (green, red or grey) on the screen. Real-time statistics table: Backtest start date.
🧩 Full customization:
Periods and levels for each indicator.
Oscillator top/bottom level.
Schedule settings.
Option to show or hide the oscillator baseline.
MA Crossover Crossunder Strategy [UOI]Simple MA Crossover Crossunder Strategy Tester
📌 Purpose:
This strategy is designed to backtest and automate entries and exits based on the crossover and crossunder of two configurable moving averages. It provides traders with flexibility in selecting the moving average type and length to adapt the system to various market conditions and asset classes. To see the win ratio of each strategy (different length and different MA type) click on Strategy tester below the chart (at the bottom of the page).
🟦 Does it work?
Short answer: No — not on its own.
Unless you have a solid understanding of volume and price action, and you implement effective stop-loss and take-profit rules, the win ratio is typically poor for automated trading. However, incorporating other market dynamics can help improve the strategy's performance.
⚙️ Core Features:
🟦 User-Defined Inputs:
shortLength: Length for the short-term moving average (default: 10)
longLength: Length for the long-term moving average (default: 50)
maType: Type of moving average to apply (options include: "SMA", "EMA", "WMA", "VWMA", "RMA", "HMA")
🧮 Moving Average Function (ma):
The strategy includes a custom ma() function that dynamically computes the moving average of the selected type:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume-Weighted Moving Average)
RMA (Running Moving Average / SMMA)
HMA (Hull Moving Average): Calculated using the WMA of a de-trended intermediate series with a square root length for faster response and reduced lag.
This design allows users to test multiple MA methodologies without rewriting code.
🟧 Entry & Exit Logic:
✅ Long Entry:
Triggered when the short-term MA crosses above the long-term MA (ta.crossover()).
Any existing short positions are closed immediately.
❌ Short Entry:
Triggered when the short-term MA crosses below the long-term MA (ta.crossunder()).
Any existing long positions are closed immediately.
This structure ensures that only one active position (long or short) is held at any given time, making the strategy fully reversible and directional.
📊 Visual Representation:
Both MAs are plotted on the chart for visual confirmation.
Short MA: Blue
Long MA: Orange
The chart overlays allow for easy manual verification of signal points and trend alignment.
📈 Execution Parameters:
The strategy uses strategy.percent_of_equity for position sizing, set to 100% of account equity per trade.
Works on any timeframe — users can switch chart resolution for different backtesting horizons (scalping to swing trading).
For instance Try VWMA 10 over 50 with SPX on 30 and 45 minutes time frame and you will see great results. But if you try that with SPY you will get different win ratio.
❌ Do you recommend using a moving average crossover strategy?
❌ No — I use it only as confirmation alongside other indicators.
❌ Only traders with contextual knowledge of price action and volume analysis should use MA strategies.
Matinator 2min -v2.1ATR with ZLSMA exit
Uses ATR reversal for trends and ZLSMA for exit and filtering
10 vs 50 SMA - Long-Only CrossoverEnters a full-size long when the 10-period simple moving average crosses above the 50-period on the chart’s current timeframe; closes the position on the opposite cross. A green “Long” label marks each entry bar.