예스스탁
예스스탁 답변
2023-02-01 11:11:37
안녕하세요
예스스탁입니다.
1
현재 진입이 완성봉에서 값이 셋팅되서 다음봉 미완성시에 발생하는 내용입니다.
atstop,atlimit으로 봉완성시 값이 셋팅이 되면
다음봉 미완성시에 신호발생을 제어할 수 없습니다.
또한 if문이 봉완성기준입니다.
미완성시에 청산시점에서 30분이후로 지정이 불가능합니다.
문의하신 내용이면 시가에 청산이 발생하면
봉단위로 30분이후 봉부터 진입이 발생하게만 작성이 됩니다.
올리신 식이 봉완성시 진입이 있으면 다음봉 시가에서 청산을 모두 하므로
봉완성시 진입이 있으면 다음진입은 30분봉 이상 경과한 다음봉부터 신호가 발생하게 됩니다.
input : starttime(160000),endtime(80000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
var : s1(0),d1(0),tm(0),trade(False),tt(0);
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;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
Trade = true;
}
if D1 > 0 then
{
if NextBarSdate == D1 Then
TM = TimeToMinutes(NextBarStime)-S1;
Else
TM = TimeToMinutes(NextBarStime)+1440-S1;
}
input : 익절틱수(0),손절틱수(0);
if MarketPosition != 0 Then
{
Trade = False;
TT = TM;
}
Else
{
Trade = true;
}
if Trade == False and TM >= TT+30 Then
Trade = true;
if NextBarSdate != sDate and Trade == true Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx1",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx2",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx3",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx4",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b5",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx5",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b6",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx6",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b7",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx7",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b8",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx8",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b9",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx9",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b10",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx10",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b11",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx11",AtMarket);
if NextBarSdate != sDate and Trade == true Then
{
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx1",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx2",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s3",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx3",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s4",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx4",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s5",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx5",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s6",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx6",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s7",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx7",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s8",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx8",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s9",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx9",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s10",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx10",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s11",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx11",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2
해당 내용은 진입을 가상으로 체크해야 하는 부분입니다.
식작성해 보는데 시간이 많이 소모되는 내용으로
일정시간이상 요구되는 내용은 저희가 작성해 드리기 어렵습니다.
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> input : starttime(160000),endtime(80000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
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;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
input : 익절틱수(0),손절틱수(0);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen != C Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx1",AtMarket);
if NextBarOpen != C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx2",AtMarket);
if NextBarOpen != C Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx3",AtMarket);
if NextBarOpen != C Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx4",AtMarket);
if NextBarOpen != C Then
{
Buy("b5",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx5",AtMarket);
if NextBarOpen == C Then
{
Buy("b6",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx6",AtMarket);
if NextBarOpen == C Then
{
Buy("b7",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx7",AtMarket);
if NextBarOpen == C Then
{
Buy("b8",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx8",AtMarket);
if NextBarOpen == C Then
{
Buy("b9",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx9",AtMarket);
if NextBarOpen == C Then
{
Buy("b10",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx10",AtMarket);
if NextBarOpen == C Then
{
Buy("b11",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx11",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx",AtMarket);
if NextBarOpen != C Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx1",AtMarket);
if NextBarOpen != C Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx2",AtMarket);
if NextBarOpen != C Then
{
Sell("s3",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx3",AtMarket);
if NextBarOpen != C Then
{
Sell("s4",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx4",AtMarket);
if NextBarOpen != C Then
{
Sell("s5",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx5",AtMarket);
if NextBarOpen == C Then
{
Sell("s6",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx6",AtMarket);
if NextBarOpen == C Then
{
Sell("s7",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx7",AtMarket);
if NextBarOpen == C Then
{
Sell("s8",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx8",AtMarket);
if NextBarOpen == C Then
{
Sell("s9",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx9",AtMarket);
if NextBarOpen == C Then
{
Sell("s10",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx10",AtMarket);
if NextBarOpen == C Then
{
Sell("s11",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx11",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
--------------
위 수식어에 2가지 경우의 수를 각각 부탁 드립니다.
1. 캔들의 시가에 청산신호후 30분이 지난후 신호가 발생시 주문
2. 캔들의 시가에 청산신호후 6번째 진입신호시 주문