Volatility Corridor - Quantized Equilibrium LevelsMost range and channel tools slide. The midline is a moving average, so it moves on every bar, and the levels drawn from it move with it. That makes them fine as a trend read and close to useless as levels, because the level you looked at ten bars ago is no longer where you left it.
Volatility Corridor does the opposite. It holds still, and then it jumps.
HOW THE CORRIDOR IS BUILT
An equilibrium anchor sits at the centre of the corridor. Once placed, it is frozen. It does not drift, it does not smooth, it does not respond to anything at all until price closes more than one volatility step away from it.
When that happens, the anchor jumps by a whole number of steps in the direction of the breach, lands at the new location, re-measures its step size from ATR at that exact moment, and freezes again.
Three bands are drawn one step apart above the anchor and three below, giving seven horizontal levels: S3, S2, S1, EQ, R1, R2, R3. Because the anchor and the step are both frozen between jumps, every one of those levels is a genuine flat horizontal line for the entire life of the corridor. Across a chart the result is a staircase of stable shelves rather than a wave, and the jump bars are marked so the history of the structure is readable at a glance.
The quantization matters. The anchor moves by whole steps, never by fractions, so successive corridors line up on a common grid instead of drifting off it. When price returns to an area it traded weeks ago, the corridor tends to rebuild on the same shelves rather than near them.
WHAT IS ON THE CHART
Seven stepline levels, thickest at the equilibrium.
Six filled bands between them, darkening toward the outer edges, so the corridor reads instantly without inspecting a single number.
Candles tinted by their position inside the corridor, running from the lower colour at the bottom edge through neutral at equilibrium to the upper colour at the top.
Background tint whenever price is trading fully outside the corridor.
Price labels on every level at the right edge, in four selectable sizes.
Jump markers at the top and bottom of the pane showing every bar the corridor re-anchored, and in which direction.
SETUPS
Two setups are defined, and either can be switched off.
Reversion. Price has pushed into the outer band and closes back inside it while still on its own side of equilibrium. The stop is the far outer level, and the targets are the levels above: equilibrium first, then the next band, then the one after that. The reasoning is that a corridor that is holding will pull price back toward its centre, and the level structure already provides the map for that journey.
Breakout. Price closes fully beyond the outer level of the corridor. The stop is the first level back inside, and the targets are projected one, two and three steps beyond the corridor edge, on the same grid the corridor itself uses.
In both cases the stop and the targets are structural levels, not multiples of risk. Nothing is placed at an arbitrary distance. The stop is where the structure would be wrong, and the targets are the next shelves on the grid.
Only one setup is tracked at a time. A new signal cannot silently replace an unresolved one.
The panel keeps a record of whether the first target or the stop was reached first, and prints collecting rather than a percentage until the sample is large enough to mean anything. That number is a narrow measurement of one mechanical rule, not a backtest, and it says nothing about what a trader who moved a stop or scaled out would have achieved.
SETTINGS
Step Size is the one dial that matters. It sets the width of a single band in ATR terms, and therefore how far price must travel to force a jump. Larger values give wider, rarer, more significant corridors. Smaller values give a tighter grid that re-anchors often.
Volatility Length sets the ATR lookback used to measure a step at each anchor. Longer is more stable.
Everything else is cosmetic: fills, candle painting, label size, level thickness, background tint.
REPAINTING
The anchor, the step size, the jumps, the setups and the alerts all evaluate on confirmed bars only. A level that is drawn is final for the life of the corridor and is never moved retroactively. The script requests no higher timeframe data.
READING IT
Equilibrium is the fair value the corridor is currently defending. Price oscillating around it is a market with no directional decision.
The outer bands are where the current corridor stops being an adequate description of price. Price reaching them means one of two things is about to happen: it is rejected and the corridor holds, or it closes through and the whole structure jumps to a new shelf. Both are tradable and both have a setup defined for them.
A corridor that survives many bars is a market that has agreed on value. A rapid sequence of jumps in one direction is a trend, and the jump markers make that sequence obvious even when the candles do not.
This is an analysis tool, not financial advice, and not a trading system. The setups are two mechanically defined patterns, and no pattern has an edge on its own. Use it with your own risk management and position sizing. Indicator

Edge Profiler - Self-Learning Signal StatisticsAlmost every indicator answers one question: when should I enter. Edge Profiler answers the two questions that actually decide whether an entry is tradable: how far did this exact setup historically go against me before it resolved, and how long did it usually take.
It does that by keeping a record of its own signals on the symbol and timeframe you have open, and turning that record into a stop distance, a target and an expected holding time.
WHAT IT MEASURES
For every signal it has ever produced on the current chart, the script stores four numbers:
MAE, Maximum Adverse Excursion. How far price travelled against the signal before the signal resolved, measured in ATR units so the value is comparable across symbols and volatility regimes.
MFE, Maximum Favourable Excursion. How far price travelled in favour, in the same units.
Duration. How many bars the signal remained the active one.
Outcome. The signal-to-signal return, again in ATR units.
The last N signals are kept, older ones are dropped, so the statistics describe the current regime rather than a market that no longer exists. The sample size is adjustable.
WHAT IT DERIVES
Data Stop. Entry minus the 80th percentile of historical MAE, times the ATR at entry. Read plainly, this is a stop level that 80 percent of past signals on this chart never reached. The percentile is adjustable, so 90 gives a wider and safer stop, 70 a tighter and more aggressive one.
Data Target. Entry plus the median historical MFE. A level that half of past signals reached before resolving. Also adjustable by percentile.
Expected duration. The median bar count of past signals. The panel shows the age of the open signal as a percentage of that median, which flags a move that has already outlived what this setup normally delivers.
Expectancy. The average signal-to-signal return in ATR units. Positive means the engine has historically produced more favourable resolution than adverse on this chart. Negative is a warning, and it is deliberately shown rather than hidden.
Win rate. The share of stored signals whose signal-to-signal return was positive.
WHY EXCURSION STATISTICS AND NOT A BACKTEST
A backtest tells you what a complete rule set produced, and it is only as honest as its exit assumptions. Excursion statistics measure something narrower and more robust: the shape of the move that follows a trigger, independent of any exit rule. That makes the numbers usable no matter how you personally manage the trade. If the median adverse excursion on this chart is 0.4 ATR and you are risking 0.15 ATR, the data is telling you the stop is inside the noise, and no entry technique will fix that.
BRING YOUR OWN SIGNAL
Three transparent entry engines are included, and the statistics profile whichever one is selected:
Volatility Trail. An ATR trailing stop that flips direction when price closes through it. Default.
EMA Cross. Close crossing a single exponential moving average.
Donchian Breakout. Close breaking the highest high or lowest low of the last N bars.
Switching the engine reprofiles everything from scratch on the same chart, which makes it easy to see which of the three has the cleaner statistical footprint on the instrument you actually trade. Two engines with the same win rate can have very different adverse excursion, and that difference is what decides whether a stop survives.
ON THE CHART
Entry line, Data Stop line and Data Target line for the currently open signal.
Shaded risk zone between entry and stop, reward zone between entry and target.
Triangles at each signal.
Bars tinted by the active signal direction.
A panel with the full statistics and the live state of the open signal, including its running MAE and MFE so you can see in real time whether the current move is behaving like its own history or not.
ALERTS
Long signal.
Short signal.
Open signal has moved further against entry than the historical stop percentile.
Open signal has outlived the median duration.
SETTINGS THAT MATTER
Entry Engine. Which signal gets profiled.
Sample Size. How many past signals are kept. Smaller adapts faster and is noisier, larger is more stable and slower to react to a regime change.
Minimum Sample. Statistics stay hidden below this count instead of showing numbers built on four observations. Default 15.
Stop Percentile. The single most consequential setting. It is the trade-off between stop survival and risk size.
READING IT HONESTLY
These are descriptive statistics of past signals on one chart. They are not a forecast and they carry no guarantee. A sample of 20 signals is a hint, not evidence. Statistics drawn from a trending period will misprice risk the moment the market goes sideways, and the percentile you choose is an assumption about how much you are willing to be wrong before you are stopped. Load enough history for the sample to fill, check that expectancy is positive before you take the levels seriously, and treat a negative expectancy reading as the script telling you this engine has no edge here.
This is an analysis tool, not financial advice, and not a trading system on its own. Use it with your own risk management and position sizing. Past behaviour of any method does not guarantee future results. Indicator

Liquidity Thermodynamics Engine V9 LiteLiquidity Thermodynamics Engine V9 Lite is a macro-liquidity oscillator designed to highlight liquidity impulse, acceleration, compression, divergence, and follow-through conditions. It is a lite core version of a more heavy research model that explores liquid thermodynamic phase models as the physics corresponds to capital flows.
The indicator combines major liquidity inputs into a normalized composite, then tracks when liquidity impulse strengthens, compresses, diverges from price, or aligns with acceleration. The Lite version focuses on a clean chart experience while preserving an optional Flow Map for users who want to inspect the underlying liquidity drivers.
Primary signals include:
- Composite and signal line
- Positive and negative impulse histogram
- Bright positive impulse bars
- Acceleration markers
- Compression diamonds
- Bullish and bearish divergence markers
- Bright green follow-through triangle
- Optional energy exhaustion flag
- Optional Flow Map
This tool is intended for macro context and research. It is not financial advice and should not be used as a standalone trading system.
User Guide
Liquidity Thermodynamics Engine V9 Lite, or LTE Lite, is a macro-liquidity momentum oscillator designed to help users visualize when liquidity conditions are compressing, accelerating, diverging from price, or beginning to follow through.
The indicator is not designed to predict every short-term move. It is best used as a higher-timeframe liquidity context tool, especially on slower charts such as the 6D, weekly, or multi-day Bitcoin chart. Its strongest signals tend to come when liquidity impulse and acceleration align near important macro turning zones.
This guide explains what each signal means, how to read the chart, and how to use the tool responsibly.
1. What LTE Lite Measures
LTE Lite combines several macro liquidity series into a normalized oscillator:
- Federal Reserve total assets
- Treasury General Account
- Overnight reverse repo
- Reserve balances
- Optional inverse DXY overlay
The core model converts liquidity conditions into a composite line, then measures the speed and force of changes in that composite. The result is a compact view of liquidity pressure, impulse, acceleration, compression, divergence, and exhaustion.
In simple terms:
- The white line shows the liquidity composite.
- The yellow line smooths that composite into a signal line.
- The histogram shows liquidity impulse.
- Markers highlight important changes in pressure, momentum, divergence, and exhaustion.
2. The Core Lines
White Line — Composite Line
The white line is the main liquidity composite. It represents the current normalized liquidity condition.
When the white line rises, liquidity conditions are generally improving. When it falls, liquidity conditions are generally deteriorating.
The white line is more reactive than the yellow signal line.
Yellow Line — Signal Line
The yellow line is a smoothed version of the composite.
It helps users distinguish noise from directional liquidity movement. When the white line rises above the yellow line, liquidity momentum is improving. When the white line falls below the yellow line, liquidity momentum is weakening.
The signal line is not a trade trigger by itself. It is context.
3. Impulse Histogram
The histogram measures the rate of change in the liquidity composite.
Green Histogram Bars
Green bars show positive liquidity impulse.
This means liquidity pressure is improving relative to the prior bars.
Red Histogram Bars
Red bars show negative liquidity impulse.
This means liquidity pressure is deteriorating.
Bright Green Histogram Bars
Bright green bars mark stronger positive impulse.
By default, LTE Lite highlights positive impulse bars when they reach or exceed the Key Positive Impulse Level. In the current stock configuration, this level is set to `0.10`.
These bars are important because they often mark a stronger liquidity push rather than a minor improvement.
Important: a bright green histogram bar is not automatically a buy signal. Its value increases when it aligns with acceleration, compression release, improving structure, or price confirmation.
4. Acceleration Markers
Acceleration markers show when the impulse itself is accelerating.
Yellow `+`
A yellow plus sign marks positive acceleration.
This means liquidity impulse is not just positive; it is improving quickly enough to clear the acceleration threshold.
Positive acceleration can appear before a larger histogram impulse bar, or the impulse bar can appear first. LTE Lite watches for either order.
Yellow `-`
A yellow minus sign marks negative acceleration.
This means liquidity impulse is weakening quickly.
Negative acceleration can warn that a prior liquidity push is losing force.
5. Bright Green Triangle Signal
The bright green triangle is one of the most important Lite signals.
It fires when:
- A bright positive impulse bar occurs, and
- A positive acceleration signal occurs, and
- The two events happen within the configured window.
The default window is `7` bars.
On a 6D chart, 7 bars is roughly 42 calendar days. This gives the signal room to capture cases where acceleration leads impulse and cases where impulse leads acceleration.
Why This Signal Matters
This signal is designed to identify liquidity follow-through.
The idea is:
- A large positive histogram bar shows meaningful liquidity impulse.
- A `+` acceleration marker shows liquidity momentum is expanding.
- When both appear close together, the market may be entering a more supportive liquidity window.
This does not guarantee immediate upside. It means liquidity conditions have improved enough to deserve attention.
How to Use It
Best practice:
1. Watch for the green triangle on higher timeframes.
2. Check whether price is basing, breaking structure, or reclaiming key levels.
3. Confirm that the composite is stabilizing or rising.
4. Avoid treating the triangle as a standalone entry signal.
The green triangle is a context signal, not a mechanical trading command.
6. Compression Signal
Compression is shown as a small gray diamond around the zero line.
Compression appears when:
- Liquidity impulse is small, and
- Composite movement is also muted, and
- This quiet condition persists for the configured number of bars.
Compression means liquidity energy is coiling.
It does not tell direction by itself. It simply says the system is quiet enough that a larger move may be building.
How to Use Compression
Compression is most useful when followed by:
- Positive acceleration
- Bright green impulse
- A green triangle signal
- Composite reclaiming or curling upward
Compression followed by negative acceleration can instead warn of downside continuation.
7. Divergence Signals
Divergence compares price structure against liquidity structure.
Bullish Divergence
A bullish divergence marker appears when price makes a lower pivot low while the liquidity composite makes a higher pivot low.
This can suggest that price is weakening less efficiently because liquidity conditions are improving underneath the surface.
Bearish Divergence
A bearish divergence marker appears when price makes a higher pivot high while the liquidity composite makes a lower pivot high.
This can suggest that price is rising while liquidity support is weakening.
Divergence Mode
The default mode is:
`Price vs Liquidity + Impulse`
This is stricter than simple price-versus-liquidity divergence because it also checks impulse direction. The goal is to reduce noisy divergence signals.
Divergence is best used as a warning or confirmation tool, not as a standalone entry or exit.
8. Energy Exhaustion Flag
The Energy Exhaustion Flag is an optional marker.
It is designed to identify moments when internal liquidity energy has dropped sharply or clustered into a weak state.
By default in the current V9 Lite stock settings, this marker is turned off.
When enabled, it can help identify late-stage exhaustion after strong liquidity movement. It should be used carefully because exhaustion can persist before price responds.
9. Flow Map
The Flow Map is an optional visual layer.
It breaks liquidity movement into individual components:
- Fed flow
- Treasury flow
- RRP flow
- Reserve flow
The Flow Map helps users see which component is contributing most to liquidity movement.
Flow Map Modes
`Stacked Bars` shows all selected flow components.
`Dominant Bars` shows only the strongest component on each bar.
`Stacked + Dominant Marker` shows the flow bars and adds a marker to the dominant component.
How to Use the Flow Map
Use the Flow Map when you want to inspect what is driving the oscillator.
For example:
- Reserve flow may dominate during banking-system liquidity shifts.
- TGA changes may dominate around Treasury cash rebuilding or drawdowns.
- RRP shifts may dominate when reverse repo usage changes materially.
- Fed balance sheet changes may dominate during major policy/liquidity events.
For clean chart reading, leave Flow Map off. Turn it on when doing deeper diagnostics.
10. Suggested Timeframes
LTE Lite is designed primarily for higher-timeframe liquidity analysis.
Recommended starting points:
- Bitcoin 6D
- Bitcoin weekly
- Major index weekly
- Multi-day charts for macro context
Lower timeframes may produce more noise because macro liquidity data updates slowly relative to intraday price action.
The 6D chart can be especially useful because it balances signal sensitivity with macro smoothness.
11. Practical Reading Workflow
Use this sequence:
Step 1 — Identify the Liquidity Regime
Look at the white and yellow lines.
Is the composite rising, falling, basing, or rolling over?
Step 2 — Check Impulse
Look at the histogram.
Are bars green or red? Are green bars brightening? Is negative impulse fading?
Step 3 — Watch Acceleration
Look for `+` or `-` markers.
A `+` means liquidity momentum is accelerating. A `-` means it is decelerating.
Step 4 — Look for Follow-Through
The green triangle is the key combined signal.
It means strong positive impulse and positive acceleration have occurred within the configured window.
Step 5 — Confirm With Price
Do not use the indicator alone.
Look for price confirmation such as:
- Break of market structure
- Reclaim of key moving averages
- Higher lows
- Range breakout
- Failed breakdown
- Support reclaim
Step 6 — Manage Risk
Liquidity support can improve before price moves. It can also improve while price continues consolidating.
Use invalidation levels, position sizing, and a clear plan.
12. Signal Priority
Not all signals carry equal weight.
Highest priority:
1. Bright green triangle after or near positive acceleration
2. Bright green impulse bars appearing after compression
3. Bullish divergence near a major low
4. Composite rising above the signal line
Medium priority:
1. Positive acceleration without bright impulse
2. Compression alone
3. Flow Map showing improving dominant flow
Lower priority:
1. Small green histogram bars
2. Isolated divergence without impulse confirmation
3. A single marker against strong price downtrend
13. Common Mistakes
Mistake 1 — Treating Every Green Bar as Bullish Enough
Small green bars only show mild improvement. The brighter bars matter more.
Mistake 2 — Ignoring Timeframe
Signals on a 6D or weekly chart are not short-term scalping signals. They describe larger liquidity conditions.
Mistake 3 — Ignoring Price Confirmation
Liquidity can lead price, but price still needs to confirm.
Mistake 4 — Assuming the Triangle Means Immediate Upside
The triangle identifies a supportive liquidity window. It does not guarantee immediate price expansion.
Mistake 5 — Overloading the Chart
Keep Flow Map off unless you are diagnosing components. The cleanest read usually comes from the composite, signal line, histogram, acceleration markers, compression, divergence, and green triangle.
14. Default Settings Philosophy
The stock settings are tuned for a clean macro read.
The defaults prioritize:
- Higher-timeframe stability
- Fewer false signals
- Visibility of major impulse events
- Clean chart presentation
- Optional component diagnostics through Flow Map
If users modify settings, they should do so slowly and test across multiple cycles.
Risk Disclaimer
This indicator is for educational and research purposes only.
It does not provide financial advice, investment advice, or trading recommendations. Markets involve risk, and no indicator can guarantee future performance. Users should combine this tool with independent analysis, risk management, and their own decision-making process.
Past signal behavior does not guarantee future results. Indicator

Position Architect [JOAT]Position Architect
Position Architect is an auto-triggered trade-plan visualizer. It consumes a signal source (any plot of another indicator, or a fallback SMA-cross), arms a trade with ATR-scaled stop loss and three risk-reward-scaled targets, and tracks the trade live with breakeven slide, R-multiple lines, MFE / MAE tracking, multi-currency PnL, position sizing, required margin, Kelly sizing suggestion, and a trade-history strip.
What makes it different
Most trade-planner indicators are manual: the user clicks entry, stop, and target. Position Architect is auto-triggered via input.source, so it plans trades from external signal feeds (other JOAT indicators or any compatible script).
Four trigger modes: Manual toggle, Source-above-SMA, Source-cross-above-SMA, Source-cross-below-SMA. These cover bias, breakout, and counter-trend logics.
A three-target ladder (not just one or two) with intermediate R-multiple lines (0.5R, 1R, 1.5R, 2R, 2.5R, 3R) drawn between entry and Target 3 so you see partial-take levels at a glance.
Live R-multiple, MFE, MAE displayed next to the trade in real time. After the trade closes, those values are baked into a persistent history label.
Kelly sizing suggestion based on an assumed win rate and the current risk-reward, capped at 25% to avoid pathological recommendations.
How it works
The signal source is the user-selected input.source. The trigger rule (one of four modes) determines when a long or short is armed.
On arm: entry equals the current close. SL equals low minus ATR(14) times slMult for longs (or symmetric for shorts). Three targets at entry plus or minus risk times tp1Mult / tp2Mult / tp3Mult.
Lifecycle gates on bar_index greater than tradeBar so the arm bar itself cannot also register hits (preventing spurious instant fills).
Each subsequent bar: check for TP1, TP2, TP3 hits in order, plus stop-loss. TP3 takes precedence over SL on same-bar pierces. If TP1 hits and breakeven is enabled, the stop slides to entry.
Position sizing: pos_size equals (capital times riskPct / 100) divided by (sl_pct / 100). Required margin equals pos_size divided by leverage.
Kelly suggestion: f-star equals winRate minus (1 minus winRate) divided by RR, clamped to 25% max.
Reading the chart
Five horizontal price lines: entry (blue), SL (red), TP1 / TP2 / TP3 (green shades), each width 3 to 5.
Five price-only labels at the right edge with R-multiples and percentages.
Two linefills: a translucent red risk zone between entry and SL, a translucent green reward zone between entry and TP3.
bgcolor tint while a trade is open.
A 1-bar bgcolor pulse on TP / SL / breakeven events.
A live R+0.8 MFE+1.5 MAE-0.3 label updating each bar near current price.
Bars-in-trade counter near the entry.
Trade-history strip above past entries with W/L outcomes and R-multiples.
R-multiple intermediate lines with right-edge labels.
A daily trade count plus win-rate summary.
A comprehensive dashboard with capital, risk, leverage, R:R, Kelly, position size, required margin, direction, entry, current price, live PnL, status (OPEN / WIN / LOSS), bars in trade.
Signals
Trade activated long / short
Target 1 / 2 / 3 hit
Stop loss hit
Breakeven slid
All gated on barstate.isconfirmed or barstate.ishistory. No future references.
Inputs
Signal : signal source, trigger mode, signal SMA length, manual long / short toggles.
Targets : SL ATR multiplier, TP1 / TP2 / TP3 risk multipliers, breakeven toggle, line extension bars.
Capital : capital amount, risk percent, leverage, currency code.
Kelly : assumed win rate.
Visual : bullish / bearish colors, entry line color, SL line color, TP line color, R-multiple lines toggle, history strip toggle.
Dashboard : position, size.
How traders use this
Discretionary planning : switch to Manual mode and toggle manualLong / manualShort to drop a complete plan at the current price, with ATR-aware stops and risk-aware sizing.
Signal integration : connect Position Architect's signal source to another JOAT indicator's plot output (for example the composite of Iridescent Helix or the Stage-3 line of Sentinel Cascade) and let it auto-arm trades.
Risk audit : the dashboard's R:R, position size, required margin, and Kelly suggestion are an instant pre-trade audit. You can compare across instruments.
Performance review : the trade-history strip lets you scroll back through recent trades on the chart and see R-multiples without needing a separate journal.
Limitations
Kelly sizing assumes a stable win-rate-and-R distribution. Real performance varies. The suggestion is a calibration reference, not a recommendation.
Position sizing is in price units. For futures or forex contracts the user must convert to contract count manually.
The signal source must be a series compatible with input.source. If the connected indicator does not expose a useful plot, the trigger logic falls back to close.
Trade lifecycle assumes one open position at a time. No pyramiding inside this script.
Compatibility
Pine Script v6 open-source indicator (overlay). Any symbol, any timeframe. ASCII currency codes (no Unicode glyphs) for cross-platform display. No request.security calls.
Defaults
SL ATR multiplier 1.5, targets at 1R / 2R / 3.5R, breakeven on after TP1, mint / red palette, ten-thousand-dollar capital with one percent risk and one times leverage, top-right medium dashboard.
Indicator

Strategy

Indicator

Indicator

Turtles StrategyBorn from the 1980s "Turtle" experiment, this method of trading captures breakouts and places or closes trades with intrabar entries or exits and realized-equity risk controls.
How It Works
The strategy buys/sells on breakouts from recent highs/lows, using ATR for volatility-adjusted stops and sizing. It risks a fixed % (default 1%) of realized equity per trade—initial capital plus closed P&L, ignoring open positions for conservatism. Drawdown protection auto-reduces risk by 20% at 10% drops (up to three times), resetting only on full peak recovery. Single positions only, with 1-tick slippage simulated for realistic fills. Best for trending assets like forex,commodities, crypto, stocks. Backtest for optimal parameters.
Main Operations
The strategy works on any timeframe but it's meant to be used on daily charts.
Entry Signals:
Long: Buy-stop 1 tick above 20-bar high (default "Entry Period") when no position—enters intrabar on breakout.
Short: Sell-stop 1 tick below 20-bar low. OCA cancels opposites.
Size: (Realized equity × adjusted risk %) ÷ (2× ATR stop distance), scaled by point value.
Exit Signals:
Longs: Stop at tighter of (entry - 2× ATR) or (10-bar low - 1 tick trailing, default "Exit Period").
Shorts: Stop at tighter of (entry + 2× ATR) or (10-bar high + 1 tick trailing).
Locks profits in trends, exits fast on fades.
Risk Controls:
Tracks realized equity peak.
10% drawdown: Risk ×0.8; 20%/30%: Further ×0.8 (max 3x).
Full reset above peak—preserves capital in slumps. Strategy

Market Regime IndexThe Market Regime Index is a top-down macro regime nowcasting tool that offers a consolidated view of the market’s risk appetite. It tracks 32 of the world’s most influential markets across asset classes to determine investor sentiment by applying trend-following signals to each independent asset. It features adjustable parameters and a built-in alert system that notifies investors when conditions transition between Risk-On and Risk-Off regimes. The selected markets are grouped into equities (7), fixed income (9), currencies (7), commodities (5), and derivatives (4):
Equities = S&P 500 E-mini Index Futures, Nasdaq-100 E-mini Index Futures, Russell 2000 E-mini Index Futures, STOXX Europe 600 Index Futures, Nikkei 225 Index Futures, MSCI Emerging Markets Index Futures, and S&P 500 High Beta (SPHB)/Low Beta (SPLV) Ratio.
Fixed Income = US 10Y Treasury Yield, US 2Y Treasury Yield, US 10Y-02Y Yield Spread, German 10Y Bund Yield, UK 10Y Gilt Yield, US 10Y Breakeven Inflation Rate, US 10Y TIPS Yield, US High Yield Option-Adjusted Spread, and US Corporate Option-Adjusted Spread.
Currencies = US Dollar Index (DXY), Australian Dollar/US Dollar, Euro/US Dollar, Chinese Yuan/US Dollar, Pound Sterling/US Dollar, Japanese Yen/US Dollar, and Bitcoin/US Dollar.
Commodities = ICE Brent Crude Oil Futures, COMEX Gold Futures, COMEX Silver Futures, COMEX Copper Futures, and S&P Goldman Sachs Commodity Index (GSCI) Futures.
Derivatives = CBOE S&P 500 Volatility Index (VIX), ICE US Bond Market Volatility Index (MOVE), CBOE 3M Implied Correlation Index, and CBOE VIX Volatility Index (VVIX)/VIX.
All assets are directionally aligned with their historical correlation to the S&P 500. Each asset contributes equally based on its individual bullish or bearish signal. The overall market regime is calculated as the difference between the number of Risk-On and Risk-Off signals divided by the total number of assets, displayed as the percentage of markets confirming each regime. Green indicates Risk-On and occurs when the number of Risk-On signals exceeds Risk-Off signals, while red indicates Risk-Off and occurs when the number of Risk-Off signals exceeds Risk-On signals.
Bullish Signal = (Fast MA – Slow MA) > (ATR × ATR Margin)
Bearish Signal = (Fast MA – Slow MA) < –(ATR × ATR Margin)
Market Regime = (Risk-On signals – Risk-Off signals) ÷ Total assets
This indicator is designed with flexibility in mind, allowing users to include or exclude individual assets that contribute to the market regime and adjust the input parameters used for trend signal detection. These parameters apply to each independent asset, and the overall regime signal is smoothed by the signal length to reduce noise and enhance reliability. Investors can position according to the prevailing market regime by selecting factors that have historically outperformed under each regime environment to minimise downside risk and maximise upside potential:
Risk-On Equity Factors = High Beta > Cyclicals > Low Volatility > Defensives.
Risk-Off Equity Factors = Defensives > Low Volatility > Cyclicals > High Beta.
Risk-On Fixed Income Factors = High Yield > Investment Grade > Treasuries.
Risk-Off Fixed Income Factors = Treasuries > Investment Grade > High Yield.
Risk-On Commodity Factors = Industrial Metals > Energy > Agriculture > Gold.
Risk-Off Commodity Factors = Gold > Agriculture > Energy > Industrial Metals.
Risk-On Currency Factors = Cryptocurrencies > Foreign Currencies > US Dollar.
Risk-Off Currency Factors = US Dollar > Foreign Currencies > Cryptocurrencies.
In summary, the Market Regime Index is a comprehensive macro risk-management tool that identifies the current market regime and helps investors align portfolio risk with the market’s underlying risk appetite. Its intuitive, color-coded design makes it an indispensable resource for investors seeking to navigate shifting market conditions and enhance risk-adjusted performance by selecting factors that have historically outperformed. While it has proven historically valuable, asset-specific characteristics and correlations evolve over time as market dynamics change. Indicator

The Best Strategy Template[LuciTech]Hello Traders,
This is a powerful and flexible strategy template designed to help you create, backtest, and deploy your own custom trading strategies. This template is not a ready-to-use strategy but a framework that simplifies the development process by providing a wide range of pre-built features and functionalities.
What It Does
The LuciTech Strategy Template provides a robust foundation for building your own automated trading strategies. It includes a comprehensive set of features that are essential for any serious trading strategy, allowing you to focus on your unique trading logic without having to code everything from scratch.
Key Features
The LuciTech Strategy Template integrates several powerful features to enhance your strategy development:
•
Advanced Risk Management: This includes robust controls for defining your Risk Percentage per Trade, setting a precise Risk-to-Reward Ratio, and implementing an intelligent Breakeven Stop-Loss mechanism that automatically adjusts your stop to the entry price once a specified profit threshold is reached. These elements are crucial for capital preservation and consistent profitability.
•
Flexible Stop-Loss Options: The template offers adaptable stop-loss calculation methods, allowing you to choose between ATR-Based Stop-Loss, which dynamically adjusts to market volatility, and Candle-Based Stop-Loss, which uses structural price points from previous candles. This flexibility ensures the stop-loss strategy aligns with diverse trading styles.
•
Time-Based Filtering: Optimize your strategy's performance by restricting trading activity to specific hours of the day. This feature allows you to avoid unfavorable market conditions or focus on periods of higher liquidity and volatility relevant to your strategy.
•
Customizable Webhook Alerts: Stay informed with advanced notification capabilities. The template supports sending detailed webhook alerts in various JSON formats (Standard, Telegram, Concise Telegram) to external platforms, facilitating real-time monitoring and potential integration with automated trading systems.
•
Comprehensive Visual Customization: Enhance your analytical clarity with extensive visual options. You can customize the colors of entry, stop-loss, and take-profit lines, and effectively visualize market inefficiencies by displaying and customizing Fair Value Gap (FVG) boxes directly on your chart.
How It Does It
The LuciTech Strategy Template is meticulously crafted using Pine Script, PulseWire's powerful and expressive programming language. The underlying architecture is designed for clarity and modularity, allowing for straightforward integration of your unique trading signals. At its core, the template operates by taking user-defined entry and exit conditions and then applying a sophisticated layer of risk management, position sizing, and trade execution logic.
For instance, when a longCondition or shortCondition is met, the template dynamically calculates the appropriate position size. This calculation is based on your specified risk_percent of equity and the stop_distance (the distance between your entry price and the calculated stop-loss level). This ensures that each trade adheres to your predefined risk parameters, a critical component of disciplined trading.
The flexibility in stop-loss calculation is achieved through a switch statement that evaluates the sl_type input. Whether you choose an ATR-based stop, which adapts to market volatility, or a candle-based stop, which uses structural price points, the template seamlessly integrates these methods. The ATR calculation itself is further refined by allowing various smoothing methods (RMA, SMA, EMA, WMA), providing granular control over how volatility is measured.
Time-based filtering is implemented by comparing the current bar's time with user-defined start_hour, start_minute, end_hour, and end_minute inputs. This allows the strategy to activate or deactivate trading during specific market sessions or periods of the day, a valuable tool for optimizing performance and avoiding unfavorable conditions.
Furthermore, the template incorporates advanced webhook alert functionality. When a trade is executed, a customizable JSON message is formatted based on your webhook_format selection (Standard, Telegram, or Concise Telegram) and sent via alert function. This enables seamless integration with external services for real-time notifications or even automated trade execution through third-party platforms.
Visual feedback is paramount for understanding strategy behavior. The template utilizes plot and fill functions to clearly display entry prices, stop-loss levels, and take-profit targets directly on the chart. Customizable colors for these elements, along with dedicated options for Fair Value Gap (FVG) boxes, enhance the visual analysis during backtesting and live trading, making it easier to interpret the strategy's actions.
How It's Original
The LuciTech Strategy Template distinguishes itself in the crowded landscape of PulseWire scripts through its unique combination of integrated, advanced risk management features, highly flexible stop-loss methodologies, and sophisticated alerting capabilities, all within a user-friendly and modular framework. While many templates offer basic entry/exit signal integration, LuciTech goes several steps further by providing a robust, ready-to-use infrastructure for managing the entire trade lifecycle once a signal is generated.
Unlike templates that might require users to piece together various risk management components or code complex stop-loss logic from scratch, LuciTech offers these critical functionalities out-of-the-box. The inclusion of dynamic position sizing based on a user-defined risk percentage, a configurable risk-to-reward ratio, and an intelligent breakeven mechanism significantly elevates its utility. This comprehensive approach to capital preservation and profit targeting is a cornerstone of professional trading and is often overlooked or simplified in generic templates.
Furthermore, the template's provision for multiple stop-loss calculation types—ATR-based for volatility adaptation, and candle-based for structural support/resistance—demonstrates a deep understanding of diverse trading strategies. The underlying code for these calculations is already implemented, saving developers considerable time and effort. The subtle yet powerful inclusion of FVG (Fair Value Gap) related inputs also hints at advanced price action concepts, offering a sophisticated layer of analysis and execution that is not commonly found in general-purpose templates.
The advanced webhook alerting system, with its support for various JSON formats tailored for platforms like Telegram, showcases an originality in catering to the needs of modern, automated trading setups. This moves beyond simple PulseWire pop-up alerts, enabling seamless integration with external systems for real-time trade monitoring and execution. This level of external connectivity and customizable data output is a significant differentiator.
In essence, the LuciTech Strategy Template is original not just in its individual features, but in how these features are cohesively integrated to form a powerful, opinionated, yet highly adaptable system. It empowers traders to focus their creative energy on developing their core entry/exit signals, confident that the underlying framework will handle the complexities of risk management, trade execution, and external communication with precision and flexibility. It's a comprehensive solution designed to accelerate the development of robust and professional trading strategies.
How to Modify the Logic to Apply Your Strategy
The LuciTech Strategy Template is designed with modularity in mind, making it exceptionally straightforward to integrate your unique trading strategy logic. The template provides a clear separation between the core strategy management (risk, position sizing, exits) and the entry signal generation. This allows you to easily plug in your own buy and sell conditions without altering the robust underlying framework.
Here’s a step-by-step guide on how to adapt the template to your specific trading strategy:
1.
Locate the Strategy Logic Section:
Open the Pine Script editor in PulseWire and navigate to the section clearly marked with the comment //Strategy Logic Example:. This is where the template’s placeholder entry conditions (a simple moving average crossover) are defined.
2.
Define Your Custom Entry Conditions:
Within this section, you will find variables such as longCondition and shortCondition. These are boolean variables that determine when a long or short trade should be initiated. Replace the existing example logic with your own custom buy and sell conditions. Your conditions can be based on any combination of indicators, price action patterns, candlestick formations, or other market analysis techniques. For example, if your strategy involves a combination of RSI and MACD, you would define longCondition as (rsi > 50 and macd_line > signal_line) and shortCondition as (rsi < 50 and macd_line < signal_line).
3.
Leverage the Template’s Built-in Features:
Once your longCondition and shortCondition are defined, the rest of the template automatically takes over. The integrated risk management module will calculate the appropriate position size based on your Risk % input and the chosen Stop Loss Type. The Risk:Reward ratio will determine your take-profit levels, and the Breakeven at R feature will manage your stop-loss dynamically. The time filter (Use Time Filter) will ensure your trades only occur within your specified hours, and the webhook alerts will notify you of trade executions. Strategy

Risk Calculator PRO — manual lot size + auto lot-suggestionWhy risk management?
90 % of traders blow up because they size positions emotionally. This tool forces Risk-First Thinking: choose the amount you’re willing to lose, and the script reverse-engineers everything else.
Key features
1. Manual or Market Entry – click “Use current price” or type a custom entry.
2. Setup-based ₹-Risk – four presets (A/B/C/D). Edit to your workflow.
3. Lot-Size Input + Auto Lot Suggestion – you tell the contract size ⇒ script tells you how many lots.
4. Auto-SL (optional) – tick to push stop-loss to exactly 1-lot risk.
5. Instant Targets – 1 : 2, 1 : 3, 1 : 4, 1 : 5 plotted and alert-ready.
6. P&L Preview – table shows potential profit at each R-multiple plus real ₹ at SL.
7. Margin Column – enter per-lot margin once; script totals it for any size.
8. Clean Table UI – dark/light friendly; updates every 5 bars.
9. Alert Pack – SL, each target, plus copy-paste journal line on the chart.
How to use
1. Add to chart > “Format”.
2. Type the lot size for the symbol (e.g., 1250 for Natural Gas, 1 for cash equity).
3. Pick Side (Buy / Sell) & Setup grade.
4. ✅ If you want the script to place SL for you, tick Auto-SL (risk = 1 lot).
5. Otherwise type your own Stop-loss.
6. Read the table:
• Suggested lots = how many to trade so risk ≤ setup ₹.
• Risk (currency) = real money lost if SL hits.
7. Set PulseWire alerts on the built-in conditions (T1_2, SL_hit, etc.) if you’d like push / email.
8. Copy the orange CSV label to Excel / Sheets for journalling.
Best practices
• Never raise risk to “fit” a trade. Lower size instead.
• Review win-rate vs. R multiple monthly; adjust setups A–D accordingly.
• Test Auto-SL in replay before going live.
Disclaimer
This script is educational. Past performance ≠ future results. The author isn’t responsible for trading losses.
Indicator

MACD Volume Strategy (BBO + MACD State, Reversal Type)Overview
MACD Volume Strategy (BBO + MACD State, Reversal Type) is a momentum-based reversal system that combines MACD crossover logic with volume filtering to enhance signal accuracy and minimize noise. It aims to identify structural trend shifts and manage risk using predefined parameters.
※This strategy is for educational and research purposes only. All results are based on historical simulations and do not guarantee future performance.
Strategy Objectives
Identify early trend transitions with high probability
Filter entries using volume dynamics to validate momentum
Maintain continuous exposure using a reversal-style model
Apply a consistent 1:1.5 risk-to-reward ratio per trade
Key Features
Integrated MACD and volume oscillator filtering
Zero repainting (all signals confirmed on closed candles)
Automatic position flipping for seamless direction shifts
Stop-loss and take-profit based on recent structural highs/lows
Trading Rules
Long Entry Conditions
MACD crosses above the zero line (BBO Buy arrow)
Volume oscillator is positive (short EMA > long EMA)
MACD is above the signal line
Close any existing short and enter a new long
Short Entry Conditions
MACD crosses below the zero line (BBO Sell arrow)
Volume oscillator is positive
MACD is below the signal line
Close any existing long and enter a new short
Exit Rules
Take Profit (TP) = Entry ± (risk distance × 1.5)
Stop Loss (SL) = Recent swing low (for long) or high (for short)
Early Exit = Triggered when a reversal signal appears (flip logic)
Risk Management Parameters
Pair: ETH/USD
Timeframe: 10-minute
Starting Capital: $3,000
Commission: 0.02%
Slippage: 2 pip
Risk per Trade: 5% of account equity (adjusted for sustainable practice)
Total Trades: 312 (backtest on selected dataset)
※Risk parameters are fully configurable and should be adjusted to suit each trader's personal setup and broker conditions.
Parameters & Configurations
Volume Short Length: 6
Volume Long Length: 12
MACD Fast Length: 11
MACD Slow Length: 21
Signal Smoothing: 10
Oscillator MA Type: SMA
Signal Line MA Type: SMA
Visual Support
Green arrow = Long entry
Red arrow = Short entry
MACD lines, signal line, and histogram
SL/TP markers plotted directly on the chart
Strategic Advantages & Uniqueness
Volume filtering eliminates low-participation, weak signals
Structurally aligned SL/TP based on recent market pivots
No repainting — decisions are made only on closed candles
Always in the market due to the reversal-style framework
Inspirations & Attribution
This strategy is inspired by the excellent work of:
Bitcoinblockchainonline – “BBO_Roxana_Signals MACD + vol”
Leveraging MACD zero-line cross and volume oscillator for intuitive signal generation.
HasanRifat – “MACD Fake Filter ”
Introduced a signal filter using MACD wave height averaging to reduce false positives.
This strategy builds upon those ideas to create a more automated, risk-aware, and technically adaptive system.
Summary
MACD Volume Strategy is a clean, logic-first automated trading system built for precision-seeking traders. It avoids discretionary bias and provides consistent signal logic under backtested historical conditions.
100% mechanical — no discretionary input required
Designed for high-confidence entries
Can be extended with filters, alerts, or trailing stops
※Strategy performance depends on market context. Past performance is not indicative of future results. Use with proper risk management and careful configuration.
Strategy

Indicator

Indicator

Octopus Nest Strategy Hello Fellas,
Hereby, I come up with a popular strategy from YouTube called Octopus Nest Strategy. It is a no repaint, lower timeframe scalping strategy utilizing PSAR, EMA and TTM Squeeze.
The strategy considers these market factors:
PSAR -> Trend
EMA -> Trend
TTM Squeeze -> Momentum and Volatility by incorporating Bollinger Bands and Keltner Channels
Note: As you can see there is a potential improvement by incorporating volume.
What's Different Compared To The Original Strategy?
I added an option which allows users to use the Adaptive PSAR of @loxx, which will hopefully improve results sometimes.
Signals
Enter Long -> source above EMA 100, source crosses above PSAR and TTM Squeeze crosses above 0
Enter Short -> source below EMA 100, source crosses below PSAR and TTM Squeeze crosses below 0
Exit Long and Exit Short are triggered from the risk management. Thus, it will just exit on SL or TP.
Risk Management
"High Low Stop Loss" and "Automatic High Low Take Profit" are used here.
High Low Stop Loss: Utilizes the last high for short and the last low for long to calculate the stop loss level. The last high or low gets multiplied by the user-defined multiplicator and if no recent high or low was found it uses the backup multiplier.
Automatic High Low Take Profit: Utilizes the current stop loss level of "High Low Stop Loss" and gets calculated by the user-defined risk ratio.
Now, follows the bunch of knowledge for the more inexperienced readers.
PSAR: Parabolic Stop And Reverse; Developed by J. Welles Wilders and a classic trend reversal indicator.
The indicator works most effectively in trending markets where large price moves allow traders to capture significant gains. When a security’s price is range-bound, the indicator will constantly be reversing, resulting in multiple low-profit or losing trades.
TTM Squeeze: TTM Squeeze is a volatility and momentum indicator introduced by John Carter of Trade the Markets (now Simpler Trading), which capitalizes on the tendency for price to break out strongly after consolidating in a tight trading range.
The volatility component of the TTM Squeeze indicator measures price compression using Bollinger Bands and Keltner Channels. If the Bollinger Bands are completely enclosed within the Keltner Channels, that indicates a period of very low volatility. This state is known as the squeeze. When the Bollinger Bands expand and move back outside of the Keltner Channel, the squeeze is said to have “fired”: volatility increases and prices are likely to break out of that tight trading range in one direction or the other. The on/off state of the squeeze is shown with small dots on the zero line of the indicator: red dots indicate the squeeze is on, and green dots indicate the squeeze is off.
EMA: Exponential Moving Average; Like a simple moving average, but with exponential weighting of the input data.
Don't forget to check out the settings and keep it up.
Best regards,
simwai
---
Credits to:
@loxx
@Bjorgum
@Greeny
Strategy

Curved Management (Zeiierman)█ Overview
The Curved Management (Zeiierman) is a trade management indicator tailored for traders looking to visualize their entry, stop loss, and take profit levels. Unique in its design, this indicator doesn't just display lines; it offers rounded or curved visualizations, setting it apart from conventional tools.
█ How It Works
At its core, this indicator leverages the power of the Average True Range (ATR), a metric for volatility, to establish logical stop-loss levels based on recent price action. By incorporating the ATR, the tool dynamically adapts to the market's changing volatility. What sets it apart is the unique curved visualization. Instead of the usual straight lines representing entry/sl levels, users can choose between rounded and straight edges for their take profit and stop loss levels. This aesthetic tweak gives the chart a cleaner look and offers a more intuitive understanding of risk management.
█ How to Apply the Indicator
Upon initially loading the indicator, a label appears that reads, "Set the 'xy' time and price for 'Curved Management (Zeiierman).'" This prompts you to click on the chart at your entry point. After selecting your entry point on the chart, the indicator will load. Ensure you adjust the trend direction in the settings panel based on whether you took a long or short position.
█ How to Use
Use the tool to manage your active position.
Long Entry
Short Entry
█ Settings
The indicator comes packed with various settings allowing customization:
Trade Direction
Decide the direction of the trade (long/short).
Reward multiplier
Sets the ratio for take profit relative to stop loss. Increasing this value will set your take profit further from the entry, and decreasing it will bring it closer.
Risk multiplier
Multiplier for calculating stop loss based on the ATR value. Increasing this makes your stop loss further from the entry, while decreasing brings it closer.
█ Related Free Scripts
Trade & Risk Management Tool
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Indicator

Long-Only Opening Range Breakout (ORB) with Pivot PointsIntraday Trading Strategy: Long-Only Opening Range Breakout (ORB) with Pivot Points
Background:
Opening Range Breakout (ORB) is a popular long-only trading strategy that capitalizes on the early morning volatility in financial markets. It's based on the idea that the initial price movements during the first few minutes or hours of the trading day can set the tone for the rest of the session. The strategy involves identifying a price range within which the asset trades during the opening period and then taking long positions when the price breaks out to the upside of this range.
Pivot Points are a widely used technical indicator in trading. They represent potential support and resistance levels based on the previous day's price action. Pivot points are calculated using the previous day's high, low, and close prices and can help traders identify key price levels for making trading decisions.
How to Use the Script:
Initialization: This script is written in Pine Script, a domain-specific language for trading strategies on the PulseWire platform. To use this script, you need to have access to PulseWire.
Apply the Script: You can do this by adding it to your favorites, then selecting the script in the indicators list under favorites or by searching for it by name under community scripts.
Customize Settings: The script allows you to customize various settings through the PulseWire interface. These settings include:
Opening Session: You can set the time frame for the opening session.
Max Trades per Day: Specify the maximum number of long trades allowed per trading day.
Initial Stop Loss Type: Choose between using a percentage-based stop loss or the previous candles low for stop loss calculations.
Stop Loss Percentage: If you select the percentage-based stop loss, specify the percentage of the entry price for the stop loss.
Backtesting Start and End Time: Set the time frame for backtesting the strategy.
Strategy Signals:
The script will display pivot points in blue (R1, R2, R3, R4, R5) and half-pivot points in gray (R0.5, R1.5, R2.5, R3.5, R4.5) on your chart.
The green line represents the opening range.
The script generates long (buy) signals based on specific conditions:
---The open price is below the opening range high (h).
---The current high price is above the opening range high.
---Pivot point R1 is above the opening range high.
---It's a long-only strategy designed to capture upside breakouts.
---It also respects the maximum number of long trades per day.
The script manages long positions, calculates stop losses, and adjusts long positions according to the defined rules.
Trailing Stop Mechanism
The script incorporates a dynamic trailing stop mechanism designed to protect and maximize profits for long positions. Here's how it works:
1. Initialization:
The script allows you to choose between two types of initial stop loss:
---Percentage-based: This option sets the initial stop loss as a percentage of the entry price.
---Previous day's low: This option sets the initial stop loss at the previous day's low.
2. Setting the Initial Stop Loss (`sl_long0`):
The initial stop loss (`sl_long0`) is calculated based on the chosen method:
---If "Percentage" is selected, it calculates the stop loss as a percentage of the entry price.
---If "Previous Low" is selected, it sets the stop loss at the previous day's low.
3. Dynamic Trailing Stop (`trail_long`):
The script then monitors price movements and uses a dynamic trailing stop mechanism (`trail_long`) to adjust the stop loss level for long positions.
If the current high price rises above certain pivot point levels, the trailing stop is adjusted upwards to lock in profits.
The trailing stop levels are calculated based on pivot points (`r1`, `r2`, `r3`, etc.) and half-pivot points (`r0.5`, `r1.5`, `r2.5`, etc.).
The script checks if the high price surpasses these levels and, if so, updates the trailing stop accordingly.
This dynamic trailing stop allows traders to secure profits while giving the position room to potentially capture additional gains.
4. Final Stop Loss (`sl_long`):
The script calculates the final stop loss level (`sl_long`) based on the following logic:
---If no position is open (`pos == 0`), the stop loss is set to zero, indicating there is no active stop loss.
---If a position is open (`pos == 1`), the script calculates the maximum of the initial stop loss (`sl_long0`) and the dynamic trailing stop (`trail_long`).
---This ensures that the stop loss is always set to the more conservative of the two values to protect profits.
5. Plotting the Stop Loss:
The script plots the stop loss level on the chart using the `plot` function.
It will only display the stop loss level if there is an open position (`pos == 1`) and it's not a new trading day (`not newday`).
The stop loss level is shown in red on the chart.
By combining an initial stop loss with a dynamic trailing stop based on pivot points and half-pivot points, the script aims to provide a comprehensive risk management mechanism for long positions. This allows traders to lock in profits as the price moves in their favor while maintaining a safeguard against adverse price movements.
End of Day (EOD) Exit:
The script includes an "End of Day" (EOD) exit mechanism to automatically close any open positions at the end of the trading day. This feature is designed to manage and control positions when the trading day comes to a close. Here's how it works:
1. Initialization:
At the beginning of each trading day, the script identifies a new trading day using the `is_newbar('D')` condition.
When a new trading day begins, the `newday` variable becomes `true`, indicating the start of a new trading session.
2. Plotting the "End of Day" Signal:
The script includes a plot on the chart to visually represent the "End of Day" signal. This is done using the `plot` function.
The plot is labeled "DayEnd" and is displayed as a comment on the chart. It signifies the EOD point.
3. EOD Exit Condition:
When the script detects that a new trading day has started (`newday == true`), it triggers the EOD exit condition.
At this point, the script proceeds to close all open positions that may have been active during the trading day.
4. Closing Open Positions:
The `strategy.close_all` function is used to close all open positions when the EOD exit condition is met.
This function ensures that any remaining long positions are exited, regardless of their current profit or loss.
The function also includes an `alert_message`, which can be customized to send an alert or notification when positions are closed at EOD.
Purpose of EOD Exit
The "End of Day" exit mechanism serves several essential purposes in the trading strategy:
Risk Management: It helps manage risk by ensuring that positions are not left open overnight when markets can experience increased volatility.
Capital Preservation: Closing positions at EOD can help preserve trading capital by avoiding potential adverse overnight price movements.
Rule-Based Exit: The EOD exit is rule-based and automatic, ensuring that it is consistently applied without emotions or manual intervention.
Scalability: It allows the strategy to be applied to various markets and timeframes where EOD exits may be appropriate.
By incorporating an EOD exit mechanism, the script provides a comprehensive approach to managing positions, taking profits, and minimizing risk as each trading day concludes. This can be especially important in volatile markets like cryptocurrencies, where overnight price swings can be significant.
Backtesting: The script includes a backtesting feature that allows you to test the strategy's performance over historical data. Set the start and end times for backtesting to see how the long-only strategy would have performed in the past.
Trade Execution: If you choose to use this script for live trading, make sure you understand the risks involved. It's essential to set up proper risk management, including position sizing and stop loss orders.
Monitoring: Monitor the long-only strategy's performance over time and be prepared to make adjustments as market conditions change.
Disclaimer: Trading carries a risk of capital loss. This script is provided for educational purposes and as a starting point for your own long-only strategy development. Always do your own research and consider seeking advice from a qualified financial professional before making trading decisions. Strategy

(Simple) Lot Size CalculatorPip Calculator: A Guide for Traders
The Pip Calculator is a powerful tool designed to help traders calculate their lot size based on their account balance, risk percentage, and stop loss in pips. This guide will walk you through using the Pip Calculator script and explain its features.
Features of the Pip Calculator:
User-friendly UI : The Pip Calculator provides a simple and intuitive user interface, making it easy to input your account details and obtain the desired lot size.
Flexible Inputs : The Pip Calculator allows you to enter your account balance, risk percentage, and stop loss in pips. This flexibility enables you to customize the calculation according to your trading strategy.
Dynamic Currency Pair Support : The Pip Calculator supports various currency pairs and their respective pip values. The script automatically detects the currency pair of the chart you're viewing, ensuring accurate calculations.
Real-time Lot Size Display : The Pip Calculator instantly calculates and displays the lot size based on your inputs. The lot size is updated in real-time as you adjust your account balance, risk percentage, or stop loss.
Visual Representation : The Pip Calculator visually presents the calculated lot size on the chart, making it easy to understand and reference during your trading activities.
Using the Pip Calculator:
Install and Apply the Script : To use the Pip Calculator, install it as an extension on your preferred trading platform (such as PulseWire). Apply the script to the chart of the desired currency pair.
Enter Account Details : In the script's user interface, enter your account balance, risk percentage, and stop loss in pips. These details are essential for accurate lot size calculation.
Review Currency Pair Support : The Pip Calculator automatically detects the currency pair of the chart. Ensure that the currency pair is supported by checking the "Currency pair not supported" message. Currently, GBPJPY is the supported pair.
Observe Real-time Lot Size : Once you've entered the required information, the script will calculate and display the lot size in real-time. The lot size is adjusted automatically as you modify your inputs.
Visualize the Lot Size : The calculated lot size is displayed on the chart as a label. You can easily view and reference the lot size while analyzing price movements.
Customize the UI : The Pip Calculator allows you to customize the appearance of the lot size label. You can adjust the text color, background color, and choose whether to show or hide the lot size label.
Note: The Pip Calculator script is intended as a tool to assist traders in determining an appropriate lot size based on their account balance, risk percentage, and stop loss. It should be used in conjunction with a comprehensive trading strategy and risk management principles.
Advantages of the Pip Calculator:
Accuracy: The Pip Calculator incorporates accurate pip values for supported currency pairs, ensuring precise lot size calculations.
Simplicity: The user-friendly interface and intuitive design make it easy for traders to calculate their lot size without complex calculations or manual estimations.
Real-time Updates: The Pip Calculator provides instant lot size updates, allowing traders to adapt their position sizing based on changes in account balance, risk percentage, or stop loss.
Visibility: The visual representation of the lot size on the chart helps traders quickly identify their desired position size and monitor it during trading activities.
The Pip Calculator offers a convenient and efficient way to determine lot sizes based on your trading parameters. By using this tool, you can enhance your risk management practices, maintain consistency, and stay aligned with your trading plan.
Disclaimer: The Pip Calculator script is provided for informational purposes only and should not be considered as financial advice. Trading in the financial markets carries inherent risks, and it is essential to perform your own analysis and consult with a qualified financial advisor before making any investment decisions. Indicator

Strategy Template + Performance & Returns table + ExtrasA script I've been working on since summer 2022. A template for any strategy so you just have to write or paste the code and go straight into risk management settings
Features:
>Signal only Longs/only Shorts/Both
>Leverage system
>Proper fees calculation (even with leverage on)
>Different Stop Loss systems: Simple percentage, 4 different "move to Break Even" systems and Scaling SL after each TP order (read the disclaimer at the bottom regarding this and the TV % profitable metric)
>2 Take Profit systems: Simple percentages, or Risk/reward ratios based on SL level
>Additional option on TP so last one "rides free" until closure of position or Stoploss is hit (for more than 1 orders)
>Up to 5 TP orders
>Show or hide SL/TP levels on demand
>2 date filters. Manual filter is nothing new, enter two dates/hours and filter will turn on. BUT automatic filter is another thing (thanks to user @bfr_ for his help in codingthis feature)
>AUTOMATIC DATE FILTER. Allows you to split all historical data on the chart in X periods, then choose the range of periods used. Up to 10 but that can be changed, instructions included. Useful for WalkForward simulations, haven't seen a script in PulseWire that allows you to do this and test your strategy on "unseen data" automatically
EXTRA SETTINGS
Besides, some additions I like to add to my codes:
>Returns table for monthly and weekly performance. Requires recalculation on every tick. This is a modified version of @QuantNomad's work. May add lower TF options later on
>Volume Based S/R system. Original work from @shtcoinr
>One feature that was made by me, the "portfolio table". Yields info and metrics of your strategy, current position and balance. You're able to turn it off and change its size
Should anyone find an error, or have any idea on how to improve this code, please contact me. Future updates could come, stay tuned
DISCLAIMER:
In order to have accurate StopLoss hit, I had to change the previous system, which was a "close position on candle close" instead at actual stoploss level. It was fixed, but resulted on inflation of the number of trading orders, thus reducing the percent profitable and making it strongly biased and unreal. Keep that in mind, that "real" profitability could be 2x or 3x the metric PulseWire says. If your strategy has a really high trading frequency, resulting in 3000+ orders, might be a problem. Try to make use of the automatic/manual date filter as workaround, I have no means of changing this, seems it is not a bug but an intended design of the PineScript Code Strategy

Strategy

Indicator

Strategy

Strategy
