
이 전략은 간단한 K선 형태 판단 규칙을 설정하여, 테슬라 4시간 선에 대한 긴 포지션 돌파 거래를 구현한다. 전략은 단순, 논리 명확, 이해하기 쉬운 등의 장점을 가지고 있다.
전략의 핵심 판단 논리는 다음과 같은 4개의 K선 형태 규칙에 기초한다:
위의 4가지 규칙이 동시에 충족될 때, 다방향의 포지션 개설 작업을 수행한다.
또한, 전략은 정지 지점과 정지 지점을 설정하고, 가격이 정지 지점이나 정지 조건을 유발할 때, 평점 작업을 수행한다.
이 전략에는 다음과 같은 장점이 있습니다.
주의해야 할 주요 위험은 다음과 같습니다.
위험은 다음과 같은 방법으로 줄일 수 있습니다.
이 전략의 최적화 방향은 다음과 같습니다.
이 전략은 간단한 K선 형태 판단 규칙을 통해 다중 돌파 거래를 구현한다. 개선할 여지가 있지만, 단순성과 직관성을 고려하면 이 전략은 초보자도 이해할 수 있고 사용할 수 있는 장거리 전략이다. 계속적인 최적화를 통해 전략 효과를 더욱 우수하게 만들 수 있다.
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TheQuantScience
//@version=5
strategy("SimpleBarPattern_LongOnly", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, currency = currency.EUR, initial_capital = 1000, commission_type = strategy.commission.percent, commission_value = 0.03)
// Make input options that configure backtest date range
startDate = input.int(title="Start Date",
defval=1, minval=1, maxval=31)
startMonth = input.int(title="Start Month",
defval=1, minval=1, maxval=12)
startYear = input.int(title="Start Year",
defval=2017, minval=1800, maxval=2100)
endDate = input.int(title="End Date",
defval=8, minval=1, maxval=31)
endMonth = input.int(title="End Month",
defval=3, minval=1, maxval=12)
endYear = input.int(title="End Year",
defval=2022, minval=1800, maxval=2100)
// Look if the close time of the current bar
// Falls inside the date range
inDateRange = true
// Setting Conditions
ConditionA = low < open
ConditionB = low < low[1]
ConditionC = close > open
ConditionD = close > open[1] and close > close[1]
FirstCondition = ConditionA and ConditionB
SecondCondition = ConditionC and ConditionD
IsLong = FirstCondition and SecondCondition
TakeProfit_long = input(4.00)
StopLoss_long = input(4.00)
Profit = TakeProfit_long*close/100/syminfo.mintick
Loss = StopLoss_long*close/100/syminfo.mintick
EntryCondition = IsLong and inDateRange
// Trade Entry&Exit Condition
if EntryCondition and strategy.opentrades == 0
strategy.entry(id = 'Open_Long', direction = strategy.long)
strategy.exit(id = "Close_Long", from_entry = 'Open_Long', profit = Profit, loss = Loss)