커뮤니티
[STAD_05] Stochastics OverBS
2014-03-29 22:55:22
173
글번호 73951
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);
-----------------------------------------------------------------------------
질문1 내부변수 BuyPeriod(99), SellPeriod(99), Factor(0.5) (0)이아닌(99) (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;
-----------------------------------------
질문2 이부분 설명좀 달아주시면 감사하겠습니다
부탁드립니다
//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-03-31 11:34:28
안녕하세요
예스스탁입니다.
1.
IF BuyPeriod <= SetUpLen Then
Buy("",atstop,BuySetup + EntryPoint);
IF SellPeriod <= SetUpLen Then
Sell("",atstop,SellSetup - EntryPoint);
조건만족후 SetUpLen 종 안에만 진입이 이뤄지게 되어 있습니다.
BuyPeriod와 SellPeriod가 최초에 0값을 가지면
Entry Setups이 만족하기 전에 위 if 조건이 만족하므로
99와 같이 큰값을 주어 최초에 조건만족전에는 진입하지 못하게 한것입니다.
2.
IF BuyPeriod <= SetUpLen Then
Buy("",atstop,BuySetup + EntryPoint);
매수진입은 BuyPeriod가 SetUpLen값 이하일때만 진입합니다.
IF MarketPosition == 1 Then
BuyPeriod = SetUpLen + 1;
Else
BuyPeriod = BuyPeriod + 1;
매수진입에 들어가면
BuyPeriod는 SetUpLen +1을 주어 더이상 진입을 하지 못하게 하고
매수진입이 아닌상태에서는 1씩 증가를 하게 하는것입니다.
즉 자기 진입에 들어가면 진입을 막는 용도이고
자기진입이 아닌상태에서는 봉수를 카운트하게 됩니다.
매도도 같은 개념입니다.
즐거운 하루되세요
> 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);
-----------------------------------------------------------------------------
질문1 내부변수 BuyPeriod(99), SellPeriod(99), Factor(0.5) (0)이아닌(99) (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;
-----------------------------------------
질문2 이부분 설명좀 달아주시면 감사하겠습니다
부탁드립니다
//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);
태그저장 취소