0% found this document useful (0 votes)
74 views

Crypto Scalping v2

This document outlines a scalping trading strategy using an ADX trend filter, customizable parameters for EMA length, doji range factor, and volume lookback period. It generates buy and sell signals based on market structure, doji conditions, and high volume, while also providing visual signals and ADX plotting options. The strategy includes entry and exit orders based on these signals to facilitate trading decisions.

Uploaded by

eurocarsandparts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Crypto Scalping v2

This document outlines a scalping trading strategy using an ADX trend filter, customizable parameters for EMA length, doji range factor, and volume lookback period. It generates buy and sell signals based on market structure, doji conditions, and high volume, while also providing visual signals and ADX plotting options. The strategy includes entry and exit orders based on these signals to facilitate trading decisions.

Uploaded by

eurocarsandparts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//@version=5

strategy("Scalping Strategy with ADX Trend Filter", overlay=true)

// === Strategy Settings (User Customizable) ===


emaLength = input.int(100, title="EMA Length", minval=1)
doji_range_factor = input.float(0.1, title="Doji Range Factor", step=0.01,
minval=0.01, maxval=1.0)
volume_lookback = input.int(20, title="Volume Lookback Period", minval=1)
show_signals = input.bool(false, title="Show Visual Signals (Triangles)")

// === ADX Trend Filter Settings ===


adx_length = input.int(14, title="ADX Length", minval=1)
adx_threshold = input.int(20, title="ADX Threshold", minval=5, maxval=50)
show_adx = input.bool(true, title="Show ADX in Separate Pane")

// === Indicators ===


// Original Indicators
ema_val = ta.ema(close, emaLength)
avg_volume = ta.sma(volume, volume_lookback)

// === ADX Trend Filter ===


[adx, plus_di, minus_di] = ta.dmi(14, adx_length)
is_trending = adx > adx_threshold

// === Doji Conditions ===


doji_condition = math.abs(close - open) <= (high - low) * doji_range_factor

// === High Volume Conditions ===


high_volume_condition = volume > avg_volume

// === Market Structure ===


market_structure_bullish = close > ema_val
market_structure_bearish = close < ema_val

// === Buy and Sell Signals with ADX Trend Filter ===
buy_signal = market_structure_bullish and doji_condition and high_volume_condition
and is_trending
sell_signal = market_structure_bearish and doji_condition and high_volume_condition
and is_trending

// === Entry Orders ===


if (buy_signal)
strategy.entry("Buy", strategy.long)
alert("Buy Signal: Market is bullish with Doji and high volume",
alert.freq_once_per_bar_close)

if (sell_signal)
strategy.entry("Sell", strategy.short)
alert("Sell Signal: Market is bearish with Doji and high volume",
alert.freq_once_per_bar_close)

// === Exit Orders (Simple Exit on Opposite Signal) ===


if (strategy.position_size > 0 and sell_signal)
strategy.close("Buy", comment="Close Buy")

if (strategy.position_size < 0 and buy_signal)


strategy.close("Sell", comment="Close Sell")

// === Visual Signal Plots ===


plot(ema_val, color=color.blue, title="EMA 100")

// Trend visualization
bgcolor(is_trending ? color.new(color.blue, 95) : color.new(color.gray, 95),
title="Trend Background")

plotshape(show_signals and buy_signal, style=shape.triangleup,


location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotshape(show_signals and sell_signal, style=shape.triangledown,
location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")

// ADX Plot in separate pane


adx_plot = show_adx ? adx : na
plot(adx_plot, title="ADX", color=color.purple, linewidth=2)
hline(adx_threshold, title="ADX Threshold", color=color.purple,
linestyle=hline.style_dashed)

You might also like