커뮤니티
문의드립니다..
2013-07-21 04:15:37
263
글번호 65561
예전에 답변해주셨던 내용에대해 재문의드립니다.
1. 하기의 식에서 PrevTop <> 0 이부분이 이해가 가지 않습니다.
prevtop = H[1]로 변수할당 하였는데..
전고가가 0이 아니다? 어떤의미인지 설명부탁드립니다.
2. Prevtop,PrevtopInd는 각각 0을 , PrevBot = 9999999 ,PrevBotInd = 100을
할당하였는데 왜 PrevBot에서는 0이아닌 값을 할당하신 건가요?
3. FirstBar = Barindex에 할당해 주었으므로 같은값인데 BarIndex <> FirstBar
에서 첫봉이 FirstBar와 같지 않다는것이 이해가 되지않습니다.
답변 부탁드립니다.
============================================================================
안녕하세요
예스스탁입니다.
var : StoLength(12),StoPeriod(5),StoK(0),StoD(0),StoTop(80),StoBOTTOM(20),FirstBar(0);
var : DivShortCond(false),PrevTop(0),PrevTopInd(0);
var : DivLongCond(false),PrevBot(0),PrevBotInd(0);
STOK = StochasticsK(StoLength,StoPeriod);
STOD = StochasticsD(StoLength,StoPeriod,StoPeriod);
if date <> date[1] Then
{
FirstBar = Barindex;
DivShortCond = false;
PrevTop = 0;
PrevTopInd = 0;
DivLongCond = false;
PrevBot = 9999999;
PrevBotInd = 100;
}
if ((H[1] == HighD(0) and C[1] > O[1]) or (H==HighD(0) and C < O)) and BarIndex <> FirstBar Then
{
if (H[1] > PreVTop and Stok[1] > StoTop) or (H > PrevTop and StoK > StoTop) Then
{
PrevTop = H[1];
PrevTopInd = Stok[1];
}
Else if PrevTop <> 0 and Stok < PreVTopInd and Stok < Stok[1] and Stok[1] < StoTop Then
DivShortCond = true;
}
if DivShortcond Then
if stok > StoTop Then
DivShortCond = false;
if DivShortcond Then {
if (CrossDown(stok,stod) and C < L[1]) Then
{
Sell("다이버젼스 매도",atlimit,(H+L)/2);
DivShortcond = false;
PrevTop = 0;
PrevTopInd = 0;
}
}
if ((L[1] == LowD(0) and C[1] < O[1]) or (L==LowD(0) and C > O)) and BarIndex <> FirstBar Then
{
if (L[1] < PreVBot and Stok[1] < StoBottom) or (L < PrevBot and StoK < StoBottom) Then
{
PrevBot = L[1];
PrevBotInd = Stok[1];
}
Else if PrevBot <> 9999999 and Stok > PreVBotInd and Stok > Stok[1] and Stok[1] > StoBottom Then
DivLongCond = true;
}
if DivLongCond Then
if stok < StoBottom Then
DivLongCond = false;
if DivLongCond Then {
if (CrossUp(stok,stod) and C > H[1]) Then
{
Buy("다이버젼스 매수",atlimit,(H+L)/2);
DivLongCond = false;
PrevBot = 9999999;
PrevBotInd = 100;
}
}
답변 1
예스스탁 예스스탁 답변
2013-07-22 16:41:45
안녕하세요
예스스탁입니다.
1.
PrevTop은 차트 첫봉이나 일간 첫봉에는 0값입니다.
PrevTop <> 0은 현재 PrevTop에 저장된 값이 0이 아니고
당일 한번이상 if조건에 만족해 PrevTop에 값이 저장되었음을 의미합니다.
2.
PrevTop은 if조건 만족하면 H[1]을 저장하고 이후에 또 if조건이 만족하면
그때의 H[1]과 이전에 저장된 값과 비교해 더 큰값을 저장하도록 되어 있습니다.
그러므로 초기값을 0을 주고 값이 큰게 발생시마다 갱신하도록 한것이며
반대로 PrevBot은 최저값을 찾으므로 최초에는 큰값으로 초기값으로 주고
이후에 값이 그값보다 작은 값을 가질때 마다 값이 갱신되게 한것입니다.
PrevtopInd과 PrevBotInd는 스토케스틱입니다.
0~100까지의 값만 가지므로 기초값이 0과 100으로 설정되고
이후에 갱신하게 작성이 되었습니다.
3.
당일 첫봉에서 FirstBar에 당일 첫봉의 전체 봉번호를 저장하고
FirstBar = Barindex
현재 봉번호가 FirstBar에 저장된 봉번호와 같지 않다고 표현하여
첫봉이후임을 나타내는 것입니다.
BarIndex <> FirstBar
즐거운 하루되세요
> Redstorm 님이 쓴 글입니다.
> 제목 : 문의드립니다..
> 예전에 답변해주셨던 내용에대해 재문의드립니다.
1. 하기의 식에서 PrevTop <> 0 이부분이 이해가 가지 않습니다.
prevtop = H[1]로 변수할당 하였는데..
전고가가 0이 아니다? 어떤의미인지 설명부탁드립니다.
2. Prevtop,PrevtopInd는 각각 0을 , PrevBot = 9999999 ,PrevBotInd = 100을
할당하였는데 왜 PrevBot에서는 0이아닌 값을 할당하신 건가요?
3. FirstBar = Barindex에 할당해 주었으므로 같은값인데 BarIndex <> FirstBar
에서 첫봉이 FirstBar와 같지 않다는것이 이해가 되지않습니다.
답변 부탁드립니다.
============================================================================
안녕하세요
예스스탁입니다.
var : StoLength(12),StoPeriod(5),StoK(0),StoD(0),StoTop(80),StoBOTTOM(20),FirstBar(0);
var : DivShortCond(false),PrevTop(0),PrevTopInd(0);
var : DivLongCond(false),PrevBot(0),PrevBotInd(0);
STOK = StochasticsK(StoLength,StoPeriod);
STOD = StochasticsD(StoLength,StoPeriod,StoPeriod);
if date <> date[1] Then
{
FirstBar = Barindex;
DivShortCond = false;
PrevTop = 0;
PrevTopInd = 0;
DivLongCond = false;
PrevBot = 9999999;
PrevBotInd = 100;
}
if ((H[1] == HighD(0) and C[1] > O[1]) or (H==HighD(0) and C < O)) and BarIndex <> FirstBar Then
{
if (H[1] > PreVTop and Stok[1] > StoTop) or (H > PrevTop and StoK > StoTop) Then
{
PrevTop = H[1];
PrevTopInd = Stok[1];
}
Else if PrevTop <> 0 and Stok < PreVTopInd and Stok < Stok[1] and Stok[1] < StoTop Then
DivShortCond = true;
}
if DivShortcond Then
if stok > StoTop Then
DivShortCond = false;
if DivShortcond Then {
if (CrossDown(stok,stod) and C < L[1]) Then
{
Sell("다이버젼스 매도",atlimit,(H+L)/2);
DivShortcond = false;
PrevTop = 0;
PrevTopInd = 0;
}
}
if ((L[1] == LowD(0) and C[1] < O[1]) or (L==LowD(0) and C > O)) and BarIndex <> FirstBar Then
{
if (L[1] < PreVBot and Stok[1] < StoBottom) or (L < PrevBot and StoK < StoBottom) Then
{
PrevBot = L[1];
PrevBotInd = Stok[1];
}
Else if PrevBot <> 9999999 and Stok > PreVBotInd and Stok > Stok[1] and Stok[1] > StoBottom Then
DivLongCond = true;
}
if DivLongCond Then
if stok < StoBottom Then
DivLongCond = false;
if DivLongCond Then {
if (CrossUp(stok,stod) and C > H[1]) Then
{
Buy("다이버젼스 매수",atlimit,(H+L)/2);
DivLongCond = false;
PrevBot = 9999999;
PrevBotInd = 100;
}
}
이전글