
이 전략은 쌍 EMA 골드 크로스, 표준화된 ATR 노이즈 필터 및 ADX 트렌드 지표를 결합하여 거래자에게 더 신뢰할 수 있는 구매 신호를 제공하고자 합니다. 이 전략은 더 신뢰할 수 있는 거래 기회를 식별하기 위해 거짓 신호를 필터링하는 여러 지표를 통합합니다.
이 전략은 8주기 및 20주기 EMA를 사용하여 쌍 EMA 골드 크로스 시스템을 구축한다. 짧은 주기 EMA 위에 긴 주기 EMA를 가로질러 구매 신호를 생성한다.
또한, 정책은 다음과 같은 보조 지표들을 필터링하도록 설정했습니다.
14주기 ATR, 표준화 처리 후, 시장에서 지나치게 작은 가격 변동을 필터링한다.
14주기 ADX, 트렌드를 식별하기 위한 강도. 강한 트렌드에서만 거래 신호를 고려한다.
14 주기 거래량 SMA, 거래량이 적은 시점을 필터링하십시오.
4⁄14 주기 슈퍼 트렌드 지표, 다공시장 방향을 판단한다.
트렌드 방향, ATR 표준화 값, ADX 값 및 거래량 조건이 충족되면 EMA 금 교차가 구매 신호를 유발합니다.
이 전략은 EMA, ATR, ADX, 슈퍼 트렌드 등 여러 지표를 통합하여 지표 상호 보완을 통해 강력한 신호 필터링 시스템을 형성하고 신뢰성이 높습니다.
ATR 표준화 하락값, ADX 하락값, 포지션 주기 등의 매개 변수는 실제 상황에 따라 최적화 조정할 수 있으며, 전략 유연성이 높다.
슈퍼 트렌드 지표를 통해 빈 시장을 판단하고, 빈 시장을 대상으로 다른 파라미터 기준을 사용하여 기회를 놓치지 않도록하십시오.
전략적 변수 조합은 복잡하고, 최적화하기는 매우 어렵고, 최적의 변수를 찾기 위해 많은 재검토가 필요합니다.
다중 필터링에도 불구하고, 지표의 본질적으로 지연성이 있기 때문에, 잘못된 트리거의 위험이 있습니다.
다중 지표와 파동에 영향을 받으면 전략 거래 빈도가 낮아지고 장기간 거래가 없을 수 있습니다.
대량의 재검토 데이터를 통해 지표 변수의 최적의 조합을 찾는다.
많은 역사적 데이터를 기반으로, 기계 학습 알고리즘을 사용하여 전략 매개 변수를 자동으로 최적화하여 전략의 적응성을 구현합니다.
시장 구조, 감정, 기타 요소를 판단하는 더 많은 지표와 결합하여 전략의 다양성을 풍부하게합니다.
이 전략은 종합적으로 트렌드, 변동성 및 양값 요소를 고려하여 다중 지표 필터링 및 변수 조정으로 거래 시스템을 형성합니다. 종합적으로 볼 때, 이 전략은 신뢰성이 높으며, 변수 조합과 모델링 방식을 추가적으로 최적화하여 전략의 거래 효율성을 향상시킬 수 있습니다.
/*backtest
start: 2023-11-29 00:00:00
end: 2023-12-06 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Description:
//This strategy is a refactored version of an EMA cross strategy with a normalized ATR filter and ADX control.
//It aims to provide traders with signals for long positions based on market conditions defined by various indicators.
//How it Works:
//1. EMA: Uses short (8 periods) and long (20 periods) EMAs to identify crossovers.
//2. ATR: Uses a 14-period ATR, normalized to its 20-period historical range, to filter out noise.
//3. ADX: Uses a 14-period RMA to identify strong trends.
//4. Volume: Filters trades based on a 14-period SMA of volume.
//5. Super Trend: Uses a Super Trend indicator to identify the market direction.
//How to Use:
//- Buy Signal: Generated when EMA short crosses above EMA long, and other conditions like ATR and market direction are met.
//- Sell Signal: Generated based on EMA crossunder and high ADX value.
//Originality and Usefulness:
//This script combines EMA, ATR, ADX, and Super Trend indicators to filter out false signals and identify more reliable trading opportunities.
//USD Strength is not working, just simulated it as PSEUDO CODE: [close>EMA(50)]
//Strategy Results:
//- Account Size: $1000
//- Commission: Not considered
//- Slippage: Not considered
//- Risk: Less than 5% per trade
//- Dataset: Aim for more than 100 trades for sufficient sample size
//Note: This script should be used for educational purposes and should not be considered as financial advice.
//Chart:
//- The script's output is plotted as Buy and Sell signals on the chart.
//- No other scripts are included for clarity.
//- Have tested with 30mins period
//- You are encouraged to play with parameters, let me know if you
//@version=5
strategy("Advanced EMA Cross with Normalized ATR Filter, Controlling ADX", shorttitle="ALP V5", overlay=true )
// Initialize variables
var bool hasBought = false
var int barCountSinceBuy = 0
// Define EMA periods
emaShort = ta.ema(close, 8)
emaLong = ta.ema(close, 20)
// Define ATR parameters
atrLength = 14
atrValue = ta.atr(atrLength)
maxHistoricalATR = ta.highest(atrValue, 20)
minHistoricalATR = ta.lowest(atrValue, 20)
normalizedATR = (atrValue - minHistoricalATR) / (maxHistoricalATR - minHistoricalATR)
// Define ADX parameters
adxValue = ta.rma(close, 14)
adxHighLevel = 30
isADXHigh = adxValue > adxHighLevel
// Initialize risk management variables
var float stopLossPercent = na
var float takeProfitPercent = na
// Calculate USD strength
// That's not working as usd strenght, since I couldn't manage to get usd strength
//I've just simulated it as if the current close price is above 50 days average (it's likely a bullish trend), usd is strong (usd_strenth variable is positive)
usd_strength = close / ta.ema(close, 50) - 1
// Adjust risk parameters based on USD strength
if (usd_strength > 0)
stopLossPercent := 3
takeProfitPercent := 6
else
stopLossPercent := 4
takeProfitPercent := 8
// Initialize position variable
var float positionPrice = na
// Volume filter
minVolume = ta.sma(volume, 14) * 1.5
isVolumeHigh = volume > minVolume
// Market direction using Super Trend indicator
[supertrendValue, supertrendDirection] = ta.supertrend(4, 14)
bool isBullMarket = supertrendDirection < 0
bool isBearMarket = supertrendDirection > 0
// Buy conditions for Bull and Bear markets
buyConditionBull = isBullMarket and ta.crossover(emaShort, emaLong) and normalizedATR > 0.2
buyConditionBear = isBearMarket and ta.crossover(emaShort, emaLong) and normalizedATR > 0.5
buyCondition = buyConditionBull or buyConditionBear
// Sell conditions for Bull and Bear markets
sellConditionBull = isBullMarket and (ta.crossunder(emaShort, emaLong) or isADXHigh)
sellConditionBear = isBearMarket and (ta.crossunder(emaShort, emaLong) or isADXHigh)
sellCondition = sellConditionBull or sellConditionBear
// Final Buy and Sell conditions
if (buyCondition)
strategy.entry("Buy", strategy.long)
positionPrice := close
hasBought := true
barCountSinceBuy := 0
if (hasBought)
barCountSinceBuy := barCountSinceBuy + 1
// Stop-loss and take-profit levels
longStopLoss = positionPrice * (1 - stopLossPercent / 100)
longTakeProfit = positionPrice * (1 + takeProfitPercent / 100)
// Final Sell condition
finalSellCondition = sellCondition and hasBought and barCountSinceBuy >= 3 and isVolumeHigh
if (finalSellCondition)
strategy.close("Buy")
positionPrice := na
hasBought := false
barCountSinceBuy := 0
// Implement stop-loss and take-profit
strategy.exit("Stop Loss", "Buy", stop=longStopLoss)
strategy.exit("Take Profit", "Buy", limit=longTakeProfit)
// Plot signals
plotshape(series=buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
plotshape(series=finalSellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")