커뮤니티
수정부탁합니다
2013-09-25 02:42:14
100
글번호 67785
항상 좋은 답변 감사합니다
수정 부탁합니다
매수방법만 바꾸려고하는데요
거래량은 자동으로 10일씩 계산 되는걸로 만들어주세요
10일치 거래량 평균 보다 거래량이 적은 양봉2개가 연속으로 나올경우 매수하는 식으로 바꾸어주세요
input : 금액(200000);
var : Vol(0),BuyP(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then
Vol = int(int(금액/C)/10)*10;
Else
Vol = int(금액/C);
if CodeCategoryEx == 31 or CodeCategoryEx == 32 Then
Vol = int((금액)/(C*BigPointValue));
var1 = ma(C,1);
var2 = ma(c,5);
if MarketPosition == 0 and crossup(var1,var2) Then{
buy("매수",AtMarket,def,Vol);
BuyP = NextBarOpen;
}
if MarketPosition == 1 and
crossup(var1,var2) and
C <= BuyP*0.95 Then{
buy("추가매수",AtMarket,def,vol);
BuyP = NextBarOpen;
}
if MarketPosition == 1 Then
exitlong("매도",atlimit,avgEntryPrice*1.05);
답변 1
예스스탁 예스스탁 답변
2013-09-25 16:30:35
안녕하세요
예스스탁입니다.
input : 금액(200000),N(10);
var : Vol(0),BuyP(0),cnt(0),sum(0),Vma(0);
#10일 평균거래량
sum = 0;
for cnt = 0 to N-1{
sum = sum + DayVolume(cnt);
}
Vma = sum/N;
if CodeCategoryEx == 11 and BasePrice < 50000 Then
Vol = int(int(금액/C)/10)*10;
Else
Vol = int(금액/C);
if CodeCategoryEx == 31 or CodeCategoryEx == 32 Then
Vol = int((금액)/(C*BigPointValue));
var1 = ma(C,1);
var2 = ma(c,5);
if MarketPosition == 0 and crossup(var1,var2) and
countif(C>O and V < Vma,2) == 2 Then{
buy("매수",AtMarket,def,Vol);
BuyP = NextBarOpen;
}
if MarketPosition == 1 and
crossup(var1,var2) and
C <= BuyP*0.95 and
countif(C>O and V < Vma,2) == 2 Then{
buy("추가매수",AtMarket,def,vol);
BuyP = NextBarOpen;
}
if MarketPosition == 1 Then
exitlong("매도",atlimit,avgEntryPrice*1.05);
즐거운 하루되세요
> HI_jh***** 님이 쓴 글입니다.
> 제목 : 수정부탁합니다
> 항상 좋은 답변 감사합니다
수정 부탁합니다
매수방법만 바꾸려고하는데요
거래량은 자동으로 10일씩 계산 되는걸로 만들어주세요
10일치 거래량 평균 보다 거래량이 적은 양봉2개가 연속으로 나올경우 매수하는 식으로 바꾸어주세요
input : 금액(200000);
var : Vol(0),BuyP(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then
Vol = int(int(금액/C)/10)*10;
Else
Vol = int(금액/C);
if CodeCategoryEx == 31 or CodeCategoryEx == 32 Then
Vol = int((금액)/(C*BigPointValue));
var1 = ma(C,1);
var2 = ma(c,5);
if MarketPosition == 0 and crossup(var1,var2) Then{
buy("매수",AtMarket,def,Vol);
BuyP = NextBarOpen;
}
if MarketPosition == 1 and
crossup(var1,var2) and
C <= BuyP*0.95 Then{
buy("추가매수",AtMarket,def,vol);
BuyP = NextBarOpen;
}
if MarketPosition == 1 Then
exitlong("매도",atlimit,avgEntryPrice*1.05);
다음글