답변완료
문의 드립니다.~~~~
답변주신 내용으로 햬결이 되지 않아
추가 요청을 더해 다시 부탁드립니다~
<진입>
진입은 아래 수식에서 설정된 시간대별로 구분되어
매일 진입이 실행되도록 시간대 설정
(왜그런지 아래식에서는 23시에서 1시까지는 진입이 이루어지지 않습니다.)
<청산>
1, 설정된 각 시간대 내에서는 청산 조건이 충족되면 수식 그대로
청산 및 스위칭 재진입
2, 설정된 각 시간내에서 청산 조건이 충족 되지 않아
포지션을 가지고 각 시간대를 지날때에는
청산 조건이 충족되면 스위칭 재진입 없이
청산만 이루어지도록 부탁드립니다~~~
항상 감사합니다 건강하세요~``
input : 진입틱수(10);
input : 최소손실틱(0),손실감소틱(10);
input : StartTime1(70000),EndTime1(100000);
input : StartTime2(110000),EndTime2(130000);
input : StartTime3(150000),EndTime3(180000);
input : StartTime4(230000),EndTime4(010000);
var : Tcond(false);
var : OO(0),HH(0),LL(0);
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if (DayOfWeek(sDate) != 1 and sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond = true;
OO = O;
HH = H;
LL = L;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if (DayOfWeek(sDate) != 1 and sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond = true;
OO = O;
HH = H;
LL = L;
}
if (sdate != sdate[1] and stime >= EndTime3) or
(sdate == sdate[1] and stime >= EndTime3 and stime[1] < EndTime3) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if (DayOfWeek(sDate) != 1 and sdate != sdate[1] and stime >= StartTime3) or
(sdate == sdate[1] and stime >= StartTime3 and stime[1] < StartTime3) Then
{
Tcond = true;
OO = O;
HH = H;
LL = L;
}
if (sdate != sdate[1] and stime >= EndTime4) or
(sdate == sdate[1] and stime >= EndTime4 and stime[1] < EndTime4) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if Tcond == true Then
{
if MarketPosition == 0 and OO > 0 and LL > OO-PriceScale*진입틱수 Then
Sell("하루시작매도",AtLimit,LL+PriceScale*진입틱수);
if MarketPosition == 0 and OO > 0 and HH < OO+PriceScale*진입틱수 Then
Buy("하루시작메수",AtLimit,HH-PriceScale*진입틱수);
}
if MarketPosition == 1 Then
{
Sell("Bp",AtLimit,EntryPrice+PriceScale*진입틱수);
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소손실틱 Then
Sell("sx",AtLimit,Lowest(L,BarsSinceEntry)+PriceScale*손실감소틱);
}
if MarketPosition == -1 Then
{
Buy("sp",AtLimit,EntryPrice-PriceScale*진입틱수);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소손실틱 Then
Buy("bx",AtLimit,highest(H,BarsSinceEntry)-PriceScale*손실감소틱);
}
2021-11-04
690
글번호 153357
시스템
답변완료
​​​해외선물 타주기 시스템 변환
​​​항상 감사드립니다
​​​​​​​​​​​​아래 조건식을 타주기챠트에 적용할수있도록 변환하여주시기 바랍니다
*****************************************************
input:period90(20),횡보율(0.0006);
var : var301(0),var321(0);
var : t60(0),t70(0);
var301=ema(c,period90);
var321=ema(c,period90+20);
value1 = 0;
value2 = 0;
value3 = 0;
if var301>var301[1]*(1+횡보율/100) then value1 = value1+1;
else if var301<var301[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var321>var321[1]*(1+횡보율/100) then value1 = value1+1;
else if var321<var321[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if Var301>Var321 Then
t60 = 1 ;
else if Var301<Var321 Then
t60 = -1;
if value1 == 2 Then
t70 = 1 ;
else if value2 == 2 Then
t70 = -1;
Else if value3 == 2 Then
t70 = 0;
/****************************************************/
var : entrycnt(0);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then # 현지시간_뉴욕 17:00 장시작 #
Entrycnt = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = Entrycnt+1;
if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)) and #동일방향 재진입금지#
T60==1 then
buy("B1");
if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)) and #동일방향 재진입금지#
T60==-1 Then
sell("S1");
/***********************************************/
if MarketPosition == 1 and T70==-1 Then
exitlong("eB_B");
if MarketPosition == -1 and T70==1 Then
ExitShort("eS_S");
2021-11-03
869
글번호 153351
시스템
답변완료
수식 부탁드립니다
input : StartTime(233000),EndTime(030000);
var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0);
var : Tcond(false);
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;
SetStopEndofday(0);
}
var : entry(0);
if bdate != bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition <= 0 and entry < 1 Then
buy("b",atlimit,dayhigh-PriceScale*20);
if MarketPosition == 1 Then
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*20);
if MarketPosition >= 0 and entry < 1 Then
sell("s",atlimit,daylow+PriceScale*30);
if MarketPosition == -1 Then
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*30);
---------------------------
위 시스템의 매매신호는 당일 고저가대비 매수,매도의 청산 수식 입니다.
수정할것은 당일 고저가대비 매수,매도의 신호에서 청산은 그 진입신호에서
틱폭의 숫자만큼 청산이 되도록 부탁드립니다
늘 감사합니다
2021-11-04
776
글번호 153337
시스템
답변완료
신호표시
항상 도움 주심에 감사드립니다^^
아래 두조건을 모두 만족 할 때에만 신호가 발생되게 부탁드립니다.
그리고 2)번 조건식을 지표식으로 바꿀수 있는지와 지표식으로 바꿀때 기호로 표시되게하고 색상까지 넣을수 있다면 모두 부탁드립니다. 감사합니다^^
1)종가가 5일 20일선을 동시에 돌파시
var1 = ma(c,5);
Var2 = ma(C,20);
Condition1 = C > max(var1,Var2) and min(var1,Var2) > O;
Condition2 = O > max(var1,Var2) and min(var1,Var2) > C;
#b1
if Condition1 == true Then
Buy("★");
#s1
if Condition2 == true Then
Sell(" ★ ");
2)단기 추세선이 선행스팬1을 돌파시
var : 전환선(0),단기추세선(0),선행스팬1(0),선행스팬2(0);
전환선 = (highest(H,1)+lowest(L,1))/2;
단기추세선 = (highest(H,26)+lowest(L,26))/2;
선행스팬1 = (전환선+단기추세선)/2;
선행스팬2 = (highest(H,52)+lowest(L,52))/2;
#b2
if 선행스팬1 > 단기추세선 Then
Buy("▲");
#s2
if 선행스팬1 < 단기추세선 Then
sell("▼");
2021-11-03
899
글번호 153336
시스템