커뮤니티
부탁드립니다
2015-01-09 12:29:54
163
글번호 82090
아래의 식은 스토캐스틱 다이버전스매도를 나타낸 것 같은데요.
1. 당일에 한정되었다면 그걸 해제하구요.
2. 다이버전스매수도 함께 표현해주시면 감사하겠습니다.
Var: DivShortCond(False), PrevTop(0), PrevTopInd(0), FirstBar(0);
Var: StoLength(12), StoPeriod(5), StoK(0), StoD(0), StoTOP(80), StoBOTTOM(20);
StoK = StochasticsK(StoLength, StoPeriod);
StoD = StochasticsD(StoLength, StoPeriod, StoPeriod);
If Date<>Date[1] then
Begin
FirstBar = Barindex;
DivShortCond = False;
PrevTop = 0;
PrevTopInd = 0;
End;
If ((High[1]==HighD(0) and Close[1]>Open[1]) or (High==HighD(0) and Close<Open)) and Barindex <> FirstBar Then
begin
If (High[1]>PrevTop and StoK[1]>StoTOP) or (High>PrevTop and StoK>StoTOP) Then begin
PrevTop = High[1];
PrevTopInd = StoK[1];
End
Else if PrevTop <> 0 and StoK < PrevTopInd and StoK < StoK[1] and StoK[1]<StoTOP then
DivShortCond = True;
End;
If DivShortCond then
If StoK > StoTOP then
DivShortCond = False;
If DivShortCond Then {
If (CrossDown(StoK, StoD) and Close<Low[1]) Then
begin
Sell("다이버전스 매도");
DivShortCond = False;
PrevTop = 0;
PrevTopInd = 0;
End;
}
답변 1
예스스탁 예스스탁 답변
2015-01-09 15:24:00
안녕하세요
예스스탁입니다.
Var: DivShortCond(False), PrevTop(0), PrevTopInd(0), FirstBar(0);
Var: StoLength(12), StoPeriod(5), StoK(0), StoD(0), StoTOP(80), StoBOTTOM(20);
Var: DivlongCond(False), PrevBot(0), PrevBotInd(0);
StoK = StochasticsK(StoLength, StoPeriod);
StoD = StochasticsD(StoLength, StoPeriod, StoPeriod);
If Date<>Date[1] then
Begin
FirstBar = Barindex;
DivShortCond = False;
PrevTop = 0;
PrevTopInd = 0;
DivLongCond = False;
PrevBot = 99999999;
PrevBotInd = 99999999;
End;
If ((High[1]==HighD(0) and Close[1]>Open[1]) or (High==HighD(0) and Close<Open)) and Barindex <> FirstBar Then
{
If (High[1]>PrevTop and StoK[1]>StoTOP) or (High>PrevTop and StoK>StoTOP) Then
{
PrevTop = High[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 Close<Low[1]) Then
{
Sell("다이버전스 매도");
DivShortCond = False;
PrevTop = 0;
PrevTopInd = 0;
}
}
If ((Low[1]==Lowd(0) and Close[1]<Open[1]) or (Low==LowD(0) and Close>Open)) and Barindex <> FirstBar Then
{
If (Low[1]<PrevBot and StoK[1]<StoBOTTOM) or (low<PrevBot and StoK<StoBOTTOM) Then
{
PrevBot = Low[1];
PrevBotInd = StoK[1];
}
Else if PrevBot <> 99999999 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 Close>high[1]) Then
{
Buy("다이버전스 매수");
DivLongCond = False;
PrevBot = 99999999 ;
PrevBotInd = 999999990;
}
}
해당 식은 당일에 최고가와 최저가 발생과 그때의 지표값을 비교합니다.
해당 내용을 풀려면 많은 부분을 변경해야 하는데
사용자분이 조건을 지정해 주셔야 합니다.
매수식만 추가해 드립니다.
즐거운 하루되세요
> 묘선낭자 님이 쓴 글입니다.
> 제목 : 부탁드립니다
> 아래의 식은 스토캐스틱 다이버전스매도를 나타낸 것 같은데요.
1. 당일에 한정되었다면 그걸 해제하구요.
2. 다이버전스매수도 함께 표현해주시면 감사하겠습니다.
Var: DivShortCond(False), PrevTop(0), PrevTopInd(0), FirstBar(0);
Var: StoLength(12), StoPeriod(5), StoK(0), StoD(0), StoTOP(80), StoBOTTOM(20);
StoK = StochasticsK(StoLength, StoPeriod);
StoD = StochasticsD(StoLength, StoPeriod, StoPeriod);
If Date<>Date[1] then
Begin
FirstBar = Barindex;
DivShortCond = False;
PrevTop = 0;
PrevTopInd = 0;
End;
If ((High[1]==HighD(0) and Close[1]>Open[1]) or (High==HighD(0) and Close<Open)) and Barindex <> FirstBar Then
begin
If (High[1]>PrevTop and StoK[1]>StoTOP) or (High>PrevTop and StoK>StoTOP) Then begin
PrevTop = High[1];
PrevTopInd = StoK[1];
End
Else if PrevTop <> 0 and StoK < PrevTopInd and StoK < StoK[1] and StoK[1]<StoTOP then
DivShortCond = True;
End;
If DivShortCond then
If StoK > StoTOP then
DivShortCond = False;
If DivShortCond Then {
If (CrossDown(StoK, StoD) and Close<Low[1]) Then
begin
Sell("다이버전스 매도");
DivShortCond = False;
PrevTop = 0;
PrevTopInd = 0;
End;
}