답변완료
부탁드립니다
과거에 만들어 주신 수식입니다.
//n이 0이면 당일시가, 1이면 전일종가, 2이면 차트첫봉시가기준 으로 되어 있습니다.
이렇게 이용하니, 전일의 그래프와 당일의 그래프가 겹쳐져서 당일아침에 왜곡이 많이 생깁니다.
그래서 날짜와 시간을 지정해서 그때부터 그래프가 그려지면 좋겠습니다..
부탁드립니다.
//n이 0이면 당일시가, 1이면 전일종가, 2이면 차트첫봉시가기준
//data1-콜, data2-풋, data3-선물
input : N(0),선비(0),옵비(0),P1(3),P2(5),P3(10);
var : O1(0,data1),R1(0,data1),M21(0,data1),M22(0,data1),M23(0,data1);
var : O2(0,data2),R2(0,data2);//
var : O3(0,data3),R3(0,data3),M11(0,data3),M12(0,data3),M13(0,data3);
var : sp(0);
if N == 0 Then //시가기준
{
O1 = data1(openD(0));
O2 = data2(openD(0));
O3 = data3(openD(0));
}
if N == 1 Then
{
O1 = data1(closeD(1));
O2 = data2(closeD(1));
O3 = data3(closeD(1));
}
if N == 2 then
{
if data1(index == 0) Then
O1 = data1(O);
if data2(index == 0) Then
O2 = data2(O);
if data3(index == 0) Then
O3 = data3(O);
}
if O1 > 0 Then
{
R3 = data3((C-O3)/O3*선비);
M11 = data3(ma(R1,P1));
M12 = data3(ma(R1,P2));
M13 = data3(ma(R1,P3));
plot1(R3,"d1 등락률");
plot2(M11,"d1 이평1");
plot3(M12,"d1 이평2");
plot4(M13,"d1 이평3");
}
if O2 > 0 Then
{
R1 = data1((C-O1)/O1*옵비);
M21 = data1(ma(R1,P1));
M22 = data1(ma(R1,P2));
M23 = data1(ma(R1,P3));
plot21(R1,"d2 등락률");
plot6(M21,"d2 이평3");
plot7(M22,"d2 이평3");
plot8(M23,"d2 이평3");
}
if O3 > 0 Then
{
R2 = data2((C-O2)/O2*옵비)*-1;
plot31(R2,"d3 등락률");
plot41(sp,"sp 등락률");
}
if O1 > 2 and O3 > 0 Then
{
sp = r1-r2;
Plot10(sp);
}
2024-09-26
1049
글번호 183766
지표
답변완료
수식변경요청
안녕하세요 늘 도움 감사드립니다.
아래의 수식에서 ...
고점은 음봉의 고점에...
저점은 양봉의 저가에
고저가 그려지도록 부탁드립니다.
input : af(0.02), maxAF(0.2),추세선두께(1),추세선색1(YELLOW),추세선색2(CYAN),연장선두께(2),연장선색(gray);
input : 텍스트출력(1);
var : T(0),HH(0),LL(0),HD(0),HT(0),LD(0),LT(0);
var : HH1(0),LL1(0),HD1(0),HT1(0),LD1(0),LT1(0);
var : TL1(0),TL2(0),cnt(0),count(0);
var : TL3(0),TL4(0),TL5(0),TL6(0),TL7(0);
var : Tx3(0),Tx4(0),Tx5(0),Tx6(0),Tx7(0);
Var : TL11(0),TL22(0);
var1 = CSar(af,maxAF);
if crossup(c,var1) Then
{
T = 1;
HH = H;
HD = sdate;
HT = stime;
HH1 = HH[1];
HD1 = HD[1];
HT1 = HT[1];
if LL > 0 Then
{
#TL1 = TL_new(LD[1],LT[1],LL[1],HD,HT,HH);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL3 = TL_new(HD[1],HT[1],HH[1],sdate,stime,HH[1]);
TL4 = TL_new(HD[1],HT[1],(HH[1]+LL)/2,sdate,stime,(HH[1]+LL)/2);
TL5 = TL_new(HD[1],HT[1],LL,sdate,stime,LL);
TL6 = TL_new(HD[1],HT[1],HH[1]+(HH[1]-LL)/2,sdate,stime,HH[1]+(HH[1]-LL)/2);
TL7 = TL_new(HD[1],HT[1],LL-(HH[1]-LL)/2,sdate,stime,LL-(HH[1]-LL)/2);
//추세선 오른쪽 연장설정
TL_SetExtRight(TL3,true);
TL_SetExtRight(TL4,true);
TL_SetExtRight(TL5,true);
TL_SetExtRight(TL6,true);
TL_SetExtRight(TL7,true);
Text_Delete(TX3);
Text_Delete(TX4);
Text_Delete(TX5);
Text_Delete(TX6);
Text_Delete(TX7);
value3 = HH[1];
value4 = (HH[1]+LL)/2;
value5 = LL;
value6 = HH[1]+(HH[1]-LL)/2;
value7 = LL-(HH[1]-LL)/2;
TX3 = Text_New(sDate,sTime,value3,NumToStr(value3,2));
TX4 = Text_New(sDate,sTime,value4,NumToStr(value4,2));
TX5 = Text_New(sDate,sTime,value5,NumToStr(value5,2));
TX6 = Text_New(sDate,sTime,value6,NumToStr(value6,2));
TX7 = Text_New(sDate,sTime,value7,NumToStr(value7,2));
/* if 텍스트출력 == 1 then
{
Tx11 = Text_New(HD1,HT1,HH1,NumToStr((HH1-LL1)/PriceScale,0)+NewLine+NumToStr(HH1,2));
Text_SetStyle(tx11,2,1);
Text_Delete(tx1);
Tx1 = Text_New(HD,HT,HH,NumToStr((HH-LL[1])/PriceScale,0)+NewLine+NumToStr(HH,2));
Text_SetStyle(tx1,2,1);
}*/
}
#TL11 = TL_New(HD1,HT1,HH1,HD,HT,HH);
}
if CrossDown(c,var1) Then
{
T = -1;
LL = L;
LD = sdate;
LT = stime;
LL1 = LL[1];
LD1 = LD[1];
LT1 = LT[1];
if HH > 0 Then
{
#TL2 = TL_new(HD[1],HT[1],HH[1],LD,LT,LL);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL3 = TL_new(LD[1],LT[1],HH,sdate,stime,HH);
TL4 = TL_new(LD[1],LT[1],(HH+LL[1])/2,sdate,stime,(HH+LL[1])/2);
TL5 = TL_new(LD[1],LT[1],LL[1],sdate,stime,LL[1]);
TL6 = TL_new(LD[1],LT[1],LL[1]-(HH-LL[1])/2,sdate,stime,LL[1]-(HH-LL[1])/2);
TL7 = TL_new(LD[1],LT[1],HH[1]+(HH-LL[1])/2,sdate,stime,HH[1]+(HH-LL[1])/2);
//추세선 오른쪽 연장설정
TL_SetExtRight(TL3,true);
TL_SetExtRight(TL4,true);
TL_SetExtRight(TL5,true);
TL_SetExtRight(TL6,true);
TL_SetExtRight(TL7,true);
Text_Delete(TX3);
Text_Delete(TX4);
Text_Delete(TX5);
Text_Delete(TX6);
Text_Delete(TX7);
value3 = HH;
value4 = (HH+LL[1])/2;
value5 = LL[1];
value6 = HH+(HH-LL[1])/2;
value7 = LL[1]-(HH-LL[1])/2;
TX3 = Text_New(sDate,sTime,Value3,NumToStr(Value3,2));
TX4 = Text_New(sDate,sTime,Value4,NumToStr(Value4,2));
TX5 = Text_New(sDate,sTime,Value5,NumToStr(Value5,2));
TX6 = Text_New(sDate,sTime,Value6,NumToStr(Value6,2));
TX7 = Text_New(sDate,sTime,Value7,NumToStr(Value7,2));
/* if 텍스트출력 == 1 then
{
Tx22 = Text_New(LD1,LT1,LL1,NumToStr((HH1-LL1)/PriceScale,0)+NewLine+NumToStr(LL1,2));
Text_SetStyle(tx22,2,0);
Text_Delete(tx2);
Tx2 = Text_New(LD,LT,LL,NumToStr((HH[1]-LL)/PriceScale,0)+NewLine+NumToStr(LL,2));
Text_SetStyle(tx2,2,0);
}*/
}
#TL22 = TL_New(LD1,LT1,LL1,LD,LT,LL);
}
if T == 1 then
{
if H > HH Then
{
HH = H;
HD = sdate;
HT = stime;
TL_SetEnd(TL1,HD,HT,HH);
TL_SetEnd(TL11,HD,HT,HH);
/* if 텍스트출력 == 1 then
{
Text_Delete(tx1);
Tx1 = Text_New(HD,HT,HH,NumToStr((HH-LL[1])/PriceScale,0)+NewLine+NumToStr(HH,2));
Text_SetStyle(tx1,2,1);
}*/
}
}
if T == -1 then
{
if L < LL Then
{
LL = L;
LD = sdate;
LT = stime;
TL_SetEnd(TL2,LD,LT,LL);
TL_SetEnd(TL22,LD,LT,LL);
/* if 텍스트출력 == 1 then
{
Text_Delete(tx2);
Tx2 = Text_New(LD,LT,LL,NumToStr((HH[1]-LL)/PriceScale,0)+NewLine+NumToStr(LL,2));
Text_SetStyle(tx2,2,0);
}*/
}
}
#추세선 두께, 색상
TL_SetSize(TL1,추세선두께);
TL_SetSize(TL11,추세선두께);
TL_SetSize(TL2,추세선두께);
TL_SetSize(TL22,추세선두께);
TL_SetColor(TL1,추세선색1);
TL_SetColor(TL11,추세선색1);
TL_SetColor(TL2,추세선색2);
TL_SetColor(TL22,추세선색2);
#연장선 두께, 색상
TL_SetSize(TL3,연장선두께);
TL_SetSize(TL4,연장선두께);
TL_SetSize(TL5,연장선두께);
TL_SetSize(TL6,연장선두께);
TL_SetSize(TL7,연장선두께);
TL_SetColor(TL3,연장선색);
TL_SetColor(TL4,연장선색);
TL_SetColor(TL5,연장선색);
TL_SetColor(TL6,연장선색);
TL_SetColor(TL7,연장선색);
Text_SetLocation(TX3,sDate,sTime,value3);
Text_SetLocation(TX4,sDate,sTime,Value4);
Text_SetLocation(TX5,sDate,sTime,Value5);
Text_SetLocation(TX6,sDate,sTime,Value6);
Text_SetLocation(TX7,sDate,sTime,Value7);
Text_SetStyle(TX3,0,1);
Text_SetStyle(TX4,0,1);
Text_SetStyle(TX5,0,1);
Text_SetStyle(TX6,0,1);
Text_SetStyle(TX7,0,1);
2024-09-26
727
글번호 183758
지표