커뮤니티
시스템식 작성 부탁드립니다.
2017-12-15 06:53:34
170
글번호 115010
안녕하세요
답변 항상 잘 이용하고 있습니다.
아래식은 매도만 나오는 식인데 반대의 경우일때 매수식 나오게 부탁드립니다.
//아래는 수식
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
예스스탁 예스스탁 답변
2017-12-15 15:36:05
안녕하세요
예스스탁입니다.
Var: StoLength(12), StoPeriod(5), StoK(0), StoD(0), StoTOP(80), StoBOTTOM(20);
var : 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 bDate <> bDate[1] then
{
FirstBar = index;
DivShortCond = False;
PrevTop = 0;
PrevTopInd = 0;
DivLongCond = False;
PrevBot = 0;
PrevBotInd = 0;
}
If ((High[1] == dayhigh(0) and Close[1] > Open[1]) or (High == DayHigh(0) and Close<Open)) and index <> 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 index <> FirstBar Then
{
If (Low[1]<PrevBot and StoK[1]<StoBOTTOM) or (L>PrevBot and StoK<StoBOTTOM) Then
{
PrevBot = Low[1];
PrevBotInd = StoK[1];
}
Else if PrevBot <> 0 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 = 0;
PrevBotInd = 0;
}
}
즐거운 하루되세요
> 탄젠트80 님이 쓴 글입니다.
> 제목 : 시스템식 작성 부탁드립니다.
>
안녕하세요
답변 항상 잘 이용하고 있습니다.
아래식은 매도만 나오는 식인데 반대의 경우일때 매수식 나오게 부탁드립니다.
//아래는 수식
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;
}
//이상입니다.