커뮤니티
진입시간 제한
2018-03-08 10:30:52
214
글번호 117219
input조절에 일정시간 이후 진입을 제한하는 수식을 추가바랍니다.
고맙습니다.
****************
input : s1(20),s2(20),X1(20),X2(20),진입시간(090000);
var : T1(0),entry(0),LL(0),EH(0);
if Bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C >= daylow+PriceScale*s1 and C[1] < daylow+PriceScale*s1 Then
sell("s1");
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
EH = H;
if H > EH Then
EH = H;
if entry == 1 and C <= EH-PriceScale*X1 Then
ExitShort("sx1");
}
if TotalTrades > TotalTrades[1] Then
LL = L;
if L < LL Then
LL = L;
if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*s2 and C[1] < LL+PriceScale*s2 Then
sell("s2");
if MarketPosition== 1 and entry == 2 Then
exitlong("sx2",AtStop,EntryPrice-PriceScale*X2);
답변 1
예스스탁 예스스탁 답변
2018-03-09 09:58:48
안녕하세요
예스스탁입니다.
input : s1(20),s2(20),X1(20),X2(20),진입시간(090000),종료시간(130000);
var : T1(0),entry(0),LL(0),EH(0),Tcond(false);
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
{
Tcond = true;
T1 = TotalTrades;
}
if (sdate != sdate[1] and stime >= 종료시간) or
(sdate == sdate[1] and stime >= 종료시간 and stime[1] < 종료시간) Then
Tcond = false;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 and Tcond == true and C >= daylow+PriceScale*s1 and C[1] < daylow+PriceScale*s1 Then
sell("s1");
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
EH = H;
if H > EH Then
EH = H;
if entry == 1 and C <= EH-PriceScale*X1 Then
ExitShort("sx1");
}
if TotalTrades > TotalTrades[1] Then
LL = L;
if L < LL Then
LL = L;
if MarketPosition == 0 and entry == 1 and Tcond == true and C >= LL+PriceScale*s2 and C[1] < LL+PriceScale*s2 Then
sell("s2");
if MarketPosition== 1 and entry == 2 Then
exitlong("sx2",AtStop,EntryPrice-PriceScale*X2);
즐거운 하루되세요
> 좌오비우오비 님이 쓴 글입니다.
> 제목 : 진입시간 제한
> input조절에 일정시간 이후 진입을 제한하는 수식을 추가바랍니다.
고맙습니다.
****************
input : s1(20),s2(20),X1(20),X2(20),진입시간(090000);
var : T1(0),entry(0),LL(0),EH(0);
if Bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C >= daylow+PriceScale*s1 and C[1] < daylow+PriceScale*s1 Then
sell("s1");
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
EH = H;
if H > EH Then
EH = H;
if entry == 1 and C <= EH-PriceScale*X1 Then
ExitShort("sx1");
}
if TotalTrades > TotalTrades[1] Then
LL = L;
if L < LL Then
LL = L;
if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*s2 and C[1] < LL+PriceScale*s2 Then
sell("s2");
if MarketPosition== 1 and entry == 2 Then
exitlong("sx2",AtStop,EntryPrice-PriceScale*X2);