예스스탁
예스스탁 답변
2022-11-03 14:25:47
안녕하세요
예스스탁입니다.
1
Inputs: VtyPercent(0.75),ATRperiod(5);
input : StartTime(190000),EndTime(053000);
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);
}
}
if Tcond == true Then
{
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
}
SetStopLoss(PriceScale*100,PointStop);
2
지표로 보시는 박스의 시작지점과 끝지점을 기준으로
신호를 만들수는 없습니다.
해당 박스들은 후행적으로 그려지는 박스입니다.
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) Then
T = -1;
해당 식에서 상승이나 하락을 판단하는 기준은 위 내용입니다.
아래식 적용했을때 매수나 매도의 신호위치가 빨간색구간, 파란색구간을 판단하는 최초봉입니다.
박스는 이때 과거 직전구간의 최고가나 최저가 위치부터 그리게 되어 있을 뿐입니다.
식을 작성해 드리면 추세변경되는 첫봉에서 매수와 매도되게만 작성해 드릴수 있습니다.
input : Period(12),선두께(2);
Var:하락색(Red), 상승색(Blue);
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)/*,ZZ[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);
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];
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,상승색);
Box_SetFill(box,true);
Sell();
}
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];
date22 = date[0];
time22 = stime[0];
Box_SetEnd(box,date12,time12,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];
//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];
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,하락색);
Box_SetFill(box,true);
Buy();
}
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];
date32 = date[0];
time32 = stime[0];
Box_SetEnd(box,date12,time12,Value12);
}
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식 문의 드립니다
> Inputs: VtyPercent(0.75),ATRperiod(5);
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
위 수식어에 해외선물 매매시간을 19:00 ~ 익일 05:30 와 손절100틱 추가의
수식어를 부탁드립니다.
-----------------------
input : Period(12),선두께(2);
Var:하락색(Red), 상승색(Blue);
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)/*,ZZ[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);
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];
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,상승색);
Box_SetFill(box,true);
}
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];
date22 = date[0];
time22 = stime[0];
Box_SetEnd(box,date12,time12,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];
//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];
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,하락색);
Box_SetFill(box,true);
}
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];
Box_SetEnd(box,date12,time12,Value12);
}
}
----------------------
위 수식어와 그래프는 좀전 고성님이 올리신 추세선지표 입니다.
시스템으로 변경하고자 합니다.
적색 시작 싯점 이후 파란색 시작전까지 바이 청산
파란색 시작 싯점 이후 적색 시작전까지 셀 청산의 시스템을 넣고자합니다.
매매시간은 07:00~ 익일05:55 손절 50틱
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 문의 드립니다
>
안녕하세요
예스스탁입니다.
1
Inputs: VtyPercent(0.75),ATRperiod(5);
input : StartTime(190000),EndTime(053000);
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);
}
}
if Tcond == true Then
{
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
}
SetStopLoss(PriceScale*100,PointStop);
2
지표로 보시는 박스의 시작지점과 끝지점을 기준으로
신호를 만들수는 없습니다.
해당 박스들은 후행적으로 그려지는 박스입니다.
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) Then
T = -1;
해당 식에서 상승이나 하락을 판단하는 기준은 위 내용입니다.
아래식 적용했을때 매수나 매도의 신호위치가 빨간색구간, 파란색구간을 판단하는 최초봉입니다.
박스는 이때 과거 직전구간의 최고가나 최저가 위치부터 그리게 되어 있을 뿐입니다.
식을 작성해 드리면 추세변경되는 첫봉에서 매수와 매도되게만 작성해 드릴수 있습니다.
input : Period(12),선두께(2);
Var:하락색(Red), 상승색(Blue);
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)/*,ZZ[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);
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];
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,상승색);
Box_SetFill(box,true);
Sell();
}
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];
date22 = date[0];
time22 = stime[0];
Box_SetEnd(box,date12,time12,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];
//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];
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,하락색);
Box_SetFill(box,true);
Buy();
}
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];
date32 = date[0];
time32 = stime[0];
Box_SetEnd(box,date12,time12,Value12);
}
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식 문의 드립니다
> Inputs: VtyPercent(0.75),ATRperiod(5);
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
위 수식어에 해외선물 매매시간을 19:00 ~ 익일 05:30 와 손절100틱 추가의
수식어를 부탁드립니다.
-----------------------
input : Period(12),선두께(2);
Var:하락색(Red), 상승색(Blue);
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)/*,ZZ[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);
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];
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,상승색);
Box_SetFill(box,true);
}
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];
date22 = date[0];
time22 = stime[0];
Box_SetEnd(box,date12,time12,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];
//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];
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,하락색);
Box_SetFill(box,true);
}
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];
Box_SetEnd(box,date12,time12,Value12);
}
}
----------------------
위 수식어와 그래프는 좀전 고성님이 올리신 추세선지표 입니다.
시스템으로 변경하고자 합니다.
적색 시작 싯점 이후 파란색 시작전까지 바이 청산
파란색 시작 싯점 이후 적색 시작전까지 셀 청산의 시스템을 넣고자합니다.
매매시간은 07:00~ 익일05:55 손절 50틱
-----------------------
마무리시간들
input : starttime(101500),endtime(550000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
}
if h > hh Then
hh = h;
if l < ll Then
ll = l;
if tcond == true and h1 > 0 and l1 > 0 then
{
if crossup(C,l1+(h1-l1)*1.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*1.000+PriceScale*n) Then
buy();
if crossup(C,l1-(h1-l1)*0.618+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.500+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.000+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*-0.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*-0.382+PriceScale*n) Then
buy();
if CrossDown(C,l1+(h1-l1)*1.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*1.000-PriceScale*n) Then
sell();
if CrossDown(C,l1-(h1-l1)*0.618-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.500-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*-0.000-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*-0.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*-0.382-PriceScale*n) Then
sell();
}
if MarketPosition == 1 then
{
if crossup(c,h1+PriceScale*10) Then
exitlong();
if CrossDown(c,l1-PriceScale*10) Then
exitlong();
}
if MarketPosition == -1 then
{
if crossup(c,h1+PriceScale*10) Then
ExitShort();
if CrossDown(c,l1-PriceScale*10) Then
ExitShort();
}