답변완료
수식 수정부탁드립니다.
안녕하십니까
아래 수식중 일부를 수정하고 싶어 부탁드립니다.
input : 금액(10000000),ntime(100000);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
input : P1(5),P2(20),P3(60),P(20),진입횟수(3),BBP(20),dv(2);
input : 진입시작1(91500),진입종료1(110000);
input : 진입시작2(130000),진입종료2(153000);
var : mav1(0),mav2(0),mav3(0),entry(0),volma(0),Tcond(False),BBup(0);
if Bdate != Bdate[1] Then
{
entry = 0;
Condition1 = False;
}
if TotalTrades > TotalTrades[1] Then
Condition1 = False;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
mav1 = ma(C,P1);
mav2 = ma(C,P2);
mav3 = ma(C,P3);
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 Then
{
if Tcond == true and
entry < 진입횟수 and #당일진입은 3회까지
C > DayOpen and #일봉양봉
mav2 > mav2[1] and
(TotalTrades == 0 or (TotalTrades > 0 and CountIf(mav2<mav2[1],BarsSinceExit(1)) >= 1)) and
V >= volma[1]*2.0 Then #20거래량 평균 2배이상 거래량 발생
{
Condition1 = true;
TL_New(sDate,sTime,0,sDate,sTime,9999999);
}
if Condition1 == true and CrossDown(C,mav2) and mav1 > mav2 and mav2 > mav3 and mav2 > mav2[1] Then
Buy("b");
}
if MarketPosition == 1 Then
#if CrossDown(C,BBup) Then #볼밴상단 하향돌파
#ExitLong("bx2");
ExitLong("bx",AtLimit,상한가);
SetStopProfittarget(1.7,PercentStop);
SetStopLoss(1.3,PercentStop);
SetStopEndofday(151500);
------------------------------------------------------------
ㅇ 현재 조건
1. 일봉양봉
2. 20거래량 평균 2배이상 거래량 발생
위 조건 만족후
3. 현재가격이 20일선 하향 돌파
4. 5,20,60일선이 정배열
5. 20일선 상승
ㅇ 수정 요청 사항
3. 현재가격이 20일선 하향 돌파 -> 이부분을
5거래량 이동평균이 20, 60일 거래량 이동평균을 차례로 하향돌파
위 3번 조건을 수정 부탁드립니다
감사합니다.
2022-05-06
1023
글번호 158629
시스템