커뮤니티

수식 문의

프로필 이미지
흑수돌
2012-08-01 23:31:38
319
글번호 53441
답변완료
무더운 여름 고생많으십니다. 건강관리 잘 하시고 항상 감사드립니다. ----------------------------- 아래는 data2로 바꾼 갭보정 세븐바이너리웨이브 신호입니다. 아래의 신호가 data2 분봉에서 발생할 때, 그에 해당되는 data1 분봉에 점을 찍고 그 점을 n봉간 늘려주는 지표를 얻고 싶습니다. 단, 매수신호가 발생했을 때는 data1분봉의 저가에 점을 찍고 매도 신호가 발생했을 때는 data1분봉의 고가에 점을 찍어 줍니다. 또, 고가에 찍는 점과 저가에 찍는 점의 색깔을 달리 표현하고 싶습니다. ==========아래 ==================== Input: shortPeriod(13), longPeriod(26), Period(6), maPeriod(13), ROCPeriod(9), stoPeriod1(10), stoPeriod2(6), CCIPeriod(9); input: P1(13),P2(26),P3(6); var: value(0,data2),BW_SEVEN(0,data2); var : Va1(0,data2),va2(0,data2),va3(0,data2),D1Stok(0,data1),D1stod(0,data1); var : sumGap(0,data2), gap(0,data2), GO(0,data2), GH(0,data2), GL(0,data2), GC(0,data2); VAR : TCHAN(0,data1), BCHAN(0,data1); if data2(date!=date[1]) then { gap = data2(Open-Close[1]); sumGap = sumGap+gap; } GO = data2(O - sumGap); GH = data2(H - sumGap); GL = data2(L - sumGap); GC = data2(C - sumGap); //문장1 : MACD가 MACD 시그널선 보다 큼 if data2(ema(gC,shortPeriod)-ema(gC,longPeriod) >= ema(ema(gC,shortPeriod)-ema(gC,longPeriod),Period)) then value = 1; else value = -1; //문장2 : 종가가 이동평균선보다 큼 if data2(gC >= ma(gC, maPeriod)) then value = value + 1; else value = value - 1; //문장3 : Price ROC가 0선보다 큼 if data2((gC - gC[ROCPeriod]) / gC[ROCPeriod] * 100 >= 0) then value = value + 1; else value = value - 1; //문장4 : StochasticsK선이 50선 보다 큼 if data2(ema((gC-lowest(gL, stoPeriod1)) / (highest(gH, stoPeriod1) - lowest(gL, stoPeriod1)) * 100, stoPeriod2)>=50) then value = value + 1; else value = value - 1; Variables: Sum(0), CCIcount(0), MD(0), Avgvalue(0),CCIV(0); If CCIPeriod > 0 Then Begin Avgvalue = data2(Ma(GH + gL + GC, CCIPeriod)); MD = 0; For CCIcount = 0 To CCIPeriod - 1 Begin MD = MD + data2(Abs(GH[CCIcount] + gL[CCIcount] + GC[CCIcount] - Avgvalue)); End; MD = data2(MD / CCIPeriod); If MD == 0 Then CCIv = 0; Else CCIv = data2((GH + gL + GC - Avgvalue) / (0.015 * MD)); End Else CCIv = 0; //CCI가 0선 보다 큼 if CCIv > 0 then value = value + 1; else value = value - 1; //CO가 0선 보다 큼 if data2(ema(accum(((gC -gL)-(gH- gC))/ (gH-gL)*V), 3) - ema(accum(((gC -gL)-(gH- gC))/(gH-gL)*V), 10) >=0) then value = value + 1; else value = value - 1; input : AF(0.02),AFMAX(0.2); Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(h), LowValue(l), EP(0),Sarv(0); if EP != 0 Then { if Direction == 1 then { EP = HighValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gh > HighValue then { HighValue = gh; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } if gl < SAR_Value then { Direction = -1; SAR_Value = EP; AF_Value = 0; EP = 0; LowValue = gl; } } else { EP = LowValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gl < LowValue then { LowValue = gl; AF_Value = AF_Value + Af; if AF_Value >= AFMAX then AF_Value = AFMAX; } if gh > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = gh; } } Sarv = SAR_Value; } else { if SAR_Value != 0 && EP == 0 then { if Direction == 1 then { EP = HighValue; AF_Value = AF; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gh > HighValue then { HighValue = gh; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } else { EP = LowValue; AF_Value = Af; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gl < LowValue then { LowValue = gl; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } Sarv = SAR_Value; } else { if Direction == 0 then { if gc > gc[1] then Direction = 1; else if gc < gc[1] then Direction = -1; } else { if Direction == 1 then { if gc < gc[1] then { Direction = -1; SAR_Value = HighValue; Sarv = SAR_Value; } } if Direction == -1 then { if gc > gc[1] then { Direction = 1; SAR_Value = LowValue; Sarv = SAR_Value; } } } LowValue = min(gl, LowValue); HighValue = max(gh, HighValue); } } //문장7 : 종가가 파라볼릭보다 큼 if Sarv < gC then value = value + 1; else value = value - 1; BW_SEVEN = value; var1 = ema(BW_SEVEN,P1)- ema(BW_SEVEN,P2); var2 = ema(var1,P3); var3 = var1-var2; # 매수/매도청산 If CrossUp(value,2) Then { Buy(); } # 매도/매수청산 If CrossDown(value,-2) Then { Sell(); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-08-02 10:36:27

안녕하세요 예스스탁입니다. 검색식으로 작성하시면 자동으로 봉차트위에 점으로 표현됩니다. 색은 속성에서 변경하시기 바랍니다. Input: shortPeriod(13), longPeriod(26), Period(6), maPeriod(13), ROCPeriod(9), stoPeriod1(10), stoPeriod2(6), CCIPeriod(9); input: P1(13),P2(26),P3(6); input : N(5); var : upidx(0),dnidx(0),upv(0),dnv(0); var: value(0,data2),BW_SEVEN(0,data2); var : Va1(0,data2),va2(0,data2),va3(0,data2),D1Stok(0,data1),D1stod(0,data1); var : sumGap(0,data2), gap(0,data2), GO(0,data2), GH(0,data2), GL(0,data2), GC(0,data2); VAR : TCHAN(0,data1), BCHAN(0,data1); if data2(date!=date[1]) then { gap = data2(Open-Close[1]); sumGap = sumGap+gap; } GO = data2(O - sumGap); GH = data2(H - sumGap); GL = data2(L - sumGap); GC = data2(C - sumGap); //문장1 : MACD가 MACD 시그널선 보다 큼 if data2(ema(gC,shortPeriod)-ema(gC,longPeriod) >= ema(ema(gC,shortPeriod)-ema(gC,longPeriod),Period)) then value = 1; else value = -1; //문장2 : 종가가 이동평균선보다 큼 if data2(gC >= ma(gC, maPeriod)) then value = value + 1; else value = value - 1; //문장3 : Price ROC가 0선보다 큼 if data2((gC - gC[ROCPeriod]) / gC[ROCPeriod] * 100 >= 0) then value = value + 1; else value = value - 1; //문장4 : StochasticsK선이 50선 보다 큼 if data2(ema((gC-lowest(gL, stoPeriod1)) / (highest(gH, stoPeriod1) - lowest(gL, stoPeriod1)) * 100, stoPeriod2)>=50) then value = value + 1; else value = value - 1; Variables: Sum(0), CCIcount(0), MD(0), Avgvalue(0),CCIV(0); If CCIPeriod > 0 Then Begin Avgvalue = data2(Ma(GH + gL + GC, CCIPeriod)); MD = 0; For CCIcount = 0 To CCIPeriod - 1 Begin MD = MD + data2(Abs(GH[CCIcount] + gL[CCIcount] + GC[CCIcount] - Avgvalue)); End; MD = data2(MD / CCIPeriod); If MD == 0 Then CCIv = 0; Else CCIv = data2((GH + gL + GC - Avgvalue) / (0.015 * MD)); End Else CCIv = 0; //CCI가 0선 보다 큼 if CCIv > 0 then value = value + 1; else value = value - 1; //CO가 0선 보다 큼 if data2(ema(accum(((gC -gL)-(gH- gC))/ (gH-gL)*V), 3) - ema(accum(((gC -gL)-(gH- gC))/(gH-gL)*V), 10) >=0) then value = value + 1; else value = value - 1; input : AF(0.02),AFMAX(0.2); Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(h), LowValue(l), EP(0),Sarv(0); if EP != 0 Then { if Direction == 1 then { EP = HighValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gh > HighValue then { HighValue = gh; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } if gl < SAR_Value then { Direction = -1; SAR_Value = EP; AF_Value = 0; EP = 0; LowValue = gl; } } else { EP = LowValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gl < LowValue then { LowValue = gl; AF_Value = AF_Value + Af; if AF_Value >= AFMAX then AF_Value = AFMAX; } if gh > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = gh; } } Sarv = SAR_Value; } else { if SAR_Value != 0 && EP == 0 then { if Direction == 1 then { EP = HighValue; AF_Value = AF; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gh > HighValue then { HighValue = gh; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } else { EP = LowValue; AF_Value = Af; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gl < LowValue then { LowValue = gl; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } Sarv = SAR_Value; } else { if Direction == 0 then { if gc > gc[1] then Direction = 1; else if gc < gc[1] then Direction = -1; } else { if Direction == 1 then { if gc < gc[1] then { Direction = -1; SAR_Value = HighValue; Sarv = SAR_Value; } } if Direction == -1 then { if gc > gc[1] then { Direction = 1; SAR_Value = LowValue; Sarv = SAR_Value; } } } LowValue = min(gl, LowValue); HighValue = max(gh, HighValue); } } //문장7 : 종가가 파라볼릭보다 큼 if Sarv < gC then value = value + 1; else value = value - 1; BW_SEVEN = value; var1 = ema(BW_SEVEN,P1)- ema(BW_SEVEN,P2); var2 = ema(var1,P3); var3 = var1-var2; If CrossUp(value,2) Then{ upidx = 0; upv = L; } upidx = upidx+1; If CrossDown(value,-2) Then{ dnidx = 0; dnv = H; } dnidx = dnidx+1; if upidx >= 1 and upidx <= N Then plot1(upv,"up"); if dnidx >= 1 and dnidx <= N Then plot2(dnv,"dn"); 즐거운 하루되세요 > 흑수돌 님이 쓴 글입니다. > 제목 : 수식 문의 > 무더운 여름 고생많으십니다. 건강관리 잘 하시고 항상 감사드립니다. ----------------------------- 아래는 data2로 바꾼 갭보정 세븐바이너리웨이브 신호입니다. 아래의 신호가 data2 분봉에서 발생할 때, 그에 해당되는 data1 분봉에 점을 찍고 그 점을 n봉간 늘려주는 지표를 얻고 싶습니다. 단, 매수신호가 발생했을 때는 data1분봉의 저가에 점을 찍고 매도 신호가 발생했을 때는 data1분봉의 고가에 점을 찍어 줍니다. 또, 고가에 찍는 점과 저가에 찍는 점의 색깔을 달리 표현하고 싶습니다. ==========아래 ==================== Input: shortPeriod(13), longPeriod(26), Period(6), maPeriod(13), ROCPeriod(9), stoPeriod1(10), stoPeriod2(6), CCIPeriod(9); input: P1(13),P2(26),P3(6); var: value(0,data2),BW_SEVEN(0,data2); var : Va1(0,data2),va2(0,data2),va3(0,data2),D1Stok(0,data1),D1stod(0,data1); var : sumGap(0,data2), gap(0,data2), GO(0,data2), GH(0,data2), GL(0,data2), GC(0,data2); VAR : TCHAN(0,data1), BCHAN(0,data1); if data2(date!=date[1]) then { gap = data2(Open-Close[1]); sumGap = sumGap+gap; } GO = data2(O - sumGap); GH = data2(H - sumGap); GL = data2(L - sumGap); GC = data2(C - sumGap); //문장1 : MACD가 MACD 시그널선 보다 큼 if data2(ema(gC,shortPeriod)-ema(gC,longPeriod) >= ema(ema(gC,shortPeriod)-ema(gC,longPeriod),Period)) then value = 1; else value = -1; //문장2 : 종가가 이동평균선보다 큼 if data2(gC >= ma(gC, maPeriod)) then value = value + 1; else value = value - 1; //문장3 : Price ROC가 0선보다 큼 if data2((gC - gC[ROCPeriod]) / gC[ROCPeriod] * 100 >= 0) then value = value + 1; else value = value - 1; //문장4 : StochasticsK선이 50선 보다 큼 if data2(ema((gC-lowest(gL, stoPeriod1)) / (highest(gH, stoPeriod1) - lowest(gL, stoPeriod1)) * 100, stoPeriod2)>=50) then value = value + 1; else value = value - 1; Variables: Sum(0), CCIcount(0), MD(0), Avgvalue(0),CCIV(0); If CCIPeriod > 0 Then Begin Avgvalue = data2(Ma(GH + gL + GC, CCIPeriod)); MD = 0; For CCIcount = 0 To CCIPeriod - 1 Begin MD = MD + data2(Abs(GH[CCIcount] + gL[CCIcount] + GC[CCIcount] - Avgvalue)); End; MD = data2(MD / CCIPeriod); If MD == 0 Then CCIv = 0; Else CCIv = data2((GH + gL + GC - Avgvalue) / (0.015 * MD)); End Else CCIv = 0; //CCI가 0선 보다 큼 if CCIv > 0 then value = value + 1; else value = value - 1; //CO가 0선 보다 큼 if data2(ema(accum(((gC -gL)-(gH- gC))/ (gH-gL)*V), 3) - ema(accum(((gC -gL)-(gH- gC))/(gH-gL)*V), 10) >=0) then value = value + 1; else value = value - 1; input : AF(0.02),AFMAX(0.2); Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(h), LowValue(l), EP(0),Sarv(0); if EP != 0 Then { if Direction == 1 then { EP = HighValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gh > HighValue then { HighValue = gh; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } if gl < SAR_Value then { Direction = -1; SAR_Value = EP; AF_Value = 0; EP = 0; LowValue = gl; } } else { EP = LowValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gl < LowValue then { LowValue = gl; AF_Value = AF_Value + Af; if AF_Value >= AFMAX then AF_Value = AFMAX; } if gh > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = gh; } } Sarv = SAR_Value; } else { if SAR_Value != 0 && EP == 0 then { if Direction == 1 then { EP = HighValue; AF_Value = AF; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gh > HighValue then { HighValue = gh; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } else { EP = LowValue; AF_Value = Af; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if gl < LowValue then { LowValue = gl; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } Sarv = SAR_Value; } else { if Direction == 0 then { if gc > gc[1] then Direction = 1; else if gc < gc[1] then Direction = -1; } else { if Direction == 1 then { if gc < gc[1] then { Direction = -1; SAR_Value = HighValue; Sarv = SAR_Value; } } if Direction == -1 then { if gc > gc[1] then { Direction = 1; SAR_Value = LowValue; Sarv = SAR_Value; } } } LowValue = min(gl, LowValue); HighValue = max(gh, HighValue); } } //문장7 : 종가가 파라볼릭보다 큼 if Sarv < gC then value = value + 1; else value = value - 1; BW_SEVEN = value; var1 = ema(BW_SEVEN,P1)- ema(BW_SEVEN,P2); var2 = ema(var1,P3); var3 = var1-var2; # 매수/매도청산 If CrossUp(value,2) Then { Buy(); } # 매도/매수청산 If CrossDown(value,-2) Then { Sell(); }