EMA Crossover Strategy with Filters by pankaj3singh789
By version
Performance Metrics
- Author: version
- Symbol: CRYPTO:ETHUSD
- Timeframe: 10 minutes
- Net P&L: +1,677.97 USD (+1.67%)
- Win Rate: 39.0%
- Profit Factor: 1.888
- Max Drawdown: 690.97 USD (0.68%)
- Total Trades: 41
- Sharpe Ratio: 0.141
Description
//version=5strategy("EMA Crossover Strategy with Filters", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=10)// EMA lengthsema9_len = 9ema50_len = 50ema100_len = 100ema200_len = 200// EMA calculationema9 = ta.ema(close, ema9_len)ema50 = ta.ema(close, ema50_len)ema100 = ta.ema(close, ema100_len)ema200 = ta.ema(close, ema200_len)// Plot EMAsplot(ema9, color=color.yellow, title="9 EMA")plot(ema50, color=color.orange, title="50 EMA")plot(ema100, color=color.green, title="100 EMA")plot(ema200, color=color.blue, title="200 EMA")// Entry conditionslongCondition = ta.crossover(ema100, ema200) and ema9 > ema50shortCondition = ta.crossunder(ema100, ema200) and ema9 < ema50// Exit conditionslongExit = ta.crossunder(ema100, ema50)shortExit = ta.crossover(ema100, ema50)// Execute tradesif (longCondition) strategy.entry("Long", strategy.long)if (shortCondition) strategy.entry("Short", strategy.short)if (longExit) strategy.close("Long")if (shortExit) strategy.close("Short")