커뮤니티

지표문의

프로필 이미지
성공예견
2019-04-02 06:26:52
218
글번호 127555
답변완료
1.아래는 darvas박스 지표인데요 참조종목(data2)으로 쓸수있게금 지표수정 좀 해주세요. 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; 2.그럼 수고하세요
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-04-02 10:31:17

안녕하세요 예스스탁입니다. 추세선으로 그려지는 지표를 참조데이타에 적용하기 위해서는 지표 적용후 마우스로 끌어서 해당 데이타 위로 올려야 합니다. 추세선 자체는 끌어서 올리지 못하므로 끌어서 올리는 용도로 20이평값을 추가했습니다. inputs : ShowAll(true); var : BoxTop(0,data2), BoxBtm(0,data2), Ctr(0,data2), BBD(0,data2), BBT(0,data2), EBD(0,data2), EBT(0,data2), UpBand(0,data2), DnBand(0,data2), CurrState(1,data2), TextId(-1,data2), TopId(-1,data2), TopIdP(-1,data2), BtmId(-1,data2), BtmIdP(-1,data2), LSId(-1,data2), LSIdP(-1,data2), RSId(-1,data2), RSIdP(-1,data2), HiFirst(true,data2), LoFirst(false,data2), State1(false,data2), State2(false,data2), State3(false,data2), State4(false,data2), State5(false,data2), DrawBox(false,data2), ValidBox(false,data2), HadBreak(false,data2), NewBox(false,data2); if data2(index == 1) then begin BoxTop = data2(high); BoxBtm = data2(low); State1 = true; BBD = data2(sDate); BBT = data2(sTime); end; if NewBox and data2(high) > UpBand then begin BBD = data2(sdate); BBT = data2(stime); TL_SetEnd(TopId, BBD, BBT, UpBand); TL_SetEnd(BtmId, BBD, BBt, DnBand); RSIdP = RSId ; RSId = TL_New_Self(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 data2(low) < DnBand then begin BBD = data2(sdate); BBT = data2(stime); TL_SetEnd(TopId, BBD, BBT, UpBand); TL_SetEnd(BtmId, BBD, BBt, DnBand); RSIdP = RSId; RSId = TL_New_Self(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 data2(high) > BoxTop then begin BoxTop = data2(high); State1 = true; State4 = false; CurrState = 1; end else begin if data2(low) < BoxBtm then begin State4 = false; State3 = true; BoxBtm = data2(low); CurrState = 3; end else begin State4 = false; State5 = true; CurrState = 5; end; end; end; if State3 then begin if data2(high) > BoxTop then begin BoxTop = data2(high); State1 = true; State3 = false; CurrState = 1; end else begin if data2(low) < BoxBtm then begin State3 = true; BoxBtm = data2(low); CurrState = 3; end else begin State3 = false; State4 = true; CurrState = 4; end; end; end; if State2 then begin if data2(high) > BoxTop then begin BoxTop = data2(high); State1 = true; State2 = false; CurrState = 1; end else begin State2 = false; State3 = true; BoxBtm = data2(low); CurrState = 3; end; end; if State1 then begin if data2(high) > BoxTop then begin BoxTop = data2(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 data2(low) < BoxBtm then begin BoxBtm = data2(low); State1 = true; State4 = false; CurrState = 1; end else begin if data2(high) > BoxTop then begin State3 = true; State4 = false; BoxTop = data2(high); CurrState = 3; end else begin State4 = false; State5 = true; CurrState = 5; end; end; end; if State3 then begin if data2(low) < BoxBtm then begin BoxBtm = data2(low); State1 = true; State3 = false; CurrState = 1; end else begin if data2(high) > BoxTop then begin State3 = true; BoxTop = data2(high); CurrState = 3; end else begin State3 = false; State4 = true; CurrState = 4; end; end; end; if State2 then begin if data2(low) < BoxBtm then begin Boxbtm = data2(low); State1 = true; State2 = false; CurrState = 1; end else begin State2 = false; State3 = true; BoxTop = data2(high); CurrState = 3; end; end; if State1 then begin if data2(low) < BoxBtm then begin BoxBtm = data2(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 = data2(sdate); EBT = data2(stime); end; if DrawBox then begin TopIdP = TopId; BtmIdP = BtmId; LSIdP = LSId; TopId = TL_New_Self(BBD, BBT, BoxTop, EBD, EBT, BoxTop); BtmId = TL_New_Self(BBD, BBT, BoxBtm, EBD, EBT, BoxBtm); LSId = TL_New_Self(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 = data2(high); BoxBtm = data2(low); end; plot1(data2(ma(C,20))); 즐거운 하루되세요 > 성공예견 님이 쓴 글입니다. > 제목 : 지표문의 > 1.아래는 darvas박스 지표인데요 참조종목(data2)으로 쓸수있게금 지표수정 좀 해주세요. 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; 2.그럼 수고하세요