커뮤니티
[STAD_05] Stochastics OverBS 재질문입니다
2014-04-05 20:41:21
204
글번호 74163
Inputs: Length(12), OBought(70), OSold(30), SetUpLen(6), EntryPoint(0.1), ExitPoint(1.0);
Vars: KVal(0), DVal(0), BuySetup(0), SellSetup(0), BuyPeriod(99), SellPeriod(99), BuyStop(0), SellStop(0);
var : Factor(0.5);
//Stochastic Line Calculations
if CurrentBar > 1 then {
Kval = Kval[1] + (Factor*(FastK(Length)-Kval[1])); //기본stochasticsk와 다른 방식의 stochasticsk
Dval = ((Dval[1]*2) + Kval)/3; //다른 방식의 StochasticsD
}
//Entry Setups
IF KVal < OSold AND CrossUp( KVal , DVal) Then Begin
BuySetup = Highest(High, 2);
BuyStop = Low;
BuyPeriod = 0;
End;
IF KVal > OBought AND CrossDown( KVal , DVal) Then Begin
SellSetup = Lowest(Low, 2);
SellStop = High;
SellPeriod = 0;
End;
//Counters
IF MarketPosition == 1 Then
BuyPeriod = SetUpLen + 1;
Else
BuyPeriod = BuyPeriod + 1;
IF MarketPosition == -1 Then
SellPeriod = SetUpLen + 1;
Else
SellPeriod = SellPeriod + 1;
//Entry Signals
if EntriesToday(date) < 1 then {
IF BuyPeriod <= SetUpLen Then
Buy("",atstop,BuySetup + EntryPoint);
IF SellPeriod <= SetUpLen Then
Sell("",atstop,SellSetup - EntryPoint);
}
//System Exits
IF CrossDown( KVal , DVal ) AND KVal > OSold Then Begin
-----------------------------------------------------------------
BuyPeriod = SetUpLen;
---------------------------------------------------------
이 부분이 왜들어갔는지 이유를 알고싶습니다 안들어가도 무방한거 아닌가요?
부탁드립니다
ExitLong();
End;
IF CRossUp( Kval , DVal) AND KVal < OBought Then Begin
SellPeriod = SetUpLen;
ExitShort();
End;
//Stops
ExitLong("",atstop, BuyStop-ExitPoint);
ExitShort("",atstop, SellStop+ExitPoint);
태그저장 취소
답변 1
예스스탁 예스스탁 답변
2014-04-07 16:28:55
안녕하세요
예스스탁입니다.
IF KVal < OSold AND CrossUp( KVal , DVal) Then Begin
조건이 만족할떄부터 봉갯수를 세서
IF BuyPeriod <= SetUpLen Then
Buy("",atstop,BuySetup + EntryPoint);
BuyPeriod가 SetUpLen이하일때까지만 매수진입을 하는데
IF CrossDown( KVal , DVal ) AND KVal > OSold Then Begin
조건이 만족하면 BuyPeriod에 SetUpLen를 저장해
더이상 매수가 발생하지 못하게 하는 것입니다.
즐거운 하루되세요
> cinamon 님이 쓴 글입니다.
> 제목 : [STAD_05] Stochastics OverBS 재질문입니다
> Inputs: Length(12), OBought(70), OSold(30), SetUpLen(6), EntryPoint(0.1), ExitPoint(1.0);
Vars: KVal(0), DVal(0), BuySetup(0), SellSetup(0), BuyPeriod(99), SellPeriod(99), BuyStop(0), SellStop(0);
var : Factor(0.5);
//Stochastic Line Calculations
if CurrentBar > 1 then {
Kval = Kval[1] + (Factor*(FastK(Length)-Kval[1])); //기본stochasticsk와 다른 방식의 stochasticsk
Dval = ((Dval[1]*2) + Kval)/3; //다른 방식의 StochasticsD
}
//Entry Setups
IF KVal < OSold AND CrossUp( KVal , DVal) Then Begin
BuySetup = Highest(High, 2);
BuyStop = Low;
BuyPeriod = 0;
End;
IF KVal > OBought AND CrossDown( KVal , DVal) Then Begin
SellSetup = Lowest(Low, 2);
SellStop = High;
SellPeriod = 0;
End;
//Counters
IF MarketPosition == 1 Then
BuyPeriod = SetUpLen + 1;
Else
BuyPeriod = BuyPeriod + 1;
IF MarketPosition == -1 Then
SellPeriod = SetUpLen + 1;
Else
SellPeriod = SellPeriod + 1;
//Entry Signals
if EntriesToday(date) < 1 then {
IF BuyPeriod <= SetUpLen Then
Buy("",atstop,BuySetup + EntryPoint);
IF SellPeriod <= SetUpLen Then
Sell("",atstop,SellSetup - EntryPoint);
}
//System Exits
IF CrossDown( KVal , DVal ) AND KVal > OSold Then Begin
-----------------------------------------------------------------
BuyPeriod = SetUpLen;
---------------------------------------------------------
이 부분이 왜들어갔는지 이유를 알고싶습니다 안들어가도 무방한거 아닌가요?
부탁드립니다
ExitLong();
End;
IF CRossUp( Kval , DVal) AND KVal < OBought Then Begin
SellPeriod = SetUpLen;
ExitShort();
End;
//Stops
ExitLong("",atstop, BuyStop-ExitPoint);
ExitShort("",atstop, SellStop+ExitPoint);
태그저장 취소
이전글