커뮤니티
문의
장 중 움직임을 반영하여 거래횟수를 조정하는 수식을 요청드립니다.
아래 수식은 거래횟수 총3회 누적패수2회인 수식입니다.
선물 지수 500 돌파 후 하방 거래는 자제하기 위해 거래횟수를 적게 잡아 운용하였습니다.
선물 지수 600 돌파 후 금일 하방쪽으로 20포인트를 넘는 움직임이 비로소 생겼습니다.
그렇다고 거래횟수를 고정하여 늘리고 싶진 않습니다.
장 중에 bigdown 발생할 때만 거래횟수가 조정되는 수식을 요청드립니다.
금일 아래 수식은 3회 거래 후 거래가 정지되었습니다.
요청드린 내용이 반영된다면 아래처럼 5회까지 운영하고 싶습니다.
변경 전
input : 진입시간(084700),진입제한시간(125000);
input : 거래횟수(3),누적패수(2);
변경 후
input : 진입시간(084700),진입제한시간(125000),조정진입제한시간(144500);
input : 거래횟수(3),누적패수(2),bigdown(15.00),조정거래횟수(5);
항상 고맙습니다.
*******************************************************************************************************************************************
input : 진입시간(084700),진입제한시간(125000);
input : 거래횟수(3),누적패수(2);
input : b1(54),진입눌림1(6),진입돌파1(4);
input : b2(142),진입눌림2(6),진입돌파2(4);
input : als(42),atr1(0),atr2(112);
input : bls(70),btr1(0),btr2(132);
var : T1(0),entry(0),HH(0),LL(0),EH(0),EL(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0);
var : Tcond(false);
Var : loss(0);
if bdate != bdate[1] Then
loss = 0;
if TotalTrades > TotalTrades[1] and PositionProfit(1) < 0 Then
loss = loss+1;
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then{
T1 = TotalTrades;
E1 = 0;
HH = H;
}
if stime >= 진입시간 then{
if H > HH Then
HH = H;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 Then{
if E1 == 0 and C <= HH-PriceScale*B1 Then{
E1 = 1;
L1 = L;
i1 = index;
V1 = HH; //시작점 종가
}
if E1 == 1 and index > i1 then{
if L < L1 Then
L1 = L;
#고가가 시작봉종가보다 작을 때만 눌림체크
if H <= V1 and H >= L1+PriceScale*진입눌림1 Then{
E1 = 2;
i1 = index;
S1 = L1;
}
}
//시작점 종가보다 높은 가격이 발생하면 초기화
if E1 >= 1 and H > V1 Then{
E1 = 0;
HH = H;
}
if loss < 누적패수 and E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파1 and Tcond == true Then{
sell("s1");
}
}
if TotalTrades > TotalTrades[1] Then{
E1 = 0;
HH = H;
}
if H > HH Then
HH = H;
if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{
if E1 == 0 and C <= HH-PriceScale*B2 Then{
E1 = 1;
L1 = L;
i1 = index;
}
if E1 == 1 and index > i1 then{
if L < L1 Then
L1 = L;
if H >= L1+PriceScale*진입눌림2 Then{
E1 = 2;
i1 = index;
S1 = L1;
}
}
if loss < 누적패수 and E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파2 and Tcond == true Then{
sell("s2");
E1 = 0;
}
}
}
if MarketPosition== -1 Then
{
if IsEntryName("s1") == true Then
{
SetStopLoss(PriceScale*als,PointStop);
SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1);
}
Else if IsEntryName("s2") == true Then
{
SetStopLoss(PriceScale*bls,PointStop);
SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1);
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
}
}
답변 1
예스스탁 예스스탁 답변
2025-11-05 12:45:38