이치모쿠 킨코 효 트레이딩 전략


생성 날짜: 2023-09-14 16:13:33 마지막으로 수정됨: 2023-09-14 16:13:33
복사: 0 클릭수: 706
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

전략 원칙

이 전략은 1인칭 균형표 ((Ichimoku Kinko Hyo) 를 사용하여 다중 거래한다. 이 전략은 균형표의 여러 요소를 종합적으로 고려하여, 조건이 있을 때 다중 거래한다.

거래 논리는 다음과 같습니다.

  1. 전환선, 기준선, 선도선 1, 선도선 2을 계산합니다.

  2. 클라우드 상위, 클라우드 상위, 변동선 기준선 상위에서 더 많은 것을 고려하십시오.

  3. 또한, 지연선이 구름과 가격보다 높으면 상승 추세를 보장할 수 있습니다.

  4. 위의 조건이 충족되면 추가 입학

  5. 만약 지연선이 가격 아래로 또는 클라우드 아래로 내려가면, 평준화합니다.

이 전략은 동시 균형표의 여러 지표를 활용하여 트렌드를 확인하고, 동적인 스톱포스로의 구름층을 사용하여 위험을 효과적으로 제어할 수 있다.

전략적 이점

  • 한눈에 균형표 통합 다중요인 판단 경향

  • 동적 중지 손실, 최대 이익 잠금

  • 규칙은 간단하고 명확하며 실행하기 쉽습니다.

전략적 위험

  • “이런 일이 벌어질 수 있는 유일한 기회는 아직 없습니다.

  • 주의해야 합니다.

  • “이런 일을 하면 좋은 기회를 놓칠 수 있다”.

요약하다

이 전략은 초점 균형 표의 다중 지표 특성을 사용하여 트렌드 방향을 결정한다. 최적화 매개 변수에 기초하여 간단한 다중 규칙의 집합을 제공한다. 그러나 그것의 뒤떨어진 성질과 단지 다중의 한계는 여전히 주의해야 한다.

전략 소스 코드
/*backtest
start: 2023-08-14 00:00:00
end: 2023-09-13 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy(title="Ichimoku Cloud", shorttitle="Doubled Ichimoku", overlay=true, initial_capital=1000, default_qty_value=100, default_qty_type=strategy.percent_of_equity)
conversionPeriods = input(20, minval=1, title="Conversion Line Length")
basePeriods = input(60, minval=1, title="Base Line Length")
laggingSpan2Periods = input(120, minval=1, title="Leading Span B Length")
displacement = input(30, minval=1, title="Displacement")
Stoploss = input(1, minval=0.1, title="Stoploss (% below cloud)") 
donchian(len) => avg(lowest(len), highest(len))
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)
plot(conversionLine, color=#2962FF, title="Conversion Line")
plot(baseLine, color=#B71C1C, title="Base Line")
plot(close, offset = -displacement + 1, color=#43A047, title="Lagging Span")

p1 = plot(leadLine1, offset = displacement - 1, color=#A5D6A7,
	 title="Leading Span A")
p2 = plot(leadLine2, offset = displacement - 1, color=#EF9A9A,
	 title="Leading Span B")
fill(p1, p2, color = leadLine1 > leadLine2 ? color.rgb(67, 160, 71, 90) : color.rgb(244, 67, 54, 90))

bool TKcross = conversionLine > baseLine
bool aboveCloud = close > leadLine1 and close > leadLine2
bool greenCloud = leadLine1 > leadLine2
bool lagLong = close > leadLine1[2*displacement+1] and close > leadLine2[2*displacement+1] and close > close[displacement]
bool longCondition = false
bool close_trade = crossover(leadLine1[displacement], close) or crossover (leadLine2[displacement], close) or close < close[displacement] or crossover(baseLine, close)
var position_count = 0 

if (TKcross and aboveCloud and greenCloud and lagLong and position_count==0)
    position_count = 1
    strategy.entry(id="buy", long=true)

if (close_trade)
    strategy.close_all()
   // strategy.entry(id="sell", long=false)
    position_count = 0

    
//if (longCondition)
   
//    strategy.close("long", when=exit_trade)
//    strategy.exit("exit","long",stop=stop_level,limit=profit_level)