답변완료
문의 드립니다.
안녕하세요.
분할매도수식 관련 문의드립니다.
큰 도움에 항상 감사드립니다.
-----------------------------------------------------------------------------
일봉 2분할 매수 시스템(1,2차 매수일은 다름)인데, 매도 조건은 다음과 같습니다.
조건1) 2차까지 매수 후 가격이 (1차매수가+2차매수가)/2 대비 15%이상 올라간 날
-평균가대비 15%, 20%, 25%에서 3분할 매도(장중매도) 후 남은 물량이 있는 경우 종가 매도.
-->다음과 같은 수식을 짜봤는데, 당일 3분할 매도는 가능한데 종가에서 매도가 안되고 익일 이후 조건이 만족되는 날 나머지 물량이 매도가 됩니다.
if marketposition == 1 and maxentries == 2 then
{
exitlong("bx15",atlimit, max(entryprice, latestentryprice)*1.15,"",floor(maxcontracts/4),1);
exitlong("bx20",atlimit, max(entryprice, latestentryprice)*1.20,"",floor(maxcontracts/4),1);
exitlong("bx25",atlimit, max(entryprice, latestentryprice)*1.25,"",floor(maxcontracts/4),1);
if H>=max(entryprice, latestentryprice)*1.15 and currentcontracts<maxcontracts then
{
exitlong("당일청산");
}
}
조건2) 단, 조건1 만족 당일에 평균가[(1차매수가+2차매수가)/2] 대비 15% 상승한 시점의 금액이 5일선 이격 10% 이내인 경우에는 당일에 매도하지 않고, 추후 5일선 이탈시점에서 매도(종가가 아닌 5일선 이탈 시점에서 장중 매도, 조건1 만족일 당일에 5일선 이탈하면 당일 종가 매도)
-> 이 부분은 수식 구성이 잘 안돼서 문의드립니다.
2022-12-02
1055
글번호 164300
시스템
답변완료
문의 드립니다
1.
input : starttime(120000),endtime(60000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
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;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
input : 익절틱수(0),손절틱수(30);
if NextBarOpen != C Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx1",AtMarket);
if NextBarOpen != C Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx1",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx2",AtMarket);
if NextBarOpen == C Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx2",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
-------------------------
2.
var1 = c-o;
Var2 = AccumN(var1,5);
input : starttime(120000),endtime(60000),n(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
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
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if Var2 > 0 Then
Buy();
if var2 < 0 Then
Sell();
위 2가지 수식어를 240분봉 매매 자료로 사용하고 있습니다.
진입후 160틱 익절이나 240분봉의 완성시 청산되는 수식어를 추가할 수 없는지요 ?
강제청산 설정에서 최대 수익대비 하락설정을 하게 되면 익절의 폭이 적게 나와서
질문 드려봅니다.
2022-12-01
1314
글번호 164297
시스템
답변완료
청산조건
강제 청산시
최소수익이 200Pt 이상이고
최대수익 대비 100Pt 이상 하락시 청산 되도록 하되,
청산 후에는 그와 다른 포지션 조건이 만족 할때까지
청산 된 포지션과 같은 동일포지션에 재진입 하지 아니 하도록
아래 수식을 변경하여 주시면 감사 하겠습니다.
input : L1(10),L2(20),L3(60),L4(120);
var1 = ma(c,L1);
var2 = ma(c,L2);
Var3 = ma(c,L3);
Var4 = ma(c,L4);
Condition1 = MarketPosition == 0 and MarketPosition(1) == 1;
Condition2 = MarketPosition == 0 and MarketPosition(1) == -1;
If var1 > Var2 and Var3 > Var4 Then
{
if Condition1 == False Then
Buy();
}
If Var1 < Var2 and Var3 < Var4 Then
{
if Condition2 == False Then
Sell();
}
if MarketPosition == 1 Then
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.5);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+(EntryPrice-lowest(L,BarsSinceEntry))*0.5);
2022-12-01
942
글번호 164295
시스템