
移動平均均等返済戦略は,非常に単純なトレンド取引戦略である.その核心思想は,短期移動平均が長期移動平均より一定パーセント低いときに多めにすることであり,短期移動平均の上に長期移動平均を横断すると平衡することである.この戦略は,まず,短期移動平均と長期移動平均を計算し,それから,二つの移動平均の関係に基づいて取引信号を生成する.
この戦略は,主に2つの移動平均,短期移動平均と長期移動平均に依存している.短期移動平均のパラメータはsmallMAPeriodであり,長期移動平均のパラメータはbigMAPeriodである.この戦略は,まずこの2つの移動平均を計算し,それから2つの移動平均の大きさの関係を比較する.
短期移動平均が上方から下方へ落ちて長期移動平均の一定パーセント (%BelowToBuyパラメータによって設定される) になったとき,買入シグナルを生じ,多額入札を行う.短期移動平均が次々と上昇し,長期移動平均を再び突破すると,売出シグナルを生じ,平仓する.
この戦略は,短期移動平均と長期移動平均の間の平均値返還の機会を捉えます.短期移動平均が長期移動平均より一定程度低い場合,資産が過小評価されている可能性を示し,平均値に戻る機会があり,それ以上は反発利益を得ることができます.
移動平均平均返済策には以下の利点があります.
この戦略はシンプルなパラメータを最適化することで良い結果が得られます.移動平均パラメータと譲歩パーセントパラメータを調整することで,株式,外貨,暗号通貨などの異なる市場資産を反テストして,最適なパラメータの組み合わせを出できます.
移動平均の平均返済策にはいくつかのリスクがあります.
リスクは以下の方法で軽減できます.
移動平均の平均返答策は,以下のいくつかの点で最適化できます.
移動平均線均等応答戦略は,短期と長期の2つの移動平均線の関係を比較して,短期価格が長期の傾向から逸脱した後に戻ってくる機会を捉える.この戦略の構想はシンプルで,容易に理解し,実行し,パラメータ最適化により優れた効果を得ることができる.しかし,取引信号が少ない,価格転換を容易に見逃すなどのリスクもあります.戦略の利益を最大化するために,パラメータとフィルター条件のテストと最適化が必要です.
/*backtest
start: 2023-02-20 00:00:00
end: 2024-02-26 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// @version=4
//
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//
// @author Sunil Halai
//
// This very simple strategy is an implementation of PJ Sutherlands' Jaws Mean reversion algorithm. It simply buys when a small moving average period (e.g. 2) is below
// a longer moving average period (e.g. 5) by a certain percentage, and closes when the small period average crosses over the longer moving average.
//
// If you are going to use this, you may wish to apply this to a range of investment assets, as the amount signals is low. Alternatively you may wish to tweak the settings to provide more
// signals.
strategy("Jaws Mean Reversion [Strategy]", overlay = true)
//Strategy inputs
source = input(title = "Source", defval = close)
smallMAPeriod = input(title = "Small Moving Average", defval = 2)
bigMAPeriod = input(title = "Big Moving Average", defval = 5)
percentBelowToBuy = input(title = "Percent below to buy %", defval = 3)
//Strategy calculation
smallMA = sma(source, smallMAPeriod)
bigMA = sma(source, bigMAPeriod)
buyMA = ((100 - percentBelowToBuy) / 100) * sma(source, bigMAPeriod)[0]
if(crossunder(smallMA, buyMA))
strategy.entry("BUY", strategy.long)
if(crossover(smallMA, bigMA))
strategy.close("BUY")