커뮤니티
data2와 data3의 시작 기준
2018-07-30 13:33:39
150
글번호 120988
늘 감사합니다.
해외선물 기준입니다.
1. 09시30분을 시작 기준으로 설정,
예를들면 9시30분에 data2와 data3이 각각 0틱에서 시작을 의미함.
data2 의 시가기준(9시 30분을 의미힘) 현재가 틱수 +
data3 의 시가기준(9시 30분을 의미힘) 현재가 틱수
+50틱일때 매도, -50틱일때 매수
익절 25틱, 손절15틱. 16시30분 강제청산.
진입회수 2회, 첫 진입후 30분간 진입 금지
2. 같은 조건에서
17시 30분이후
+100틱일때 매도, -100틱일때 매수
익절 35틱, 손절20틱. 익일02시30분 강제청산.
진입회수 2회, 첫 진입후 30분간 진입 금지
감사합니다.
답변 2
예스스탁 예스스탁 답변
2018-07-31 15:27:45
안녕하세요
예스스탁입니다.
조건들 외부변수처리해 드립니다.
시간등 변경해 적용하시면 됩니다.
input : starttime(93000),endtime(163000),A1(50),Profit(25),loss(15),진입횟수(2),진입금지(30);
var : O2(0,data1),O3(0,data1),Tcond(false,data1),T1(0,data1),entry(0,data1);
var : s1(0,data1),d1(0,data1),TM(0,data1);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
O2 = data2(O);
O3 = data2(O);
T1 = TotalTrades;
}
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 MarketPosition == 0 Then
entry = TotalTrades-t1;
Else
entry = TotalTrades-t1+1;
if Tcond == true and entry < 진입횟수 then
{
if (entry == 0 or
(entry > 0 and MarketPosition != 0 and TM >= TM[BarsSinceEntry]+진입금지) or
(entry > 0 and MarketPosition == 0 and TM >= TM[BarsSinceExit(1)]+진입금지)) then
{
if data2(crossup(c,O2+PriceScale*A1)) Then
sell("s2");
if data2(crossup(c,O2-PriceScale*A1)) Then
Buy("b2");
if data3(crossup(c,O3+PriceScale*A1)) Then
sell("s3");
if data3(crossup(c,O3-PriceScale*A1)) Then
Buy("b3");
}
}
SetStopProfittarget(PriceScale*Profit,PointStop);
SetStoploss(PriceScale*loss,PointStop);
즐거운 하루되세요
> 상암동 님이 쓴 글입니다.
> 제목 : data2와 data3의 시작 기준
> 늘 감사합니다.
해외선물 기준입니다.
1. 09시30분을 시작 기준으로 설정,
예를들면 9시30분에 data2와 data3이 각각 0틱에서 시작을 의미함.
data2 의 시가기준(9시 30분을 의미힘) 현재가 틱수 +
data3 의 시가기준(9시 30분을 의미힘) 현재가 틱수
+50틱일때 매도, -50틱일때 매수
익절 25틱, 손절15틱. 16시30분 강제청산.
진입회수 2회, 첫 진입후 30분간 진입 금지
2. 같은 조건에서
17시 30분이후
+100틱일때 매도, -100틱일때 매수
익절 35틱, 손절20틱. 익일02시30분 강제청산.
진입회수 2회, 첫 진입후 30분간 진입 금지
감사합니다.
예스스탁 예스스탁 답변
2018-08-01 09:08:31
안녕하세요
예스스탁입니다.
input : starttime1(93000),endtime1(163000),starttime2(173000),endtime2(023000),진입횟수(2),진입금지(30);
input : A1(50),Profit1(25),loss1(15);
input : A2(100),Profit2(35),loss2(20);
var : O2(0,data1),O3(0,data1),T(0,data1),T1(0,data1),entry(0,data1);
var : s1(0,data1),d1(0,data1),TM(0,data1),diff2(0,data2),diff3(0,data3),sum(0,data3);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
}
if data3((sdate != sdate[1] and stime >= endtime1) or
(sdate == sdate[1] and stime >= endtime1 and stime[1] < endtime1)) then
{
T = 0;
if MarketPosition == 1 Then
ExitLong("bx1");
if MarketPosition == -1 Then
ExitShort("sx1");
}
if data3((sdate != sdate[1] and stime >= endtime2) or
(sdate == sdate[1] and stime >= endtime2 and stime[1] < endtime2)) then
{
T = 0;
if MarketPosition == 1 Then
ExitLong("bx2");
if MarketPosition == -1 Then
ExitShort("sx2");
}
if data3((sdate != sdate[1] and stime >= starttime1) or
(sdate == sdate[1] and stime >= starttime1 and stime[1] < starttime1)) then
{
T = 1;
O2 = data2(O);
O3 = data2(O);
T1 = TotalTrades;
}
if data3((sdate != sdate[1] and stime >= starttime2) or
(sdate == sdate[1] and stime >= starttime2 and stime[1] < starttime2)) then
{
T = 2;
O2 = data2(O);
O3 = data2(O);
T1 = TotalTrades;
}
if MarketPosition == 0 Then
entry = TotalTrades-t1;
Else
entry = TotalTrades-t1+1;
diff2 = data2((C-O2)/PriceScale);
diff3 = data3((C-O2)/PriceScale);
sum = diff2+diff3;
if T == 1 and entry < 진입횟수 then
{
if (entry == 0 or
(entry > 0 and MarketPosition != 0 and TM >= TM[BarsSinceEntry]+진입금지) or
(entry > 0 and MarketPosition == 0 and TM >= TM[BarsSinceExit(1)]+진입금지)) then
{
if data2(crossup(sum,A1)) Then
sell("s1");
if data2(CrossDown(sum,-A1)) Then
Buy("b1");
}
}
if T == 2 and entry < 진입횟수 then
{
if (entry == 0 or
(entry > 0 and MarketPosition != 0 and TM >= TM[BarsSinceEntry]+진입금지) or
(entry > 0 and MarketPosition == 0 and TM >= TM[BarsSinceExit(1)]+진입금지)) then
{
if data2(crossup(sum,A2)) Then
sell("s2");
if data2(CrossDown(sum,-A2)) Then
Buy("b2");
}
}
if MarketPosition == 1 Then
{
if IsEntryName("b1") == true then
{
ExitLong("bp1",Atlimit,EntryPrice+PriceScale*Profit1);
ExitLong("bl1",AtStop,EntryPrice-PriceScale*loss1);
}
if IsEntryName("b2") == true then
{
ExitLong("bp2",Atlimit,EntryPrice+PriceScale*Profit2);
ExitLong("bl2",AtStop,EntryPrice-PriceScale*loss2);
}
}
if MarketPosition == -1 Then
{
if IsEntryName("s1") == true then
{
ExitShort("sp1",Atlimit,EntryPrice-PriceScale*Profit1);
ExitShort("sl1",AtStop,EntryPrice+PriceScale*loss1);
}
if IsEntryName("s2") == true then
{
ExitShort("sp2",Atlimit,EntryPrice-PriceScale*Profit2);
ExitShort("sl2",AtStop,EntryPrice+PriceScale*loss2);
}
}
즐거운 하루되세요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : data2와 data3의 시작 기준
> 안녕하세요
예스스탁입니다.
조건들 외부변수처리해 드립니다.
시간등 변경해 적용하시면 됩니다.
input : starttime(93000),endtime(163000),A1(50),Profit(25),loss(15),진입횟수(2),진입금지(30);
var : O2(0,data1),O3(0,data1),Tcond(false,data1),T1(0,data1),entry(0,data1);
var : s1(0,data1),d1(0,data1),TM(0,data1);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
O2 = data2(O);
O3 = data2(O);
T1 = TotalTrades;
}
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 MarketPosition == 0 Then
entry = TotalTrades-t1;
Else
entry = TotalTrades-t1+1;
if Tcond == true and entry < 진입횟수 then
{
if (entry == 0 or
(entry > 0 and MarketPosition != 0 and TM >= TM[BarsSinceEntry]+진입금지) or
(entry > 0 and MarketPosition == 0 and TM >= TM[BarsSinceExit(1)]+진입금지)) then
{
if data2(crossup(c,O2+PriceScale*A1)) Then
sell("s2");
if data2(crossup(c,O2-PriceScale*A1)) Then
Buy("b2");
if data3(crossup(c,O3+PriceScale*A1)) Then
sell("s3");
if data3(crossup(c,O3-PriceScale*A1)) Then
Buy("b3");
}
}
SetStopProfittarget(PriceScale*Profit,PointStop);
SetStoploss(PriceScale*loss,PointStop);
즐거운 하루되세요
> 상암동 님이 쓴 글입니다.
> 제목 : data2와 data3의 시작 기준
> 늘 감사합니다.
해외선물 기준입니다.
1. 09시30분을 시작 기준으로 설정,
예를들면 9시30분에 data2와 data3이 각각 0틱에서 시작을 의미함.
data2 의 시가기준(9시 30분을 의미힘) 현재가 틱수 +
data3 의 시가기준(9시 30분을 의미힘) 현재가 틱수
+50틱일때 매도, -50틱일때 매수
익절 25틱, 손절15틱. 16시30분 강제청산.
진입회수 2회, 첫 진입후 30분간 진입 금지
2. 같은 조건에서
17시 30분이후
+100틱일때 매도, -100틱일때 매수
익절 35틱, 손절20틱. 익일02시30분 강제청산.
진입회수 2회, 첫 진입후 30분간 진입 금지
감사합니다.
다음글
이전글