말도 안되는 SSL 채널 거래 전략

저자:차오장, 날짜: 2023-11-27 16:42:34
태그:

img

전반적인 설명

이것은 SSL 채널 지표에 기반한 트렌드를 따르는 전략입니다. 그것은 안정적인 자본 성장을 위해 이익을 잠금하기 위해 손실을 멈추고 수익 관리를 포함합니다.

전략 논리

코드의 주요 논리는 트렌드 방향을 결정하기 위해 SSL 상단과 하단의 황금 십자가를 사용하는 것입니다. 구체적으로, SSL 상단이 아래에서 SSL 하단 위에 넘어가면 길게, SSL 하단이 위에서 SSL 상단 아래에 넘어가면 짧게 이동합니다.

포지션을 입력 한 후 전략은 스톱 로스 및 취득 가격을 설정하기 위해 ATR를 계수와 곱하여 사용합니다. 예를 들어, 스톱 로스 가격은 ATR * 1.5 빼고 취득 가격은 ATR * 1 더하는 가격입니다. 이것은 단일 손실을 효과적으로 제어하고 이익을 잠금 할 수 있습니다.

SSL 채널이 넘어가면 포지션을 닫습니다. 이것은 적절한 스톱 손실을 위해 트렌드의 전환점을 추적 할 수 있습니다.

이점 분석

  1. SSL 채널은 트렌드 방향을 결정하는 데 매우 정확합니다
  2. 스톱 로스 및 수익 취득 설정은 위험을 효과적으로 제어하기 위해 합리적입니다.
  3. 적시에 손실을 멈추는 것은 트렌드의 전환점을 추적합니다.

위험 분석

  1. 트렌드 트레이딩은 쉽게 오버 트레이딩으로 이어질 수 있습니다.
  2. SSL 채널 판단에서 실패할 확률이 있습니다.
  3. ATR 계수는 최적화되어야 합니다.

대응 해법은:

  1. 보관 기간을 적절하게 조정합니다.
  2. 확인을 위한 다른 지표를 포함
  3. ATR 계수의 다른 조합을 테스트합니다.

최적화 방향

  1. 최적의 매개 변수 조합을 찾기 위해 ATR 매개 변수를 최적화
  2. 신호 필터링 및 확인을 위한 다른 지표를 증가
  3. 다른 시장에 따라 보유 기간을 조정
  4. 스톱 로스 및 수익 전략 최적화

요약

이 전략의 전반적인 논리는 트렌드를 결정하기 위해 SSL 채널을 사용하여 합리적인 스톱 로스를 설정하고 이익을 취하는 것이 분명합니다. 그러나 잘못된 신호를 필터링하고 최상의 매개 변수 조합을 찾기 위해 다른 지표를 통합하여 추가 테스트 및 최적화가 여전히 필요합니다. 동시에 매개 변수를 다른 시장에 따라 조정하여 전략을 더 유연하게해야합니다. 전반적으로이 전략은 안정적인 수익을 달성하기위한 신뢰할 수있는 틀을 제공합니다.


/*backtest
start: 2022-11-26 00:00:00
end: 2023-05-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Designed per No Nonsense Forex VP rules
//For testing your individual indicators before the full system
//Originated from causecelebre
//Tried to put in as much VP rules as possible

///////////////////////////////////////////////////
//Rules Implemented:
///////////////////////////////////////////////////
// - SL 1.5 x ATR
// - TP 1 x ATR
//
// - Entry conditions
//// - Entry from 1 x confirmation
// - Exit conditions
//// - Exit on confirmation flip 

///////////////////////////////////////////////////
//Trades entries
///////////////////////////////////////////////////
// - First entry L1 or S1 with standard SL and TP

///////////////////////////////////////////////////
//Included Indicators and settings
///////////////////////////////////////////////////
// - Confirmtion = SSL 10

///////////////////////////////////////////////////
//Credits
// Strategy causecelebre https://www.tradingview.com/u/causecelebre/
// SSL Channel ErwinBeckers https://www.tradingview.com/u/ErwinBeckers/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Change log
//First release. Testing of indicators
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

strategy(title="NNFX Strategy Indicator | jh", overlay = true )

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//  **** Set the main stuff  ****
///////////////////////////////////////////////////

//Price
price = close

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ATR stuff
///////////////////////////////////////////////////

slMultiplier = input(1.5, "SL")
tpMultiplier = input(1, "TP")

atrlength = input(title="ATR Length", defval=14, minval=1)
atrsmoothing = input(title="Smoothing", defval="SMA", options=["RMA", "SMA", "EMA", "WMA"])

ma_function(source, atrlength) => 
    if atrsmoothing == "RMA"
        rma(source, atrlength)
    else
        if atrsmoothing == "SMA"
            sma(source, atrlength)
        else
            if atrsmoothing == "EMA"
                ema(source, atrlength)
            else
                wma(source, atrlength)

//plot(ma_function(tr(true), atrlength), title = "ATR", color=#991515, transp=0)

atr = ma_function(tr(true), atrlength)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//  **** Confirmation ****
///////////////////////////////////////////////////

ssllen=input(title="SSL Length Period", defval=10)
smaHigh=sma(high, ssllen)
smaLow=sma(low, ssllen)
Hlv = na
Hlv := close > smaHigh ? 1 : close < smaLow ? -1 : Hlv[1]
sslDown = Hlv < 0 ? smaHigh: smaLow
sslUp   = Hlv < 0 ? smaLow : smaHigh

plot(sslDown, "SSL Down", linewidth=1, color=red)
plot(sslUp, "SSL Up", linewidth=1, color=lime)

///////////////////////////////////////////////////
//Confirm Signals
///////////////////////////////////////////////////

c_Up = sslUp
c_Down = sslDown

//Signals based on crossover
c_Long = crossover(c_Up, c_Down)
c_Short = crossover(c_Down, c_Up)

//Signals based on signal position
trendLong = c_Up > c_Down ? 1 : 0
trendShort = c_Down > c_Up ? 1 : 0

confirmLong = c_Long
confirmShort = c_Short

plotshape(trendLong, color = green, style=shape.triangleup, location=location.bottom)
plotshape(trendShort, color = red, style=shape.triangledown, location=location.bottom)


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Entries and Exits
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (year>2009)

    //Long entries with standard 1.5 ATR for SL, 1 ATR for TP
    long_sl = price - (atr * slMultiplier)
    long_tp = price + (atr * tpMultiplier)
    strategy.order("L1", strategy.long, when = confirmLong)
    strategy.close("L1", when = confirmShort)
    strategy.exit("L Limit Exit", "L1", stop = long_sl, limit = long_tp)

    
    //Short entries with standard 1.5 ATR for SL, 1 ATR for TP
    short_sl = price + (atr * slMultiplier)
    short_tp = price - (atr * tpMultiplier)
    strategy.order("S1", strategy.short, when = confirmShort)
    strategy.close("S1", when = confirmLong)
    strategy.exit("S Limit Exit", "S1", stop = short_sl, limit = short_tp)


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//End
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



    




더 많은