커뮤니티
이 전략 해석좀 해주세요
2012-01-02 20:34:39
424
글번호 46228
Inputs: MomLen(300), AvgLen(40), ATRLen(5), ATRPcnt(0.5), SetupLen(12), stopPer(1.0);
Vars: VWM(0), ATR(0), LEPrice(0), SEPrice(0), BullSetup(False), BearSetup(False), LSetup(0), SSetup(0);
#Calculation variables
VWM = Ema(Volume * (C-C[MomLen]), AvgLen);
ATR = ATR(ATRLen);
#Setup variables
BullSetup = CrossUp( VWM , 0);
BearSetup = CrossDown(VWM , 0);
#Establishment of Buy Setup
IF BullSetup Then Begin
LSetup = 0;
LEPrice = Close;
End;
#Establishment of Sell Setup
IF BearSetup Then Begin
SSetup = 0;
SEPrice = Close;
End;
#Setup Accumulators
LSetup = LSetup + 1;
SSetup = SSetup + 1;
#Entries
IF LSetup <= SetupLen Then Begin
Buy("",atstop,LEPrice + (ATRPcnt * ATR));
ExitLong("",atstop,Low - (ATRPcnt * ATRLen));
End;
IF SSetup <= SetupLen Then Begin
Sell("",atstop,SEPrice - (ATRPcnt * ATR));
ExitShort("",atstop,High + (ATRPcnt * ATRLen));
End;
#Exits
IF MarketPosition == 1 Then Begin
LSetup = SetupLen;
IF BearSetup Then
ExitLong();
End;
IF MarketPosition == -1 Then Begin
SSetup = SetupLen;
IF BullSetup Then
ExitShort();
End;
setstoploss(stopPer);
SetStopEndofday(1500);
답변 1
예스스탁 예스스탁 답변
2012-01-03 08:49:44
안녕하세요
예스스탁입니다.
식에 주석을 붙여 드렸습니다.
참고하시기 바랍니다.
Inputs: MomLen(300), AvgLen(40), ATRLen(5), ATRPcnt(0.5), SetupLen(12), stopPer(1.0);
Vars: VWM(0), ATR(0), LEPrice(0), SEPrice(0), BullSetup(False), BearSetup(False), LSetup(0), SSetup(0);
#300봉 전 대비 현재 종가의 등락폭을 현재거래량과 나누고 이것을 40기간 지수이평함
VWM = Ema(Volume * (C-C[MomLen]), AvgLen);
# ATR값
ATR = ATR(ATRLen);
#vwm이 0을 상향돌파하면 BullSetup은 true, 아니면 False
BullSetup = CrossUp(VWM , 0);
#vwm이 0을 하향돌파하면 BearSetup은 true, 아니면 False
BearSetup = CrossDown(VWM , 0);
# BullSetup이 true이면 LSetup을 0으로 초기화하고 LEPrice에는 종가를 저장
IF BullSetup Then Begin
LSetup = 0;
LEPrice = Close;
End;
# BearSetup이 true이면 SSetup을 0으로 초기화하고 SEPrice에는 종가를 저장
IF BearSetup Then Begin
SSetup = 0;
SEPrice = Close;
End;
# BullSetup이 true가 된 이후 봉갯수 계산
LSetup = LSetup + 1;
# SSetup이 true가 된 이후 봉갯수 계산
SSetup = SSetup + 1;
# LSetup이 true가 된 이후 SetupLen보다 작을 때(12봉이상 경과하지 안은 상태에서)
IF LSetup <= SetupLen Then Begin
# VWM이 0을 상향돌파할때의 종가보다 ATRPcnt * ATR만큼 가격상승하면 매수
Buy("",atstop,LEPrice + (ATRPcnt * ATR));
# 매수진입 후 직전봉 저가보다 ATRPcnt * ATR만큼 가격하락하면 매수청산
ExitLong("",atstop,Low - (ATRPcnt * ATRLen));
End;
IF SSetup <= SetupLen Then Begin
# VWM이 0을 하향이탈할때의 종가보다 ATRPcnt * ATR만큼 가격하락하면 매도
Sell("",atstop,SEPrice - (ATRPcnt * ATR));
# 매도진입 후 직전봉 고가보다 ATRPcnt * ATR만큼 가격상승하면 매도청산
ExitShort("",atstop,High + (ATRPcnt * ATRLen));
End;
#매수진입 후에
IF MarketPosition == 1 Then Begin
#Lsetup은 SetupLen으로 고정(더이상 봉수를 늘리지 않음)
LSetup = SetupLen;
# VWM이 0을 하향이탈하면 매수청산
IF BearSetup Then
ExitLong();
End;
#매도진입 후에
IF MarketPosition == -1 Then Begin
#SSetup은 SetupLen으로 고정(더이상 봉수를 늘리지 않음)
SSetup = SetupLen;
# VWM이 0을 상향돌파하면 매도청산
IF BullSetup Then
ExitShort();
End;
#손절 1%
setstoploss(stopPer);
#15시 당일청산
SetStopEndofday(1500);
즐거운 하루되세요
> 앙짱 님이 쓴 글입니다.
> 제목 : 이 전략 해석좀 해주세요
> Inputs: MomLen(300), AvgLen(40), ATRLen(5), ATRPcnt(0.5), SetupLen(12), stopPer(1.0);
Vars: VWM(0), ATR(0), LEPrice(0), SEPrice(0), BullSetup(False), BearSetup(False), LSetup(0), SSetup(0);
#Calculation variables
VWM = Ema(Volume * (C-C[MomLen]), AvgLen);
ATR = ATR(ATRLen);
#Setup variables
BullSetup = CrossUp( VWM , 0);
BearSetup = CrossDown(VWM , 0);
#Establishment of Buy Setup
IF BullSetup Then Begin
LSetup = 0;
LEPrice = Close;
End;
#Establishment of Sell Setup
IF BearSetup Then Begin
SSetup = 0;
SEPrice = Close;
End;
#Setup Accumulators
LSetup = LSetup + 1;
SSetup = SSetup + 1;
#Entries
IF LSetup <= SetupLen Then Begin
Buy("",atstop,LEPrice + (ATRPcnt * ATR));
ExitLong("",atstop,Low - (ATRPcnt * ATRLen));
End;
IF SSetup <= SetupLen Then Begin
Sell("",atstop,SEPrice - (ATRPcnt * ATR));
ExitShort("",atstop,High + (ATRPcnt * ATRLen));
End;
#Exits
IF MarketPosition == 1 Then Begin
LSetup = SetupLen;
IF BearSetup Then
ExitLong();
End;
IF MarketPosition == -1 Then Begin
SSetup = SetupLen;
IF BullSetup Then
ExitShort();
End;
setstoploss(stopPer);
SetStopEndofday(1500);
다음글
이전글