OPEN-SOURCE SCRIPT

Crosswind

337
CROSSWIND
Crosswind is a signal and trade management indicator built on EMA crossovers, but the crossover itself is only the starting point. Most crossover systems break down in two predictable places. They enter on the cross, which is very often the worst price in the whole move, and they exit at a fixed percentage target, which caps the rare large trends that are supposed to pay for all the small losers. Crosswind addresses both problems and then reports every result net of trading costs, so you can judge whether an edge actually survives the fee schedule.

THREE TIMEFRAME PRESETS
Selecting a trading style sets the EMA pair for you. 15 Min Scalping uses 9 and 21. 1 Hour Swing uses 13 and 48. Daily Trend uses 15 and 150. The preset also sets the width of the trailing stop, since noise that is meaningless on a daily chart will repeatedly eject you from a position on a 15 minute chart.

TREND FILTER
A 200 period SMA gates direction. Long signals are only considered while price trades above it and short signals only while price trades below it. The chart background shades faint green above and faint red below so the active regime is visible at a glance.

TWO SIGNAL MODES
Crossover mode fires when the fast EMA crosses the slow EMA in the direction of the trend filter.
Pullback mode waits. After the fast EMA crosses above the slow EMA, no signal is issued yet. The indicator waits for price to retrace into the slow EMA and then close back across it, within a window of bars that you control. You are buying the first dip after trend confirmation rather than the extension itself. Fewer signals, but a materially better average entry, and your initial stop sits closer to structure.

OPTIONAL MACD CONFIRMATION
A standard MACD can be required to agree with the signal direction. It reduces frequency and filters some counter momentum entries.

HOW A TRADE IS MANAGED
Risk is measured in R, where 1R is the initial stop distance of 2x ATR. Every number the indicator reports is expressed in these units, which makes results comparable across symbols and volatility regimes.
A trade passes through three stages.
Initial stop. Placed 2x ATR from entry. Nothing moves while the trade is proving itself.
Breakeven. Once the trade reaches 1R in your favour, the stop advances to entry plus the full round trip cost plus a small cushion. This is a real breakeven, not a nominal one, so a trade stopped at this stage does not quietly book a small loss.
Trail. Once the trade reaches 1.5R, a chandelier trail arms. It tracks the highest high reached since entry, offset by an ATR multiple, and it only ever ratchets in your favour. The stop line turns blue when the trail is live, so the current stage is always obvious on the chart.
There is no fixed profit target by default. A winning trade runs until the trail takes it out. If you want a cap for comparison purposes you can set a hard target expressed in R.
An alternative EMA trail is included, which follows the slow EMA with an ATR buffer, for traders who prefer a moving average exit.

COST ACCOUNTING
Fees and slippage are charged per side against the actual entry and exit prices, so cost scales properly with price rather than being a flat assumption. Funding is optional and charged per eight hours held, scaled by your chart timeframe. Defaults assume 0.06 percent taker fees and 0.02 percent slippage. Lower the fee if you post maker orders.
This matters more than most traders expect. Cost per trade is roughly twice the round trip percentage divided by the stop distance. On a daily chart with a wide stop this rounds to almost nothing. On a 15 minute chart with a tight ATR it can exceed a tenth of an R on every single trade, which is enough to turn a system with a respectable win rate into a losing one.

READING THE LABEL
The status label reports the live trade state and the closed trade record. Net R and average R per trade are the headline numbers. Gross R and cost drag are shown alongside them deliberately. If cost drag is consuming a large fraction of gross R, the honest conclusion is that the configuration trades too frequently for the size of its edge, and the fix is a stricter entry filter rather than a cleverer exit.
Best and worst trade, win rate, and the outcome of the most recent trade are also shown. Trend following configurations typically produce a win rate below fifty percent while remaining profitable, because the winners are much larger than the losers. Judge the system on average R, not on win rate.

ALERTS
Five alert conditions are available. Long signal, short signal, either signal, stop or trail hit, and trail armed.

THE CONFIGURATION I USE
1 Hour Swing preset with signal mode set to Pullback, and the reversal option left off so that an opposite signal does not close and flip an open position. Trades finish on their own stop or trail, and the next signal is only taken once flat. This produces a lower trade count with cleaner entries and lets the trail do the work of deciding when a move is over.

LIMITATIONS WORTH KNOWING
Signals evaluate on bar close. Stop resolution uses the level carried in from the previous bar before the trail updates on the current bar, which avoids look ahead but means the trail lags by one bar. When a single bar's range covers both the stop and a hard target, the result is scored as a stop, because OHLC data cannot reveal which level was reached first. The statistics are a study of signal quality, not a full backtest, and they assume constant risk per trade with no position sizing or compounding.

This indicator is a tool for analysis and is not financial advice. Test any configuration on your own market and timeframe before risking capital.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.