
この戦略は,3つの低時延ばし移動平均を使用し,12周期,26周期,55周期の低時延ばしテマ平均線を含む.この3つの平均線は,それぞれ,急速平均線,中速平均線,および遅い平均線を表している.急速平均線上を中速平均線を越えたときに買入シグナルが生じ,急速平均線下を中速平均線を越えたときに売出シグナルが生じます.このように,3つの平均線の交差によって市場の買出点を判断し,高周波取引を実現する.
コードでテンプレート関数tema () が定義され,低時延ばしtema平均線を計算する.計算式は:TEMA = 2*EMA (EMA) は,二次指数移動平均 (EWMA) を用いて計算する.本質的に二次指数滑動平均である.主要優点は,滞りが大幅に削減されたことである.これにより,価格変化により迅速に反応し,取引信号判断のリアルタイム性を向上させる.
具体的には,この戦略の入場判断は,高速平均線上を通過して中速平均線が遅い平均線より高くなったときに買入シグナルを生成し,高速平均線下を通過して中速平均線が遅い平均線より低くなったときに売出シグナルを生成する.
この戦略の最大の利点は,出場判断の迅速かつ正確さである。三均線低時延延設計は,遅れを大幅に減らし,価格変化に迅速に反応することができる。同時に三均線を用いて交差判断を行うことで,誤判を回避する。
さらに,この戦略は,高周波取引に適しており,短線価格変動から利益を得ることができる. 快進・快出の操作モードにより,波動の大きい市場から利益を得ることができる.
この策略の最大のリスクは,超短線ブレイクの可能性である.三均線低時延延設計により,価格変化に非常に敏感であり,一部の市場では超短線振動が起こる.このとき,簡単に回される.
また,高周波取引は手数料やスライドポイントを多く支払う必要があり,収益性が不十分であれば,取引費の逆転ブレーキングに容易である.
さらに,この戦略はトレーダーのリアルタイム監視能力の要求が高く,一時的にストップ・ロズとストップ・ストップを更新する必要があります.
この戦略は以下の点で最適化できます.
三均線の周期パラメータを最適化して,異なる市場の特徴に適したものにすること.
波動性指数または取引量指数を追加して信号を確認し,波動的な状況で被ばくを避ける.
ダイナミック・トラッキングを可能にするため,多くの要素を組み合わせて,停止停止メカニズムを設定します.
ポジション管理の最適化,資金管理手段による単一リスクの制御
戦略パラメータを動的に最適化するために,機械学習アルゴリズムと組み合わせる.
この戦略は三均線低時延ばし速取引戦略である。低時延ばし設計により,速速出口を実現し,高周波取引に適した短線機会を捕獲する。この戦略の最大の優点は,信号判断の迅速な正確性であり,最大の劣点は,震動状況で容易に套用されるものである。この論文は,詳細な原理解剖,優位分析,リスク分析および最適化探討を通じて,この取引戦略を概説している。
||
The strategy is named “Low Lag Triple Moving Average Fast Trading Strategy”. Its main idea is to determine entries and exits based on the golden cross and death cross of three moving averages with different parameters and low lag design.
The strategy uses three low-lag moving averages, including 12-, 26-, and 55-period low-lag TEMA. These three MAs represent fast, medium and slow MAs. When the fast MA crosses over the medium MA, a buy signal is generated. When the fast MA crosses below the medium MA, a sell signal is generated. By using the crossover of the three MAs to determine market entry and exit points, high frequency trading can be achieved.
The template function tema() is defined in the code to calculate the low-lag TEMA. Its calculation formula is: TEMA = 2*EMA - EMA(EMA). It uses the double exponential moving average EWMA for calculation. Essentially it is a double smoothed EMA with the main merit of largely reducing the lagging effect. Thus it can respond to price changes faster and improve the timeliness of trading signals.
Specifically, the entry rules of this strategy are: when the fast MA crosses over the medium MA and the fast MA is above the slow MA, a buy signal is generated. When the fast MA crosses below the medium MA and the fast MA is below the slow MA, a sell signal is generated.
The biggest advantage of this strategy is that the entries and exits are determined quickly and accurately. The low-lag design of the three MAs greatly reduces the lagging effect so that they can respond to price changes rapidly. Also, using the crossover of three MAs to determine signals avoids false signals.
In addition, this strategy is suitable for high-frequency trading to capture profits from short-term price fluctuations. Through fast entries and exits it can profit from high volatility markets.
The biggest risk is that ultra short-term whipsaws may occur. Due to the high sensitivity to price changes from the low-lag design, some markets may experience high-frequency oscillations. Then whipsaws are very likely to happen.
Also, high-frequency trading requires paying relatively high commissions and slippage costs. If the profiting ability is insufficient, it is easy to suffer losses from the trading costs.
Moreover, this strategy requires the trader to have strong real-time monitoring abilities to update the stop loss and take profit timely.
The strategy can be optimized from the following aspects:
Optimize the period parameters of the three MAs to better suit different market characteristics.
Add volatility indicators or volume indicators to confirm signals and avoid whipsaws in ranging markets.
Incorporate more factors to set up dynamic trailing stop mechanisms.
Optimize position sizing to control single trade risks through money management techniques.
Incorporate machine learning algorithms to dynamically optimize the strategy parameters.
This is a low-lag triple moving average fast trading strategy. Through its low-lag design, fast entries and exits can be achieved, which is suitable for high-frequency trading to capture short-term opportunities. The biggest advantage of this strategy is that its signal determination is fast and accurate. The biggest disadvantage is that it is prone to be whipsawed in ranging markets. This article comprehensively summarizes this trading strategy through detailed analysis of its rationale, advantages, risks and optimization directions.
[/trans]
/*backtest
start: 2023-11-24 00:00:00
end: 2023-12-24 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("scalping low lag tema etal", shorttitle="Scalping tema",initial_capital=10000, overlay=true)
mav = input(title="Moving Average Type", defval="temadelay", options=["nkclose", "ema", "emadelay", "fastema", "tema", "temadelay"])
lenb = 3
N = input(8)
K = input(1.2)
fracCap = input(1.0)
in = close + K*mom(close,N)
source = close
length = 8
sigma = 12.0
offset = 0.9
p = 4
// length = 10
// sigma = 6.0
// offset = 0.85
tema(src,len) => fastemaOut = 2*ema(src, len) - ema(ema(src, len), len)
a = 0.0
b = 0.0
c = 0.0
if mav == "nkclose"
a := ema(in, 12)
b := a[1]
c := a[2]
if mav == "ema"
a := ema(close, 12)
b := ema(close, 26)
c := ema(close, 55)
if mav == "emadelay"
a := ema(close, 12)
b := a[1]
c := a[2]
if mav == "fastema"
a := ema(in, 12)
b := ema(in, 26)
c := ema(in, 55)
if mav == "tema"
a := tema(close, 12)
b := tema(close, 26)
c := tema(close, 55)
if mav == "temadelay"
a := tema(close, 12)
b := a[1]
c := a[2]
TP = input(200)
SL = input(130)
TS = input(1)
// TP = input(50)
// SL = input(110)
// TS = input(1)
orderSize = floor((fracCap * strategy.equity) / close)
long = cross(a, c) and a > b
short = cross(a, c) and a < b
plot(a, title="12", color=color.red, linewidth=1)
plot(b, title="26", color=color.blue, linewidth=1)
plot(c, title="55", color=color.green, linewidth=1)
strategy.entry("Long", strategy.long, qty=orderSize, when=long)
strategy.entry("Short", strategy.short, qty=orderSize, when=short)
// strategy.entry("Long", strategy.long, 100.0, when=long)
// strategy.entry("Short", strategy.short, 100.0, when=short)
// strategy.entry("Long", strategy.long, 100.0, when=long)
// strategy.entry("Short", strategy.short, 100.0, when=short)
// strategy.entry("Long", strategy.long, 1.0, when=long)
// strategy.entry("Short", strategy.short, 1.0, when=short)
TPP = (TP > 0) ? TP : na
SLP = (SL > 0) ? SL : na
TSP = (TS > 0) ? TS : na
// strategy.exit("Close Short", "Short", qty_percent=100, profit=TPP, loss=SLP, trail_points=TSP, when=long)
// strategy.exit("Close Long", "Long", qty_percent=100, profit=TPP, loss=SLP, trail_points=TSP, when=short)
// strategy.exit("Close Long", "Long", qty_percent=100, profit=TPP, loss=SLP, trail_points=TSP, when=long[1])
// strategy.exit("Close Short", "Short", qty_percent=100, profit=TPP, loss=SLP, trail_points=TSP, when=short[1])
strategy.exit("Close Long", "Long", qty_percent=100, profit=TPP, loss=SLP, trail_points=TSP)
strategy.exit("Close Short", "Short", qty_percent=100, profit=TPP, loss=SLP, trail_points=TSP)