답변완료
전환 쌍바닥
Input : 전환(0.2);
Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""), TL1(0),TX1(0);
Array:고[10,4](0),저[10,4](0);
var : box(0),BB(False);
HH = H;
LL = L;
If Index == 0 Then
{
고[1,1] = HH;
고[1,2] = 0;
고[1,3] = sDate;
고[1,4] = sTime;
저[1,1] = LL;
저[1,2] = 0;
저[1,3] = sDate;
저[1,4] = sTime;
}
If Index > 0 Then
{
hiBar = hiBar + 1;
loBar = loBar + 1;
}
If HH[hiBar] < HH Then hiBar = 0;
If LL[loBar] > LL Then loBar = 0;
Condition1 = 저[1,1]+전환 <= HH and hiBar == 0;
Condition2 = 고[1,1]-전환 >= LL and loBar == 0;
처리구분 = "";
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
{
If 최종꼭지점 == "저점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
고[j,jj] = 고[j-1,jj];
}
}
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
TL1 = TL_New_Self(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]);
TL_SetSize(TL1,2);
TL_SetColor(TL1,RED);
Text_Delete(tx1-1);
TX1 = Text_New_Self(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1]-저[1,1],2));
Text_SetSize(tx1,30);
Text_SetColor(Tx1,Red);
Text_SetStyle(tx1,1,1);
Text_SetBold(tx1,1);
}
Else If 고[1,1] < HH[hiBar] Then
{
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]);
Text_SetString(TX1,NumToStr(고[1,1]-저[1,1],2));
Text_SetLocation(TX1,고[1,3],고[1,4],고[1,1]);
}
최종꼭지점 = "고점";
Plot1(고[1,1]);
NoPlot(2);
}
If 처리구분 == "저점처리" Then
{
If 최종꼭지점 == "고점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
저[j,jj] = 저[j-1,jj];
}
}
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
TL1 = TL_New_Self(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);
TL_SetSize(TL1,2);
TL_SetColor(TL1,BLUE);
Text_Delete(tx1-1);
TX1 = Text_New_Self(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1]-고[1,1],2));
Text_SetSize(tx1,30);
Text_SetColor(Tx1,Blue);
Text_SetStyle(tx1,1,0);
Text_SetBold(tx1,1);
bb = False;
if bb == False and 저[1,1] <= 고[1,1]-0.5 and 고[1,1] > 0 Then
{
bb= true;
box = Box_New_Self(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);
Box_SetColor(box,Lime);
Box_SetFill(box,true,70);
}
}
Else If 저[1,1] > LL[loBar] Then
{
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]);
Text_SetString(TX1,NumToStr(저[1,1]-고[1,1],2));
Text_SetLocation(TX1,저[1,3],저[1,4],저[1,1]);
if bb == true Then
Box_SetEnd(box,저[1,3],저[1,4],저[1,1]);
Else
{
if bb == False and 저[1,1] <= 고[1,1]-0.5 and 고[1,1] > 0 Then
{
bb= true;
box = Box_New_Self(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);
Box_SetColor(box,Lime);
Box_SetFill(box,true,70);
}
}
}
최종꼭지점 = "저점";
Plot2(저[1,1]);
NoPlot(1);
}
a.추세선이 음전환되면 동그라미 표시.
(가) 양전환되거나, (나) 직저 깨진 후 직전저점으로부터 -3틱 도달시 삭제.
b.쌍바닥 : 당일 고점 -0.7p 아래에서
추세선 직저와 상1틱 ~ 하2틱 사이에 쌍바닥이면 동그라미 표시.
c.쌍봉 : 직고와 상0틱 ~ 하1틱 사이에 쌍봉이면 동그라미 표시.
상하 변수 따로 따로 설정. 감사합니다.
2023-03-24
1406
글번호 167472
지표
답변완료
제1조건과 제2조건을 동시에 만족하는 식
안녕하세요?
추세도 있으면서 변동성도 좋을때에 수직선을 긋는 식을 만들고 싶은데 잘 안됩니다.
수정 좀 부탁드립니다.
=======================================================================
//============== TDI(추세지표) ===============//
input : len1(20),len2(40);
var : mt(0),sum1(0),sum2(0),TDI(0),T(0);
mt = Abs(C-C[len1-1]);
sum1 = AccumN(mt,len1);
sum2 = AccumN(mt,len2);
TDI = sum1-(sum2-sum1);
If TDI[0] > TDI[1] Then {
T = 1;
}
//============== ATR(변동성지표) ===============//
Input : Period(14),SigPeriod(9);
var : AvgTrueRange(0,Data1),ATRsig(0,Data1);
Var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),TL8(0),TL9(0),TL10(0);
AvgTrueRange = Data1(ATR(Period));
ATRsig = ema(Data1(ATR(Period)),SigPeriod);
//=========================================//
If T==1 and cRossUp(AvgTrueRange, ATRsig) Then {
TL1 = TL_New(sdate,stime,99999999,sdate,stime,0);
TL_SetColor(TL1,ReD);
TL_SetSize(TL1,0);
PlaySound("C:₩EugeneYesTrader₩Bin10₩data₩Sound₩@거래량증가시작변동성확때시작");
}
2023-03-23
1323
글번호 167468
지표