This is a momentum trading strategy based on moving average crossover. It uses two exponential moving averages (EMAs) with different periods to identify trading signals. A buying signal is generated when the faster EMA crosses above the slower EMA. A selling signal is generated when the faster EMA crosses below the slower EMA.
The core logic of this strategy is based on the moving average crossover system. EMA stands for Exponential Moving Average. The calculation formula for EMA is: $$EMA_t = \frac{P_t \times k}{1+k}+\frac{EMA_{t-1}\times(1-k)}{1+k}$$ Where $P_t$ is the closing price of the current day, $EMA_{t-1}$ is the EMA value of the previous day, $k = \frac{2}{n+1}$, and n is the EMA period.
The fast EMA period in this strategy is set to 55 and the slow EMA period is set to 34. When the short period EMA crosses above the long period EMA from the bottom up, it indicates the short term moving average starts leading the long term one upwards, generating a golden cross buying signal. On the contrary, when the short period EMA crosses below the long period EMA from the top down, it indicates the short term moving average starts lagging behind the long term one downwards, generating a death cross selling signal.
The advantages of this strategy include:
There are some risks when using this strategy:
The strategy can be enhanced from the following aspects:
In summary, this is a very classic and practical short-term trading strategy. It has simple clear signals and flexible application space. Through parameter tuning, filter mechanisms, risk control etc, the strategy’s performance can be continuously improved, making it an important tool for high-frequency intraday trading. Overall speaking, this strategy is highly practical with strong application value as a base module for quantified trading.
/*backtest start: 2023-01-10 00:00:00 end: 2024-01-16 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("mohammad tork strategy", overlay=true) // Input parameters lengthShortEMA = input(55, title="Short EMA Length") lengthLongEMA = input(34, title="Long EMA Length") // Calculate EMAs emaShort = ta.ema(close, lengthShortEMA) emaLong = ta.ema(close, lengthLongEMA) // Conditions for Long Signal longCondition = ta.crossover(emaLong, emaShort) // Conditions for Short Signal shortCondition = ta.crossunder(emaLong, emaShort) // Execute Long Signal strategy.entry("Long", strategy.long, when = longCondition) // Execute Short Signal strategy.entry("Short", strategy.short, when = shortCondition) // Plot EMAs on the chart plot(emaShort, color=color.blue, title="Short EMA") plot(emaLong, color=color.red, title="Long EMA") // Plot Long Signal Icon with Buy Label plotshape(series=longCondition, title="Long Signal", color=color.green, style=shape.triangleup, location=location.abovebar, size=size.small, text="Buy") // Plot Short Signal Icon with Sell Label plotshape(series=shortCondition, title="Short Signal", color=color.red, style=shape.triangledown, location=location.abovebar, size=size.small, text="Sell")