ビットコインの勢い販売戦略

ビットコインの勢い販売戦略

KissCuseMe
2025-03-03
4

1。勢い取引の基本概念

  • 意味:トレンドの強度を測定し、それが上昇しているときに販売する戦略が下降傾向であるときに販売する戦略
  • コア原則:「トレンドは友人です」 - 既存のフローが続くことを推測します。

2 ..戦略の3つの重要な要素

  1. 運動量インジケーター:RSI、MACD、確率的
  2. トレンドの確認:移動平均(MA)、ボリンジャーバンド
  3. 取引量分析:obv(オンバランスボリューム)、MFI(マネーフローインデックス)

3。コアロジック実装(Python)

3-1。 必須ライブラリのインストール

pip install ccxt pandas numpy TA-Lib python-dotenv

3-2。 リアルタイムデータ収集(ビナンスに基づく)

import ccxt
import pandas as pd

binance = ccxt.binance({
    'apiKey': 'YOUR_API_KEY',
    'secret': 'YOUR_SECRET',
    'enableRateLimit': True
})

# Query 1-hour bar data
ohlcv = binance.fetch_ohlcv('BTC/USDT', '1h')
df = pd.DataFrame(ohlcv, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms')

3-3。 技術インジケーターの計算

import talib

# RSI (14 period)
df['RSI'] = talib.RSI(df['close'], timeperiod=14)

# MACD (12,26,9)
df['MACD'], df['MACD_signal'], _ = talib.MACD(df['close'], 
                                            fastperiod=12, 
                                            slowperiod=26, 
                                            signalperiod=9)

# 50-day & 200-day moving average
df['MA50'] = talib.SMA(df['close'], timeperiod=50)
df['MA200'] = talib.SMA(df['close'], timeperiod=200)

# Bollinger Bands (20 days)
df['upper_band'], df['middle_band'], df['lower_band'] = talib.BBANDS(df['close'], 
                                                                    timeperiod=20)

3-4。 販売信号の作成ロジック

def generate_signal(row):
    # Upward momentum conditions
    bull_condition = (
        (row['RSI'] > 50) &
        (row['MACD'] > row['MACD_signal']) &
        (row['close'] > row['MA200']) &
        (row['close'] > row['upper_band'])
    
    # Downward momentum conditions
    bear_condition = (
        (row['RSI'] < 45) &
        (row['MACD'] < row['MACD_signal']) &
        (row['close'] < row['MA200']) &
        (row['close'] < row['lower_band'])
    
    if bull_condition:
        return 'BUY'
    elif bear_condition:
        return 'SELL'
    else:
        return 'HOLD'

df['signal'] = df.apply(generate_signal, axis=1)

4。リスク管理システム

4-1。 位置のサイジング

def calculate_position_size(balance, risk_percent=2, stop_loss_pct=5):
    max_risk = balance * (risk_percent/100)
    return max_risk / (stop_loss_pct/100)

4-2。 動的

def dynamic_stoploss(current_price, atr, multiplier=2):
    return current_price - (atr * multiplier)

4-3。 トレーリングストップ

def update_trailing_stop(high_price, trail_percent=3):
    return high_price * (1 - (trail_percent/100))

5。バックテストの例

initial_balance = 10000  # USDT
position = 0
balance = initial_balance
trailing_stop = None

for idx, row in df.iterrows():
    current_price = row['close']
    
    if row['signal'] == 'BUY' and position == 0:
        position = balance / current_price
        balance = 0
        trailing_stop = current_price * 0.97  # 3% initial stop loss
    elif row['signal'] == 'SELL' or current_price < trailing_stop:
        if position > 0:
            balance = position * current_price
            position = 0
            trailing_stop = None
    elif position > 0:
        # Trailing stop update
        trailing_stop = max(trailing_stop, current_price * 0.97)

final_balance = balance + (position * df.iloc[-1]['close'])
print(f"Final rate of return: {((final_balance/initial_balance)-1)*100:.2f}%")

6。コア考慮事項

  1. ボラティリティ管理:ギャップが上昇/下降しているときに眠いことが必要です
  2. 取引コスト:反射料金(0.1%未満)および眠そうな皮膚
  3. タイムゾーンの選択:
    • 短期:15分から4時間
    • 長期:イルボン〜ジュボン
  4. ブラックスウォール予防:メインニュースイベントカレンダーOKが必要です

7。最適化ポイント

  • パラメーターチューニング:移動平均期間、RSIしきい値調整
  • マルチタイム分析:ハイタイムゾーンの上部との組み合わせ
  • 機械学習インターロック:LSTMによる運動量加速度の予測

8。ノート

division部門の禁止:3年以上のデータによる検証

❗分類の確認:100 BTC未満のトランザクションボリュームの回避

❗自動化制限:API呼び出し数(通常は1分あたり120回)

実際のアプリケーションの前

ビットコイン
勢い
取引

0

目次

この投稿は、クパンパートナーズの活動の一環として、一定額の手数料を受け取ります。

利用規約個人情報取扱方針サポート
© 2025
あらかじめ知っていたら良かったでしょう
All rights reserved.