답변완료
추세선 박스 아래쪽으로
input : Period(130);
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);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
Array:r[7](0),fr[7](0),TL2[7](0),TL3[7](0),TX2[7](0),TX3[7](0);
var : box(0),box1(0);
Plot1(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];
}
LoVal[0] = L;
LoBar[0] = 0;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
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]);
}
box = box_new(date11,time11,Value11,date12,time12,Value12);
Box_SetColor(box,Lime);
Box_SetFill(box,true,40);
Text_SetSize(tx,20);
if abs(value12[1]-value11[1]) < 0.75 Then
Text_Delete(tx);
tx = text_new(sDate,stime,value12,NumToStr(value12-value11,2));
Text_SetColor(Tx,Blue);
Text_SetStyle(tx,1,0);
Text_SetSize(tx,30);
Text_SetBold(tx,1);
}
If LoVal[0] > L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date22 = date[0];
time22 = stime[0];
Box_SetEnd(box,date12,time12,Value12);
Text_SetString(tx,NumToStr(value12-value11,2));
Text_SetLocation(tx,sDate,sTime,value12);
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
}
HiVal[0] = H;
HiBar[0] = 0;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[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]);
}
box = Box_New(date11,time11,Value11,date12,time12,Value12);
Box_SetColor(box,Magenta);
Box_SetFill(box,true,40);
Text_SetSize(tx,20);
if abs(value12[1]-value11[1]) < 0.75 Then
Text_Delete(tx);
tx = text_new(sDate,stime,value12,NumToStr(value12-value11,2));
Text_SetColor(Tx,Red);
Text_SetStyle(tx,1,1);
Text_SetSize(tx,30);
Text_SetBold(tx,1);
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date32 = date[0];
time32 = stime[0];
Box_SetEnd(box,date12,time12,Value12);
Text_SetString(tx,NumToStr(value12-value11,2));
Text_SetLocation(tx,sDate,sTime,value12);
}
}
차트쪽에 있는 추세선 박스를 변화없이 현재 모양과 기능 그대로, 아래의 보조지표 쪽으로 옮겨 다른 보조지표와 겹쳐서 함께 볼수 있을까요? 감사합니다.
2022-12-25
1117
글번호 164821
지표
답변완료
문의 드립니다
input : StartTime(220000),EndTime(40000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Inputs: VtyPercent(0.16),ATRperiod(50);
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == 1 Then
Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == -1 Then
ExitLong ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE2)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> 1 Then
ExitShort ("Vty_LE2", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == -1 Then
Sell ("Vty_SE3)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == 1 Then
ExitShort ("Vty_LE3", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
-----------------------------
1.
위 내용이 청산 가능한 수식어인지 궁금하네요.
절대값 abs함수를 넣으면 진입후 20틱내 청산금지의
수식어가 가능하다고 말씀하셨길래 자료를 찾아봐도 아래 내용 뿐입니다.
수정 편집이 가능한지 문의 드립니다.
plot1(data2(abs(C))+data3(abs(c)));
abs(K-Y)
K와 Y가 가중이평선이시면
var : K(0),Y(0);
K = wma(c,5);
Y = wma(C,20);
plot1(abs(K-Y));
2.
Inputs: VtyPercent(0.16),ATRperiod(50);
위 수식어의 해석이 "진입전 캔들 50봉의 상하단 16% 에서 진입신호"가
맞는지 문의 드립니다.
3.
위 첫번째 수식어는 진입신호의 방향성을 인지하기 위해 익절,손절을 넣지않았는데
손실 20틱일때 청산후 반대 포지션으로 진입하며 그 횟수는 55회로 한정하는
수식어를 부탁드립니다.
예전에 작성하신 수식어는 신호가 1회만 나오는듯해서 다시금 문의 드립니다.
-----------------------------------
input : StartTime(210000),EndTime(60000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Inputs: VtyPercent(0.16),ATRperiod(50);
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == 1 Then
Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == -1 Then
ExitLong ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> 1 Then
ExitShort ("Vty_LE2", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE2)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == 1 Then
ExitShort ("Vty_LE3", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == -1 Then
Sell ("Vty_SE3)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
위수식어의 매매시간을 항생매매시간인 10시10분부터 당일 15시 30분까지로
변경을 부탁드립니다.
2022-12-26
1141
글번호 164816
시스템