예스스탁
예스스탁 답변
2023-10-13 13:36:29
안녕하세요
예스스탁입니다.
1
input : StartTime(140000),EndTime(50000),midtime(210000);
input : 익절틱수1(0),손절틱수1(40);
input : 익절틱수2(80),손절틱수2(80);
var : Tcond(False),entry(0),T(0);
Variables: Mom(0);
Var : N1(0),dayPl(0),당일수익(400),당일손실(100),Xcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
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);
}
T = 1;
}
if (sdate != sdate[1] and stime >= midtime) or
(sdate == sdate[1] and stime >= midtime and stime[1] < midtime) Then
{
Tcond = False;
T = 2;
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
T = 0;
}
if Tcond == true Then
{
if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 8 Then
ExitShort();
}
if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then
{
Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 8 Then
ExitLong();
if T == 1 Then
{
SetStopProfittarget(PriceScale*익절틱수2,PointStop);
SetStopLoss(PriceScale*손절틱수2,PointStop);
}
Else
{
SetStopProfittarget(PriceScale*익절틱수1,PointStop);
SetStopLoss(PriceScale*손절틱수1,PointStop);
}
2
수식안에서는 실제 주문가격을 지정할 수 없습니다.
차트에서 신호가 발생하면
설정창에서 지정한 매매가격으로 주문이 집행되는데
올리신 내용으로 주문할 방법이 없습니다.
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> input : StartTime(140000),EndTime(50000);
input : 익절틱수(0),손절틱수(40);
var : Tcond(False),entry(0);
Variables: Mom(0);
Var : N1(0),dayPl(0),당일수익(400),당일손실(100),Xcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
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 (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if Tcond == true Then
{
if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 8 Then
ExitShort();
}
if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then
{
Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 8 Then
ExitLong();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
1.
위 수식어에서 14~ 21시까지만
익절 80틱 손절 80틱을 설정하고
나머지 시간은 이전과 동일하게 수식을
변겅 하고자 합니다.
2.
위 수식어에 진입신호시
매수는 현재가에서 -100틱에 주문하고
매도는 현재가에서 +100틱에 주문하는
변경된 수식어를 부탁 드립니다.