커뮤니티
ADX Differential 질문입니다
2014-03-05 10:47:24
183
글번호 73200
Input: ADXLen(50), AvgLen(100), Length(40), Ch(8), Mult(6), Div(28);
vars: UpCh(0), DnCh(0), mp(0), stopprice(0);
vars: DeltaADX(0), DeltaAvg(0), LastOrderBar(0);
value1 = ADX(ADXLen);
DeltaADX = value1 - value1[1];
DeltaAvg = ema( DeltaADX , AvgLen );
If CrossUp(DeltaAvg , 0 ) and BarIndex > 1 then Begin (질문1 BarIndex > 1은
UpCh = Highest( High, Length ); 왜 넣어주는건가요??)
DnCh = Lowest( low , Length) ;
LastOrderBar = BarIndex; (질문2 barindex 와 index
의 차이점을 알고싶습니다)
end;
MP = marketposition;
If MP <> 0 then
LastOrderBar = -999;
If index < LastOrderBar + Ch and EntriesToday(date) < 1 then Begin
Buy("B",atstop, UpCh);
Sell("S",atstop, DnCh) ;
If MarketPosition <> 1 then (질문3 마켓포지션이 매수가 아니면
ExitLong ("lentrystop",atstop, Lowest(Low,30)) ; 매수청산?
If MarketPosition <> -1 then 마켓포지션이 매도가 아니면
ExitShort ("sentrystop",atstop,Highest(High,30)) ; 매도청산?
End; 이해하기 어렵네요)
//저가 추적청산
if MP == 1 and MP[1] <> 1 then Begin (질문4 if MP == 1 and MP[1] <> 1 이 들어간
LastOrderBar = -999; 이유가 뭔가요? 그냥 if mp==1 then
StopPrice = low - ma(range,40)*Mult; 대체 해도 되지않을까요?)
end;
if MP == -1 and MP[1] <> -1 then begin
StopPrice = High + ma(range,40)*Mult;
LastOrderBar = -999;
end; (질문5 수식앞의 설명에서는 매수진입봉의저가
매도진입봉의고가 라고 나와있으니
low하고 high가 low[barssinceentry]
If MP == 1 then begin high[barssinceentry]로
exitlong ("paralong",atstop,stopprice) ; 바꿔야 맞지않나요?)
stopprice = stopprice + (low-stopprice)/Div;
end;
If MP == -1 then begin
exitshort ("parashort",atstop,stopprice) ;
stopprice = stopprice - (stopprice-high)/Div;
end;
부탁드립니다
답변 1
예스스탁 예스스탁 답변
2014-03-05 15:18:10
안녕하세요
예스스탁입니다.
1.
BarIndex > 1
해당 내용은 큰의미가 없습니다.
단지 크로스가 현재봉의 상태와 전봉의 상태를 보므로
차트상 2봉 정도 지나고 조건을 체크하라는 의미입니다.
없어도 되는 조건입니다.
2.
barindex와 index는 이름만 다르고 같은 내용의 함수입니다.
봉번호입니다.
3.
If MarketPosition <> 1 then
ExitLong ("lentrystop",atstop, Lowest(Low,30)) ;
위식은 진입신호가 발생한 봉에서 지정한 가격이하의 시세가 발생하면 청산을 하기위한 식입니다.
MarketPosition은 진입신호가 발생하고 봉이 완성이 되어야 MarketPosition이 1로 변경이 되는데
진입신호가 나오는봉 바로 앞봉에서 atstop타입으로 매수청산을 셋팅하고
만약 다음봉에서 진입신호가 나오고 그봉에서 가격이 더 내려 셋팅한 지정한 가격이하의
시세가 발생하면 신호가 나온봉에서 즉시 청산하기 위함입니다.
즉 신호가 발생한 봉에 한정해서 청산신호를 낼때 쓰는 표현입니다.
4.
mp == 1은 매수 발생 후 청산전까지 모든 봉입니다.
MP == 1 and MP[1] <> 1은
현재봉은 1인데 한봉전은 1이 아니었다라는내용으로
매수가 발생한 첫봉을 나타냅니다.
진입후 첫봉에서 어떤 초기값을 지정할때 주로 사용되는 표현입니다.
5.
진입신호봉이 고가와 저가면
high[barssinceentry]
low[barssinceentry]
가 맞습니다.
진입후 항상 직전봉의 저가와 고가이면 기존작성한 내용이 맞습니다.
즐거운 하루되세요
> cinamon 님이 쓴 글입니다.
> 제목 : ADX Differential 질문입니다
> Input: ADXLen(50), AvgLen(100), Length(40), Ch(8), Mult(6), Div(28);
vars: UpCh(0), DnCh(0), mp(0), stopprice(0);
vars: DeltaADX(0), DeltaAvg(0), LastOrderBar(0);
value1 = ADX(ADXLen);
DeltaADX = value1 - value1[1];
DeltaAvg = ema( DeltaADX , AvgLen );
If CrossUp(DeltaAvg , 0 ) and BarIndex > 1 then Begin (질문1 BarIndex > 1은
UpCh = Highest( High, Length ); 왜 넣어주는건가요??)
DnCh = Lowest( low , Length) ;
LastOrderBar = BarIndex; (질문2 barindex 와 index
의 차이점을 알고싶습니다)
end;
MP = marketposition;
If MP <> 0 then
LastOrderBar = -999;
If index < LastOrderBar + Ch and EntriesToday(date) < 1 then Begin
Buy("B",atstop, UpCh);
Sell("S",atstop, DnCh) ;
If MarketPosition <> 1 then (질문3 마켓포지션이 매수가 아니면
ExitLong ("lentrystop",atstop, Lowest(Low,30)) ; 매수청산?
If MarketPosition <> -1 then 마켓포지션이 매도가 아니면
ExitShort ("sentrystop",atstop,Highest(High,30)) ; 매도청산?
End; 이해하기 어렵네요)
//저가 추적청산
if MP == 1 and MP[1] <> 1 then Begin (질문4 if MP == 1 and MP[1] <> 1 이 들어간
LastOrderBar = -999; 이유가 뭔가요? 그냥 if mp==1 then
StopPrice = low - ma(range,40)*Mult; 대체 해도 되지않을까요?)
end;
if MP == -1 and MP[1] <> -1 then begin
StopPrice = High + ma(range,40)*Mult;
LastOrderBar = -999;
end; (질문5 수식앞의 설명에서는 매수진입봉의저가
매도진입봉의고가 라고 나와있으니
low하고 high가 low[barssinceentry]
If MP == 1 then begin high[barssinceentry]로
exitlong ("paralong",atstop,stopprice) ; 바꿔야 맞지않나요?)
stopprice = stopprice + (low-stopprice)/Div;
end;
If MP == -1 then begin
exitshort ("parashort",atstop,stopprice) ;
stopprice = stopprice - (stopprice-high)/Div;
end;
부탁드립니다
다음글
이전글