
이 전략은 마크 미네비니의 주식 선택 템플릿에 따라, 이동 평균 지표와 결합하여 주식 가격 추세를 판단하여 자동으로 구매 및 중지합니다. 전략은 주가가 상승 추세에 있는지, 그리고 중요한 이동 평균을 뚫고 구매 신호를 생성하는지를 판단합니다. 동시에, 전략은 스톱 라인을 설정하여 주가가 철회 할 때 적극적으로 중지합니다.
이 전략은 다음과 같은 조건을 판단하여, 조건이 동시에 충족될 때 구매 신호를 발생시킨다:
위 조건이 충족되면, 전략은 주가가 상승 단계에 있다고 판단하여 구매 신호를 발생시킨다.
또한, 전략은 동시에 손실 경계를 설정하고, 주가가 최고점으로부터 5%를 회수하거나 10%를 올릴 때, 손실을 중지하거나 중지한다.
이 전략은 전체적으로 트렌드 트레이딩의 사고방식을 따르며, 주가 상승 추세를 확인한 전제하에 구매 신호를 생성한다. 동시에 스톱드 메커니즘을 설정하여 위험을 통제한다. 세부적인 매개 변수를 최적화함으로써 전략의 안정성과 수익성을 더욱 향상시킬 수 있다. 그러나 어떤 전략도 시장 위험을 완전히 회피하는 것은 어렵고, 투자자가 신중하게 접근해야 한다.
/*backtest
start: 2022-12-13 00:00:00
end: 2023-12-19 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy(title="Pure Mark Minervini 10%TP 5%CL", pyramiding = 0, commission_type=strategy.commission.percent, commission_value=0.08, overlay=true)
ma50 = sma(close,50)
ma150 = sma(close,150)
ma200 = sma(close,200)
ma200_22 = ma200[22]
high_loopback = input(260, "High Lookback Length")
low_loopback = input(260, "Low Lookback Length")
highest_price = highest(high, high_loopback)
lowest_price = lowest(low, low_loopback)
above52lo = ((close/lowest_price)-1)*100
below52hi = (1-(close/highest_price))*100
ep = strategy.position_avg_price
trigger = close>ma150 and close>ma200 and ma150>ma200 and ma200>ma200_22 and ma50>ma150 and ma50>ma200 and close>ma50 and above52lo>=25 and below52hi<=25 and close>0.3
var label maLabel = na
if (trigger)
yLocation = close>ma150 and close>ma200 and ma150>ma200 and ma200>ma200_22 and ma50>ma150 and ma50>ma200 and close>ma50 and above52lo>=25 and below52hi<=25 and close>0.3 ?
yloc.abovebar :
yloc.belowbar
// labelStyle = close>ma150 and close>ma200 and ma150>ma200 and ma200>ma200_22 and ma50>ma150 and ma50>ma200 and close>ma50 and above52lo>=25 and below52hi<=25 and close>0.3 ?
// label.style_labeldown :
// label.style_labelup
buy = close>ma150 and close>ma200 and ma150>ma200 and ma200>ma200_22 and ma50>ma150 and ma50>ma200 and close>ma50 and above52lo>=25 and below52hi<=25 and close>0.3
sell = close>ep*1.1 or close<ep*0.95
strategy.entry("TF", strategy.long, when = buy)
strategy.close("TF", when = sell)