커뮤니티
일봉에서 월봉
2019-05-21 10:15:16
212
글번호 128833
일봉에서 월봉 5이평선 위에 있을때 매수 매도
Var:monthavg(0);
Monthavg = monthclose(0)+monthclose(1)+monthclose(2)+monthclose(3)+monthclose(3)+monthclose(4);
Monthavg = monthavg/5;
If (ma(c,5) > ma(c,20) and c > monthavg then
Buy("매수");
If c<ma(c,20) then
Sell("매도");
Dayclose 라는 함수는 있는데
Monthclose 라는 함수는 없나요
식좀 바르게 고쳐 주셨으면 합니다
답변 1
예스스탁 예스스탁 답변
2019-05-21 14:49:38
안녕하세요
예스스탁입니다.
주봉이나 월봉은 따로 함수가 없습니다.
별도로 계산식 만들어서 사용하셔야 합니다.
아래와 같이 작성해 사용하시면 됩니다.
input : P(5);
Var : cnt(0),sum(0),monthavg(0);
Array : MC[50](0);
var1 = ma(C,5);
var2 = ma(C,20);
if bdate > bdate[1]+30 Then
{
for cnt = 1 to 49
{
MC[cnt] = MC[cnt-1][1];
}
}
MC[0] = C;
if MC[P] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + MC[cnt];
}
Monthavg = sum/P;
If var1 > var2 and c > monthavg then
Buy("매수");
If c < var2 then
Sell("매도");
}
즐거운 하루되세요
> 수학귀신 님이 쓴 글입니다.
> 제목 : 일봉에서 월봉
> 일봉에서 월봉 5이평선 위에 있을때 매수 매도
Var:monthavg(0);
Monthavg = monthclose(0)+monthclose(1)+monthclose(2)+monthclose(3)+monthclose(3)+monthclose(4);
Monthavg = monthavg/5;
If (ma(c,5) > ma(c,20) and c > monthavg then
Buy("매수");
If c<ma(c,20) then
Sell("매도");
Dayclose 라는 함수는 있는데
Monthclose 라는 함수는 없나요
식좀 바르게 고쳐 주셨으면 합니다