커뮤니티

지표문의

프로필 이미지
성공예견
2020-11-30 15:46:28
645
글번호 144267
답변완료
1.아래 지표를 적용하면 수치가 표시되는데 없애고 굵기 조정하게 수정 좀해주세요 2.inputs : ShowAll(true); var : BoxTop(0), BoxBtm(0), Ctr(0), BBD(0), BBT(0), EBD(0), EBT(0), UpBand(0), DnBand(0), CurrState(1), TextId(-1), TopId(-1), TopIdP(-1), BtmId(-1), BtmIdP(-1), LSId(-1), LSIdP(-1), RSId(-1), RSIdP(-1), HiFirst(true), LoFirst(false), State1(false), State2(false), State3(false), State4(false), State5(false), DrawBox(false), ValidBox(false), HadBreak(false), NewBox(false); if index == 1 then begin BoxTop = high; BoxBtm = low; State1 = true; BBD = date; BBT = time; end; if NewBox and high > UpBand then begin BBD = date; BBT = time; TL_SetEnd(TopId, BBD, BBT, UpBand); TL_SetEnd(BtmId, BBD, BBt, DnBand); RSIdP = RSId ; RSId = TL_New(BBD, BBT, DnBand, BBD, BBT, UpBand); if ShowAll == false and RSIdP <> -1 then TL_Delete( RSIdP ) ; if HiFirst then TL_SetColor(RSId, yellow); else TL_SetColor(RSId, magenta); NewBox = false; State1 = true; LoFirst = false; HiFirst = true; end; if NewBox and low < DnBand then begin BBD = date; BBT = time; TL_SetEnd(TopId, BBD, BBT, UpBand); TL_SetEnd(BtmId, BBD, BBt, DnBand); RSIdP = RSId; RSId = TL_New(BBD, BBT, DnBand, BBD, BBT, UpBand); if ShowAll == false and RSIdP <> -1 then TL_Delete(RSIdP); if HiFirst then TL_SetColor(RSId, yellow) ; else TL_SetColor(RSId, magenta); NewBox = false; State1 = true; HiFirst = false; LoFirst = true; end; if HiFirst then begin if State4 then begin if high > BoxTop then begin BoxTop = high; State1 = true; State4 = false; CurrState = 1; end else begin if low < BoxBtm then begin State4 = false; State3 = true; BoxBtm = low; CurrState = 3; end else begin State4 = false; State5 = true; CurrState = 5; end; end; end; if State3 then begin if high > BoxTop then begin BoxTop = high; State1 = true; State3 = false; CurrState = 1; end else begin if low < BoxBtm then begin State3 = true; BoxBtm = low; CurrState = 3; end else begin State3 = false; State4 = true; CurrState = 4; end; end; end; if State2 then begin if high > BoxTop then begin BoxTop = high; State1 = true; State2 = false; CurrState = 1; end else begin State2 = false; State3 = true; BoxBtm = low; CurrState = 3; end; end; if State1 then begin if high > BoxTop then begin BoxTop = high; State1 = true; CurrState = 1; end else begin State1 = false; State2 = true; CurrState = 2; end; end; end else begin #{ Using LoFirst } if State4 then begin if low < BoxBtm then begin BoxBtm = low; State1 = true; State4 = false; CurrState = 1; end else begin if high > BoxTop then begin State3 = true; State4 = false; BoxTop = high; CurrState = 3; end else begin State4 = false; State5 = true; CurrState = 5; end; end; end; if State3 then begin if low < BoxBtm then begin BoxBtm = low; State1 = true; State3 = false; CurrState = 1; end else begin if high > BoxTop then begin State3 = true; BoxTop = high; CurrState = 3; end else begin State3 = false; State4 = true; CurrState = 4; end; end; end; if State2 then begin if low < BoxBtm then begin Boxbtm = low; State1 = true; State2 = false; CurrState = 1; end else begin State2 = false; State3 = true; BoxTop = high; CurrState = 3; end; end; if State1 then begin if low < BoxBtm then begin BoxBtm = low; State1 = true; CurrState = 1; end else begin State1 = false; State2 = true; CurrState = 2; end; end; end; #{ END IF HIFIRST OR LOFIRST } if State5 then begin DrawBox = true; EBD = date; EBT = time; end; if DrawBox then begin TopIdP = TopId; BtmIdP = BtmId; LSIdP = LSId; TopId = TL_New(BBD, BBT, BoxTop, EBD, EBT, BoxTop); BtmId = TL_New(BBD, BBT, BoxBtm, EBD, EBT, BoxBtm); LSId = TL_New(BBD, BBT, BoxBtm, BBD, BBT, BoxTop); if ShowAll == false then begin if TopIdP <> -1 then TL_Delete(TopIdP); if BtmIdP <> -1 then TL_Delete(BtmIdP); if LSIdP <> -1 then TL_Delete(LSidP); end; if HiFirst then begin TL_SetColor(TopId, yellow); TL_SetColor(BtmId, yellow); TL_SetColor(LSId, yellow); end else begin TL_SetColor(TopId, magenta); TL_SetColor(BtmId, magenta); TL_SetColor(LSId, magenta); end; State1 = false; State2 = false; State3 = false; State4 = false; State5 = false; DrawBox = false; ValidBox = true; end; if ValidBox then begin UpBand = BoxTop; DnBand = BoxBtm; ValidBox = false; NewBox = true; BoxTop = high; BoxBtm = low; end; if HiFirst then TextId = Text_New(date, time, high * 1.0005, NumToStr(CurrState, 0)); else TextId = Text_New(date, time, low * 0.9995, NumToStr(CurrState, 0)); 3.작성해준 지표인데요 " _intercept"여기서 애러가 나세요 수정 좀 해주세요. Input:Period(14),n(0),multi(0.5),Left(3),Right(3); Var:기울기(0),절편(0),회귀선(0),회귀선tmp(0),채널폭(0),j(0),T(0); var : 상단1(0),상단2(0),하단1(0),하단2(0),TL1(0),TL2(0); 기울기 = LRS(C, Period)[n]; 절편 = _intercept(C,Period)[n]; 회귀선 = 기울기 * Index + 절편; 채널폭 = 0; for j = n to Period + n - 1 { 회귀선tmp = 기울기 * Index[j] + 절편; 채널폭 = max(채널폭,max(abs(H[j] - 회귀선tmp),abs(회귀선tmp - L[j]))); } if 회귀선 > 회귀선[1] Then T = 1; if 회귀선 < 회귀선[1] Then T = -1; 상단2 = 회귀선 + 채널폭 * multi; 상단1 = 회귀선 + 채널폭; 하단1 = 회귀선 - 채널폭; 하단2 = 회귀선 - 채널폭 * multi; plot1(회귀선,"회귀선",iff(T==1,RED,BLUE)); plot2(상단1); plot3(하단1); plot4(상단2); plot5(하단2); if SwingHigh(1,상단2,left,right,left+right+1) != -1 Then { var1 = 상단1[right]; TL1 = TL_New(sDate[right],sTime[right],var1,sDate,sTime,var1); TL_SetColor(TL1,BLUE); } Else TL_SetEnd(TL1,sDate,sTime,var1); if Swinglow(1,하단2,left,right,left+right+1) != -1 Then { var2 = 하단1[right]; TL2 = TL_New(sDate[right],sTime[right],var2,sDate,sTime,var2); TL_SetColor(TL2,RED); } Else TL_SetEnd(TL2,sDate,sTime,var2); 4.그럼 수고하세요
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-11-30 16:20:18

안녕하세요 예스스탁입니다. 1 inputs : ShowAll(true),굵기(1); var : BoxTop(0), BoxBtm(0), Ctr(0), BBD(0), BBT(0), EBD(0), EBT(0), UpBand(0), DnBand(0), CurrState(1), TextId(-1), TopId(-1), TopIdP(-1), BtmId(-1), BtmIdP(-1), LSId(-1), LSIdP(-1), RSId(-1), RSIdP(-1), HiFirst(true), LoFirst(false), State1(false), State2(false), State3(false), State4(false), State5(false), DrawBox(false), ValidBox(false), HadBreak(false), NewBox(false); if index == 1 then begin BoxTop = high; BoxBtm = low; State1 = true; BBD = date; BBT = time; end; if NewBox and high > UpBand then begin BBD = date; BBT = time; TL_SetEnd(TopId, BBD, BBT, UpBand); TL_SetEnd(BtmId, BBD, BBt, DnBand); RSIdP = RSId ; RSId = TL_New(BBD, BBT, DnBand, BBD, BBT, UpBand); if ShowAll == false and RSIdP <> -1 then TL_Delete( RSIdP ) ; if HiFirst then TL_SetColor(RSId, yellow); else TL_SetColor(RSId, magenta); NewBox = false; State1 = true; LoFirst = false; HiFirst = true; end; if NewBox and low < DnBand then begin BBD = date; BBT = time; TL_SetEnd(TopId, BBD, BBT, UpBand); TL_SetEnd(BtmId, BBD, BBt, DnBand); RSIdP = RSId; RSId = TL_New(BBD, BBT, DnBand, BBD, BBT, UpBand); if ShowAll == false and RSIdP <> -1 then TL_Delete(RSIdP); if HiFirst then TL_SetColor(RSId, yellow) ; else TL_SetColor(RSId, magenta); NewBox = false; State1 = true; HiFirst = false; LoFirst = true; end; if HiFirst then begin if State4 then begin if high > BoxTop then begin BoxTop = high; State1 = true; State4 = false; CurrState = 1; end else begin if low < BoxBtm then begin State4 = false; State3 = true; BoxBtm = low; CurrState = 3; end else begin State4 = false; State5 = true; CurrState = 5; end; end; end; if State3 then begin if high > BoxTop then begin BoxTop = high; State1 = true; State3 = false; CurrState = 1; end else begin if low < BoxBtm then begin State3 = true; BoxBtm = low; CurrState = 3; end else begin State3 = false; State4 = true; CurrState = 4; end; end; end; if State2 then begin if high > BoxTop then begin BoxTop = high; State1 = true; State2 = false; CurrState = 1; end else begin State2 = false; State3 = true; BoxBtm = low; CurrState = 3; end; end; if State1 then begin if high > BoxTop then begin BoxTop = high; State1 = true; CurrState = 1; end else begin State1 = false; State2 = true; CurrState = 2; end; end; end else begin #{ Using LoFirst } if State4 then begin if low < BoxBtm then begin BoxBtm = low; State1 = true; State4 = false; CurrState = 1; end else begin if high > BoxTop then begin State3 = true; State4 = false; BoxTop = high; CurrState = 3; end else begin State4 = false; State5 = true; CurrState = 5; end; end; end; if State3 then begin if low < BoxBtm then begin BoxBtm = low; State1 = true; State3 = false; CurrState = 1; end else begin if high > BoxTop then begin State3 = true; BoxTop = high; CurrState = 3; end else begin State3 = false; State4 = true; CurrState = 4; end; end; end; if State2 then begin if low < BoxBtm then begin Boxbtm = low; State1 = true; State2 = false; CurrState = 1; end else begin State2 = false; State3 = true; BoxTop = high; CurrState = 3; end; end; if State1 then begin if low < BoxBtm then begin BoxBtm = low; State1 = true; CurrState = 1; end else begin State1 = false; State2 = true; CurrState = 2; end; end; end; #{ END IF HIFIRST OR LOFIRST } if State5 then begin DrawBox = true; EBD = date; EBT = time; end; if DrawBox then begin TopIdP = TopId; BtmIdP = BtmId; LSIdP = LSId; TopId = TL_New(BBD, BBT, BoxTop, EBD, EBT, BoxTop); BtmId = TL_New(BBD, BBT, BoxBtm, EBD, EBT, BoxBtm); LSId = TL_New(BBD, BBT, BoxBtm, BBD, BBT, BoxTop); if ShowAll == false then begin if TopIdP <> -1 then TL_Delete(TopIdP); if BtmIdP <> -1 then TL_Delete(BtmIdP); if LSIdP <> -1 then TL_Delete(LSidP); end; if HiFirst then begin TL_SetColor(TopId, yellow); TL_SetColor(BtmId, yellow); TL_SetColor(LSId, yellow); end else begin TL_SetColor(TopId, magenta); TL_SetColor(BtmId, magenta); TL_SetColor(LSId, magenta); end; State1 = false; State2 = false; State3 = false; State4 = false; State5 = false; DrawBox = false; ValidBox = true; end; if ValidBox then begin UpBand = BoxTop; DnBand = BoxBtm; ValidBox = false; NewBox = true; BoxTop = high; BoxBtm = low; end; TL_SetSize(RSID,굵기); TL_SetSize(TOPID,굵기); TL_SetSize(BTMID,굵기); 2 _intercept 함수는 해당 수식 작성자분이 별도로 함수를 만들어 제공하는 부분입니다. 아래 내용으로 사용자함수 만들어서 추가하신 후에 사용하시면 됩니다. 사용자함수명 : _Intercept 반환값형 : 숫자형 Input: Value(NumericSeries), Period(NumericSimple); Var : j(0),n(0),x(0),y(0); n = Period; x = Index; y = Value; _Intercept = ma(y,n) - (ma(x*y, n) - ma(x,n) * ma(y,n)) / (ma(x^2,n) - (ma(x,n)^2)) * ma(x,n); 즐거운 하루되세요 > 성공예견 님이 쓴 글입니다. > 제목 : 지표문의 > 1.아래 지표를 적용하면 수치가 표시되는데 없애고 굵기 조정하게 수정 좀해주세요 2.inputs : ShowAll(true); var : BoxTop(0), BoxBtm(0), Ctr(0), BBD(0), BBT(0), EBD(0), EBT(0), UpBand(0), DnBand(0), CurrState(1), TextId(-1), TopId(-1), TopIdP(-1), BtmId(-1), BtmIdP(-1), LSId(-1), LSIdP(-1), RSId(-1), RSIdP(-1), HiFirst(true), LoFirst(false), State1(false), State2(false), State3(false), State4(false), State5(false), DrawBox(false), ValidBox(false), HadBreak(false), NewBox(false); if index == 1 then begin BoxTop = high; BoxBtm = low; State1 = true; BBD = date; BBT = time; end; if NewBox and high > UpBand then begin BBD = date; BBT = time; TL_SetEnd(TopId, BBD, BBT, UpBand); TL_SetEnd(BtmId, BBD, BBt, DnBand); RSIdP = RSId ; RSId = TL_New(BBD, BBT, DnBand, BBD, BBT, UpBand); if ShowAll == false and RSIdP <> -1 then TL_Delete( RSIdP ) ; if HiFirst then TL_SetColor(RSId, yellow); else TL_SetColor(RSId, magenta); NewBox = false; State1 = true; LoFirst = false; HiFirst = true; end; if NewBox and low < DnBand then begin BBD = date; BBT = time; TL_SetEnd(TopId, BBD, BBT, UpBand); TL_SetEnd(BtmId, BBD, BBt, DnBand); RSIdP = RSId; RSId = TL_New(BBD, BBT, DnBand, BBD, BBT, UpBand); if ShowAll == false and RSIdP <> -1 then TL_Delete(RSIdP); if HiFirst then TL_SetColor(RSId, yellow) ; else TL_SetColor(RSId, magenta); NewBox = false; State1 = true; HiFirst = false; LoFirst = true; end; if HiFirst then begin if State4 then begin if high > BoxTop then begin BoxTop = high; State1 = true; State4 = false; CurrState = 1; end else begin if low < BoxBtm then begin State4 = false; State3 = true; BoxBtm = low; CurrState = 3; end else begin State4 = false; State5 = true; CurrState = 5; end; end; end; if State3 then begin if high > BoxTop then begin BoxTop = high; State1 = true; State3 = false; CurrState = 1; end else begin if low < BoxBtm then begin State3 = true; BoxBtm = low; CurrState = 3; end else begin State3 = false; State4 = true; CurrState = 4; end; end; end; if State2 then begin if high > BoxTop then begin BoxTop = high; State1 = true; State2 = false; CurrState = 1; end else begin State2 = false; State3 = true; BoxBtm = low; CurrState = 3; end; end; if State1 then begin if high > BoxTop then begin BoxTop = high; State1 = true; CurrState = 1; end else begin State1 = false; State2 = true; CurrState = 2; end; end; end else begin #{ Using LoFirst } if State4 then begin if low < BoxBtm then begin BoxBtm = low; State1 = true; State4 = false; CurrState = 1; end else begin if high > BoxTop then begin State3 = true; State4 = false; BoxTop = high; CurrState = 3; end else begin State4 = false; State5 = true; CurrState = 5; end; end; end; if State3 then begin if low < BoxBtm then begin BoxBtm = low; State1 = true; State3 = false; CurrState = 1; end else begin if high > BoxTop then begin State3 = true; BoxTop = high; CurrState = 3; end else begin State3 = false; State4 = true; CurrState = 4; end; end; end; if State2 then begin if low < BoxBtm then begin Boxbtm = low; State1 = true; State2 = false; CurrState = 1; end else begin State2 = false; State3 = true; BoxTop = high; CurrState = 3; end; end; if State1 then begin if low < BoxBtm then begin BoxBtm = low; State1 = true; CurrState = 1; end else begin State1 = false; State2 = true; CurrState = 2; end; end; end; #{ END IF HIFIRST OR LOFIRST } if State5 then begin DrawBox = true; EBD = date; EBT = time; end; if DrawBox then begin TopIdP = TopId; BtmIdP = BtmId; LSIdP = LSId; TopId = TL_New(BBD, BBT, BoxTop, EBD, EBT, BoxTop); BtmId = TL_New(BBD, BBT, BoxBtm, EBD, EBT, BoxBtm); LSId = TL_New(BBD, BBT, BoxBtm, BBD, BBT, BoxTop); if ShowAll == false then begin if TopIdP <> -1 then TL_Delete(TopIdP); if BtmIdP <> -1 then TL_Delete(BtmIdP); if LSIdP <> -1 then TL_Delete(LSidP); end; if HiFirst then begin TL_SetColor(TopId, yellow); TL_SetColor(BtmId, yellow); TL_SetColor(LSId, yellow); end else begin TL_SetColor(TopId, magenta); TL_SetColor(BtmId, magenta); TL_SetColor(LSId, magenta); end; State1 = false; State2 = false; State3 = false; State4 = false; State5 = false; DrawBox = false; ValidBox = true; end; if ValidBox then begin UpBand = BoxTop; DnBand = BoxBtm; ValidBox = false; NewBox = true; BoxTop = high; BoxBtm = low; end; if HiFirst then TextId = Text_New(date, time, high * 1.0005, NumToStr(CurrState, 0)); else TextId = Text_New(date, time, low * 0.9995, NumToStr(CurrState, 0)); 3.작성해준 지표인데요 " _intercept"여기서 애러가 나세요 수정 좀 해주세요. Input:Period(14),n(0),multi(0.5),Left(3),Right(3); Var:기울기(0),절편(0),회귀선(0),회귀선tmp(0),채널폭(0),j(0),T(0); var : 상단1(0),상단2(0),하단1(0),하단2(0),TL1(0),TL2(0); 기울기 = LRS(C, Period)[n]; 절편 = _intercept(C,Period)[n]; 회귀선 = 기울기 * Index + 절편; 채널폭 = 0; for j = n to Period + n - 1 { 회귀선tmp = 기울기 * Index[j] + 절편; 채널폭 = max(채널폭,max(abs(H[j] - 회귀선tmp),abs(회귀선tmp - L[j]))); } if 회귀선 > 회귀선[1] Then T = 1; if 회귀선 < 회귀선[1] Then T = -1; 상단2 = 회귀선 + 채널폭 * multi; 상단1 = 회귀선 + 채널폭; 하단1 = 회귀선 - 채널폭; 하단2 = 회귀선 - 채널폭 * multi; plot1(회귀선,"회귀선",iff(T==1,RED,BLUE)); plot2(상단1); plot3(하단1); plot4(상단2); plot5(하단2); if SwingHigh(1,상단2,left,right,left+right+1) != -1 Then { var1 = 상단1[right]; TL1 = TL_New(sDate[right],sTime[right],var1,sDate,sTime,var1); TL_SetColor(TL1,BLUE); } Else TL_SetEnd(TL1,sDate,sTime,var1); if Swinglow(1,하단2,left,right,left+right+1) != -1 Then { var2 = 하단1[right]; TL2 = TL_New(sDate[right],sTime[right],var2,sDate,sTime,var2); TL_SetColor(TL2,RED); } Else TL_SetEnd(TL2,sDate,sTime,var2); 4.그럼 수고하세요