답변완료
수정 부탁합니다
1.전고점(TL13) 돌파시 TL13을 RED로 전환
전저점(TL15) 붕괴시 TL15를 BLUE로 전환
2.HH = IFF(0==1,C,H);
LL = IFF(0==1,C,L);
If 1 == 1 Then
에서 0==1, 1==1 는 어떤의미인지요?
감사합니다~
input:length(6);
Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""),
TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡("");
Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime
#==========================================#
HH = IFF(0==1,C,H);
LL = IFF(0==1,C,L);
If Index == 0 Then
{
고[1,1] = HH;
저[1,1] = LL;
}
Condition1 = Highest(HH,length) == HH and 최종고가 <> HH;
Condition2 = Lowest (LL,length) == LL and 최종저가 <> LL;
처리구분 = "";
If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생
{
If 최종꼭지점 == "저점" Then
{
If 저[1,1] > LL Then 처리구분 = "저점처리";
Else 처리구분 = "고점처리";
}
Else If 최종꼭지점 == "고점" Then
{
If 고[1,1] < HH Then 처리구분 = "고점처리";
Else 처리구분 = "저점처리";
}
}
Else If Condition1 Then 처리구분 = "고점처리";
Else If Condition2 Then 처리구분 = "저점처리";
#==========================================#
If 처리구분 == "고점처리" Then
{
T = 1;
최종고가 = HH; // 신규고점을 체크하기 위해 저장
If 최종꼭지점 == "저점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
고[j,jj] = 고[j-1,jj];
}
}
고[1,1] = HH;
고[1,2] = Index;
고[1,3] = sDate;
고[1,4] = sTime;
TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]);
If 1 == 1 Then
{
Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2));
Text_SetStyle(Text1, 0, 1);
Text_SetColor(Text1,WHITE);
}
TL_SetSize(TL1,0);
TL_SetColor(TL1,WHITE);
}
Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현
{
고[1,1] = HH;
고[1,2] = Index;
고[1,3] = sDate;
고[1,4] = sTime;
TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]);
// 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임
If 1 == 1 Then
{
Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]);
Text_SetString(Text1,NumToStr(고[1,1],2));
}
}
최종꼭지점 = "고점";
}
#==========================================#
If 처리구분 == "저점처리" Then
{
T = -1;
최종저가 = LL;
If 최종꼭지점 == "고점" then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
저[j,jj] = 저[j-1,jj];
}
}
저[1,1] = LL;
저[1,2] = Index;
저[1,3] = sDate;
저[1,4] = sTime;
TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);
If 1 == 1 Then
{
Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2));
Text_SetStyle(Text1, 0, 0);
Text_SetColor(Text1,WHITE);
}
TL_SetSize(TL1,0);
TL_SetColor(TL1,WHITE);
}
Else If 저[1,1] > LL then
{
저[1,1] = LL;
저[1,2] = Index;
저[1,3] = sDate;
저[1,4] = sTime;
TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]);
If 1 == 1 Then
{
Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]);
Text_SetString(Text1,NumToStr(저[1,1],2));
}
}
최종꼭지점 = "저점";
}
if T == -1 and T[1] != -1 Then
{
TL12 = TL_New(고[2,3],고[2,4],고[2,1],sdate,stime,고[2,1]);
TL_Delete(TL13);
TL13 = TL_New(고[1,3],고[1,4],고[1,1],Sdate,Stime,고[1,1]);
TL_SetExtRight(TL13,true);
TL_SetSize(TL13,1);
TL_SetColor(TL12,Pink);
TL_SetColor(TL13,Pink);
if CrossUp(c, 고[1,1]) Then
{
TL_SetColor(TL12,Red);
TL_SetColor(TL13,Red);
TL_SetSize(TL12,2);
TL_SetSize(TL13,2);
}
}
if T == 1 and T[1] != 1 Then
{
TL14= TL_New(저[2,3],저[2,4],저[2,1],sdate,stime,저[2,1]);
TL_Delete(TL15);
TL15= TL_New(저[1,3],저[1,4],저[1,1],sdate,stime,저[1,1]);
TL_SetExtRight(TL15,true);
TL_SetColor(TL14,Brown);
TL_SetColor(TL15,Brown);
TL_SetSize(TL15,1);
if CrossDown(c, 저[1,1]) Then
{
TL_SetColor(TL14,Blue);
TL_SetColor(TL15,Blue);
}
}
2022-11-29
1054
글번호 164230
지표
답변완료
슈퍼트렌드 쌍바닥 쌍봉
input : Factor(7),Pd(10),highPd(1),lowPd(5);
var : sp(0),th(0),ll(0),myh(0),myl(0),up(0),dn(0),ii(0),Trendup(0),trenddown(0),Trend(0);
var : Tsl(0),linecolor(0),tx(0),tl(0);
sp = (H+L+c)/3;
th = high;
for ii = 1 to Pd*highPd
{
if th < high[ii] Then
th = high[ii];
}
ll = low;
for ii=1 to Pd*lowPd
{
if ll > low[ii] Then
ll = low[ii];
}
myh = ma(high,Pd)*0.4+th*0.6;
myl = (ma(sp,Pd)*0.5+ll*0.5);
Up = myl-(Factor*atr(Pd)*0.8 );
Dn = (myh+(Factor*atr(Pd) ));
TrendUp = iff(sp[1]>TrendUp[1], max(Up,TrendUp[1]) , Up);
TrendDown = iff(sp[1]<TrendDown[1], min(Dn,TrendDown[1]) , Dn);
Trend = iff(sp > TrendDown[1] , 1, iff(sp< TrendUp[1] , -1, Trend[1]));
Tsl = IFF(Trend==1, TrendUp, TrendDown);
linecolor = IFF(Trend == 1 , Red , Blue);
plot1(Tsl,"SuperTrend",linecolor);
if Trend != Trend[1] Then
{
if Trend == 1 Then
{
tx = Text_New(sDate,sTime, Tsl-PriceScale*0,"●");
Text_SetColor(tx,Green);
Text_SetSize(tx,18);
Text_SetStyle(tx,2,2);
}
Else
{
tx = Text_New(sDate,sTime, Tsl+PriceScale*1,"●");
Text_SetColor(tx,Magenta);
Text_SetSize(tx,15);
Text_SetStyle(tx,2,2);
}
}
1.지표식: 변수 분리해서 쌍바닥,쌍봉에 동그라미 추가. 변수 상하로도 또 분리.
2.시스템: 쌍바닥 매수,다음 봉에 매수청산. 쌍봉에 매도,다음 봉에 매도청산. 감사합니다.
2022-11-29
1240
글번호 164228
지표