该EMA黄金交叉短线交易策略是基于EMA指标的短线交易策略。它使用不同周期的EMA线进行金叉和死叉交易信号判断,采用较短周期EMA线作为入市信号,较长周期EMA线作为止损信号,实现快进快出的短线交易模式。
该策略使用4条不同周期的EMA均线,具体为9周期、26周期、100周期和55周期的EMA线。交易入场信号是9周期EMA线上穿26周期EMA线时做多;止损退出信号是100周期EMA线下穿55周期EMA线时平仓。这样快进快出,避免被套。
该EMA黄金交叉短线交易策略整体来说具有简单易操作、快速响应的特点。通过参数优化和信号过滤,可以进一步提升其稳定性和盈利水平。但短线交易对交易者的控制能力也提出了更高要求。总体而言,该策略适合有一定交易经验的投资者实盘运用。
/*backtest
start: 2023-12-07 00:00:00
end: 2023-12-14 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © YukalMoon
//@version=5
strategy(title="EMA SCALPEUR", overlay=true, initial_capital = 1000)
//// input controls
EMA_L = input.int (title = "EMA_L", defval = 9, minval = 1, maxval = 100, step =1)
EMA_L2 = input.int (title = "EMA_L2", defval = 26, minval = 1, maxval = 100, step =1)
EMA_S = input.int (title = "EMA_S", defval = 100, minval = 1, maxval = 100, step =1)
EMA_S2 = input.int (title = "EMA_S2", defval = 55, minval = 1, maxval = 100, step =1)
/// mise en place de ema
shortest = ta.ema(close, 9)
short = ta.ema(close, 26)
longer = ta.ema(close, 100)
longest = ta.ema(close, 55)
plot(shortest, color = color.red)
plot(short, color = color.orange)
plot(longer, color = color.aqua)
plot(longest, color = color.yellow)
plot(close)
//// trading indicators
EMA1 = ta.ema (close,EMA_L)
EMA2 = ta.ema (close,EMA_L2)
EMA3 = ta.ema (close, EMA_S)
EMA4 = ta.ema (close, EMA_S2)
buy = ta.crossover(EMA1, EMA2)
//sell = ta.crossunder(EMA1, EMA2)
buyexit = ta.crossunder(EMA3, EMA4)
//sellexit = ta.crossover(EMA3, EMA4)
/////strategy
strategy.entry ("long", strategy.short, when = buy, comment = "ENTER-SHORT")
//strategy.entry ("short", strategy.short, when = sell, comment = "ENTER-SHORT")
///// market exit
strategy.close ("long", when = buyexit, comment = "EXIT-SHORT")
//strategy.close ("short", when = sellexit, comment = "EXIT-SHORT")