답변완료
문의
추가내용
b1 진입이 stoploss로 청산된 경우 b2가 진입한다
input : perk2(1.2),skew2(0.3),pcr2(107.5),weight2(17);
if Tcond[1] == true and CrossDown(k,hh*(1-perk2/100)) and q > skew2 and z < pcr2 and t > weight2 Then
Buy("b2");
위 내용을 아래 수식에 추가하여 주십시요.
************************************************************************
input : StartTime(090000),EndTime(123000);
input : perk1(1.2),skew1(0.3),pcr1(107.5),weight1(17);
input : ls(0.26),tr(1.20),mi(2.00),bg(120);
var : Tcond(false,Data1);
var : sum1(0,Data1),sum2(0,Data1),sum3(0,Data1);
var : a(0,Data1),b(0,Data1),k(0,Data1),j(0,Data1),q(0,Data1),t(0,Data1),x(0,Data1),y(0,Data1),z(0,Data1),hh(0,Data1),ll(0,Data1);
var : a1(0,Data1),a2(0,Data1),a3(0,Data1),a4(0,Data1),a5(0,Data1),a6(0,Data1),a7(0,Data1);
sum1 = data2(c) + data3(c);
sum2 = data4(c) + data5(c);
sum3 = data6(c) + data7(c);
k = data3(c) + data5(c) + data7(c);
j = (data2(c) + data3(c) + data4(c) + data5(c)+ data6(c) + data7(c))*1000;
if Data1(Bdate != bdate[1]) Then
{
hh = k;
ll = k;
}
Else
{
if k > hh Then
hh = k;
if k < ll Then
ll = k;
}
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;
a=sum1-sum3;
b=sum1-sum2;
q=a-b;
a1 = 0;
a2 = 0;
a3 = 0;
a4 = 0;
a5 = 0;
a6 = 0;
a7 = 0;
}
if Tcond == true Then
{
a1 = a1 + Data1(OI);
a2 = a2 + Data2(OI);
a3 = a3 + Data3(OI);
a4 = a4 + Data4(OI);
a5 = a5 + Data5(OI);
a6 = a6 + Data6(OI);
a7 = a7 + Data7(OI);
t = a1/j;
x = a3+a5+a7;
y = a2+a4+a6;
z = x/y*100;
if Data1(sdate) == Data1(sDate) and
Data1(sdate) == Data2(sDate) and
Data1(sdate) == Data3(sDate) and
Data1(sdate) == Data4(sDate) and
Data1(sdate) == Data5(sDate) and
Data1(sdate) == Data6(sDate) and
Data1(sdate) == Data7(sDate) Then
{
t = a1/j;
x = a3+a5+a7;
y = a2+a4+a6;
}
Else
{
t = 0;
x = 0;
y = 0;
z = 0;
}
if Tcond[1] == true and CrossDown(k,hh*(1-perk1/100)) and q > skew1 and z < pcr1 and t > weight1 Then
Buy("b1");
}
SetStopLoss(ls,PercentStop);
SetStopTrailing(tr,0,PercentStop,1);
SetStopInactivity(mi,bg,PercentStop);
2022-02-09
1254
글번호 156158
시스템
답변완료
수식 수정부탁드립니다.
안녕하십니까
수식 수정 부탁드립니다. 아래는 작성하여 주신 수식 입니다.
input : 금액(10000000),ntime(100000);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
input : P(20),진입횟수(3),BBP(20),dv(2);
input : 진입시작1(91500),진입종료1(110000);
input : 진입시작2(130000),진입종료2(153000);
var : mav(0),entry(0),volma(0),Tcond(False),BBup(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;
mav = ma(C,P);
volma = ma(V,P);
BBup = BollBandUp(BBP,dv);
Tcond = (sTime >= 진입시작1 and sTime < 진입종료1) or (sTime >= 진입시작2 and sTime < 진입종료2); #오전 09:30~11:00, 오후 1:00~15:30분 사이만 매수
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else if date >= 20050328 and date < 20150615 Then
UpLimit = (BP[0] * 1.15);
Else
UpLimit = (BP[0] * 1.30);
if CodeCategory() == 2 then
{
if date >= 20030721 then
{
up1 = int(UpLimit/100+0.00001)*100;
up2 = int(UpLimit/100+0.00001)*100;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
else
{
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/10+0.00001)*10;
up7 = int(UpLimit/1+0.00001)*1;
}
}
Else
{
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
if CodeCategory() == 1 || CodeCategory() == 2 then
{
if sdate < 20101004 Then
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up6);
}
Else
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up7);
}
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
if MarketPosition == 0 and
Tcond == true and
entry < 진입횟수 and #당일진입은 3회까지
C > DayOpen and #일봉양봉
(mav > mav[1] and
(TotalTrades == 0 or (TotalTrades > 0 and CountIf(mav<mav[1],BarsSinceExit(1)) >= 1))) and
V >= volma[1]*1.50 Then #20거래량 평균 50%이상 거래량 발생
Buy("b");
if MarketPosition == 1 Then
#if CrossDown(C,BBup) Then #볼밴상단 하향돌파
#ExitLong("bx2");
ExitLong("bx",AtLimit,상한가);
SetStopLoss(3,PercentStop);
SetStopEndofday(151500);
현재 매수 조건은
1. 일봉양봉 2. 20일 이평상승 3. 거래량 20거래량 평균 50% 이상 발생 시 매수
입니다.
수정 부탁 드릴 조건은 위 1~3번 조건이 발생 한 후 종가가 20일 이평을 하향 하였을때 매수로 변경 부탁드립니다,(3분 5분봉에 적용할예정입니다.)
첨부 이미지 보시면 현재는 1번에서 주문이 나가는데 2번에서 주문이 나갈수 있게 변경하고 싶습니다.
항상 건강하십시오. 감사합니다.
2022-02-09
1117
글번호 156150
시스템