답변완료
문의드립니다!
안녕하세요!
1, 너무 기본적인 질문을 드리는것같아서 죄송합니다만...
아래수식1 이 무었을 뜻하는지 자세한 해석을 부탁드립니다
즉, 참조지표의 2개 행사가의 작용에 의해서 본차트에 선이 발생한다는것은 알겠는데
이 2개 행사가의 어떤 작용에 의한것인지가 궁금합니다
2, 아래 수식2에서 추세선의 변곡이 확정되는 지점에서는 원이 표시가 되는데
(1) 이자리에 원대신 화살표를 표시할순없나요?
단, 이 자리가 직전 변곡지점과 비교해서 하방일 경우에는 파란 하방화살표,
상방일 경우에는 빨간 상방화살표가 표시되었으면 합니다
* 화살표 크기는 제일큰것으로 부탁합니다
(2) 만약 화살표가 불가하다면 좀더 눈에 잘띄는 다른 어떤표시라도 위 (1)번의 조건에 맞게
부탁드립니다
* 이 원표시가 작아서 실시간에서 빠르게 파악하는데 어려움이 있네요
(3) 이마저 어렵다면 현재의 원을 가장 크게해서 위의 (1)번 조건에 맞게 수정 부탁드립니다
*현재 원색상의 설정은 상방 하방으로만 구분해서 일괄적으로 색상이 표시되는것같네요
*** 위 (1) (2) (3) 번중 1개로 정해진후...
이 표시가 예비선의 변곡시에도 발생되었다가 이후 변곡조건이 해소되거나
변곡이 확정되었을때 이 예비선의 표시는 사라지게끔 할수있다면 더욱더 좋겠습니다
매번 도움주심에 항상 감사드립니다 !!!
--------------------------------------------------------------------------------
(수식 1)
var : V1(0,data1);
if crossup(data2(H),data3(L)) or CrossDown(data2(L),data3(H)) Then
{
v1 = data1(C);
PlaySound("C:₩예스트레이더₩data₩Sound₩.wav");
}
plot1(v1);
----------------------------------------------------------------------------------
(수식 2)
Var:Period(20),선두께(6),상승색(white), 하락색(white),예비선색상(white),예비선발생후봉수(3),상승세로선색상(red),하락세로선색상(blue),세로선두께(4);
Var:j(0),T(0);
Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0),idx(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0)/*,ZZ[20](0)*/;
Array:r[7](0),fr[7](0),TL2[7](0),TL3[7](0),TX2[7](0),TX3[7](0);
r[0] = 0;
r[1] = 2;
r[2] = 3.;
r[3] = -1;
r[4] = -2.;
r[5] = 1;
r[6] = 0.5;
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) Then
T = -1;
If T == -1 Then
{
If T[1] != -1 Then
{
For j = 18 DownTo 0
{
LoVal[j+1] = LoVal[j];
LoBar[j+1] = LoBar[j];
//ZZ[j+1] = ZZ[j];
}
LoVal[0] = L;
LoBar[0] = 0;
//ZZ[0] = L;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,상승색);
Tx = Text_New(date11,time11,Value11,"●");
#동그라미 색상, 빨강
Text_SetColor(Tx,RED);
Text_SetStyle(Tx,2,2);
Text_SetSize(tx,12);
//tx = Text_New(date11,time11,Value11,NumToStr(value11,2)+NewLine+NumToStr(value11,2)+NewLine);
//Text_SetStyle(tx,2,1);
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
for j = 0 to 6
{
fr[j] = LoVal[1] + ((HiVal[0] - LoVal[1]) * r[j]);
}
//TL2[0] = TL_New(date21,time21,fr[0],date22,time22,fr[0]);
//TL_SetColor(TL2[0],RED);
#TL2[1] = TL_New(date21,time21,fr[1],date22,time22,fr[1]);
#TL_SetColor(TL2[1],RED);
#TL_SetStyle(TL2[1], 3);
#TL2[2] = TL_New(date21,time21,fr[2],date22,time22,fr[2]);
#TL_SetColor(TL2[2],RED);
#TL_SetSize(TL2[2],1);
#TX2[2] = Text_New(date22,time22,fr[2],NumToStr(fr[2],2));
#Text_SetColor(Tx2[2],BWHITE);
#Text_SetStyle(TX2[2],1,1);
#TL2[3] = TL_New(date21,time21,fr[3],date22,time22,fr[3]);
#TL_SetColor(TL2[3],RED);
#TL_SetStyle(TL2[3], 3);
#TL2[4] = TL_New(date21,time21,fr[4],date22,time22,fr[4]);
#TL_SetColor(TL2[4],RED);
#TL_SetSize(TL2[4],1);
#TX2[4] = Text_New(date22,time22,fr[4],NumToStr(fr[4],2));
#Text_SetColor(Tx2[4],BWHITE);
#Text_SetStyle(TX2[4],1,0);
//TL2[5] = TL_New(date21,time21,fr[5],date22,time22,fr[5]);
//TL_SetColor(TL2[5],RED);
//TL2[6] = TL_New(date21,time21,fr[6],date22,time22,fr[6]);
//TL_SetColor(TL2[6],MAGENTA);
idx = 0;
}
If LoVal[0] > L Then
{
LoVal[0] = L;
LoBar[0] = 0;
//ZZ[0] = L;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date22 = date[0];
time22 = stime[0];
//Tx = Text_New_Self(date12,time12,Value12,NumToStr(abs(value11-value12)/PriceScale,0)+" ");
#동그라미 색상, 빨강
//Text_SetColor(Tx,BLUE);
//Text_SetStyle(Tx,1,0);
TL_SetEnd(TL2[0],date22,time22,fr[0]);
TL_SetEnd(TL2[1],date22,time22,fr[1]);
TL_SetEnd(TL2[2],date22,time22,fr[2]);
Text_SetLocation(TX2[2],date22,time22,fr[2]);
TL_SetEnd(TL2[3],date22,time22,fr[3]);
TL_SetEnd(TL2[4],date22,time22,fr[4]);
Text_SetLocation(TX2[4],date22,time22,fr[4]);
TL_SetEnd(TL2[5],date22,time22,fr[5]);
TL_SetEnd(TL2[6],date22,time22,fr[6]);
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
idx = 0;
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
//ZZ[j+1] = ZZ[j];
}
HiVal[0] = H;
HiBar[0] = 0;
//ZZ[0] = H;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,하락색);
Tx1 = Text_New(date11,time11,Value11,"●");
#동그라미 색상, 파랑
Text_SetColor(Tx1,BLUE);
Text_SetStyle(Tx1,2,2);
Text_SetSize(tx1,12);
//tx = Text_New(date11,time11,Value11,NewLine+NumToStr(value11,2)+NewLine+NumToStr(value11,2));
//Text_SetStyle(tx,2,0);
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
for j = 0 to 5
{
fr[j] = LoVal[0] + ((HiVal[1] - LoVal[0]) * r[j]);
}
//TL3[0] = TL_New(date31,time31,fr[0],date32,time32,fr[0]);
//TL_SetColor(TL3[0],BLUE);
#TL3[1] = TL_New(date31,time31,fr[1],date32,time32,fr[1]);
#TL_SetColor(TL3[1],BLUE);
#TL_SetStyle(TL3[1], 3);
#TL3[2] = TL_New(date31,time31,fr[2],date32,time32,fr[2]);
#TL_SetColor(TL3[2],BLUE);
#TL_SetSize(TL3[2],1);
#TX3[2] = Text_New(date32,time32,fr[2],NumToStr(fr[2],2));
#Text_SetColor(Tx3[2],BWHITE);
#Text_SetStyle(TX3[2],1,1);
#TL3[3] = TL_New(date31,time31,fr[3],date32,time32,fr[3]);
#TL_SetColor(TL3[3],BLUE);
#TL_SetStyle(TL3[3], 3);
#TL3[4] = TL_New(date31,time31,fr[4],date32,time32,fr[4]);
#TL_SetColor(TL3[4],BLUE);
#TL_SetSize(TL3[4],1);
#TX3[4] = Text_New(date32,time32,fr[4],NumToStr(fr[4],2));
#Text_SetColor(Tx3[4],BWHITE);
#Text_SetStyle(TX3[4],1,0);
//TL3[5] = TL_New(date31,time31,fr[5],date32,time32,fr[5]);
//TL_SetColor(TL3[5],BLUE);
//TL3[6] = TL_New(date31,time31,fr[6],date32,time32,fr[6]);
//TL_SetColor(TL3[6],cyan);
idx = 0;
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
//ZZ[0] = H;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date32 = date[0];
time32 = stime[0];
//Tx = Text_New_Self(date12,time12,Value12,NumToStr(abs(value11-value12)/PriceScale,0)+" ");
#동그라미 색상, 빨강
//Text_SetColor(Tx,RED);
//Text_SetStyle(Tx,1,1);
TL_SetEnd(TL3[0],date32,time32,fr[0]);
TL_SetEnd(TL3[1],date32,time32,fr[1]);
TL_SetEnd(TL3[2],date32,time32,fr[2]);
Text_SetLocation(TX3[2],date32,time32,fr[2]);
TL_SetEnd(TL3[3],date32,time32,fr[3]);
TL_SetEnd(TL3[4],date32,time32,fr[4]);
Text_SetLocation(TX3[4],date32,time32,fr[4]);
TL_SetEnd(TL3[5],date32,time32,fr[5]);
TL_SetEnd(TL3[6],date32,time32,fr[6]);
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
idx = 0;
}
}
idx = idx+1;
TL_SetSize(tL,선두께);
TL_SetSize(tL1,선두께);
TL_SetColor(tL,예비선색상);
var : VTL(0);
if idx == 예비선발생후봉수 Then
{
TL_Delete(VTL);//모든선을 표시하고자 할경우 이 줄만 삭제하면 됨.
VTL = TL_New(sdate,stime,999999999,sDate,stime,0);
TL_SetColor(VTL,iff(T == -1,상승세로선색상,하락세로선색상));
TL_SetSize(VTL,세로선두께);
}
2020-07-01
1724
글번호 140310
지표
답변완료
지표문의
1.아래는 밴드 지표인데요 여기에 중간(2등분선) 수평선 하나를 추가 하고 싶어서요
지표 수정 부착 드립니다.
inputs : ShowAll(true),P(5),Dv(2),굵기(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),bbup(0),bbdn(0);
BBup = BollBandUp(P,dv);
BBdn = BollBandDown(P,dv);
if CurrentBar == 1 then begin
BoxTop = BBup;
BoxBtm = bbdn;
State1 = true;
BBD = date;
BBT = time;
end;
if CurrentBar >= 1 then
{
if NewBox and BBup > 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 BBdn < 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 BBup > BoxTop then begin
BoxTop = BBup;
State1 = true;
State4 = false;
CurrState = 1;
end
else begin
if BBdn < BoxBtm then begin
State4 = false;
State3 = true;
BoxBtm = BBdn;
CurrState = 3;
end
else begin
State4 = false;
State5 = true;
CurrState = 5;
end;
end;
end;
if State3 then begin
if BBup > BoxTop then begin
BoxTop = BBup;
State1 = true;
State3 = false;
CurrState = 1;
end
else begin
if BBdn < BoxBtm then begin
State3 = true;
BoxBtm = BBdn;
CurrState = 3;
end
else begin
State3 = false;
State4 = true;
CurrState = 4;
end;
end;
end;
if State2 then begin
if BBup > BoxTop then begin
BoxTop = BBup;
State1 = true;
State2 = false;
CurrState = 1;
end
else begin
State2 = false;
State3 = true;
BoxBtm = BBdn;
CurrState = 3;
end;
end;
if State1 then begin
if BBup > BoxTop then begin
BoxTop = BBup;
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 BBdn < BoxBtm then begin
BoxBtm = BBdn;
State1 = true;
State4 = false;
CurrState = 1;
end
else begin
if BBup > BoxTop then begin
State3 = true;
State4 = false;
BoxTop = bbup;
CurrState = 3;
end
else begin
State4 = false;
State5 = true;
CurrState = 5;
end;
end;
end;
if State3 then begin
if BBdn < BoxBtm then begin
BoxBtm = bbdn;
State1 = true;
State3 = false;
CurrState = 1;
end
else begin
if bbup > BoxTop then begin
State3 = true;
BoxTop = bbup;
CurrState = 3;
end
else begin
State3 = false;
State4 = true;
CurrState = 4;
end;
end;
end;
if State2 then begin
if bbdn < BoxBtm then begin
Boxbtm = bbdn;
State1 = true;
State2 = false;
CurrState = 1;
end
else begin
State2 = false;
State3 = true;
BoxTop = bbup;
CurrState = 3;
end;
end;
if State1 then begin
if bbdn < BoxBtm then begin
BoxBtm = bbdn;
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, LGREEN);
TL_SetColor(BtmId, LGREEN);
TL_SetColor(LSId, LGREEN);
TL_SetSize(TopId, 굵기);
TL_SetSize(BtmId, 굵기);
TL_SetSize(LSId, 굵기);
end
else begin
TL_SetColor(TopId, LGREEN);
TL_SetColor(BtmId, LGREEN);
TL_SetColor(LSId, LGREEN);
TL_SetSize(TopId, 굵기);
TL_SetSize(BtmId, 굵기);
TL_SetSize(LSId, 굵기);
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 = bbup;
BoxBtm = bbdn;
end;
}
Plot1(ma(C,P), "이동평균1");
2.그럼 수고 하세요
2020-07-01
1710
글번호 140308
지표