커뮤니티
자꾸 에러가 뜹니다
2016-08-19 04:53:23
132
글번호 101156
10분봉을 이용한 채널 밴드를 만들어서 상단동파시 매수 하단 돌파시 매도전략을 하려 합니다
당일 청산이고 가격만을 이용한 매매식이고 지표식과 시스템식의 조합입니다
자꾸 에러가 뜨네요!
수식 채크좀 부탁드립니다!!
감사합니다.
<지표식>
Inputs: length(5);
Variables: upband(0), downband(0), i(0)
arrays: dayh[30](0), dayl[30](0);
for i = 1 to length
{
dayh[i] = dayhigh(i);
dayl[i] = daylow(i);
upband = highest(dayh[i], lenght);
downband = lowest (dayl[i], lenght);
}
Plot1(upband, "상단밴드");
Plot2(downband, "하단밴드");
<시스템식>
Inputs : length(2), loss(2), atrperiod(8), atrs1(4);
Variables : upbavd(0), downband(0), avgband(0), i(0);
arrays ; dayh[30](0), dayl[30](0);
for i = 1 to length
{
dayh[i] = DayHigh(i);
dayh[i] = DayLow(i);
upband = Highest(dayh[i], length);
downband = lowest(dayh[i], length);
}
if crossup(c,upband) Then
{
bay("매수");
}
if MarketPosition == 1 Then
{
ExitLong("매수청산", atstop,Highest(h,BarsSinceEntry)-atr(atrperiod)*atrs1);
}
CrossDown(c,downband) Then
{
sell("매도");
}
if MarketPosition == -1 Then
{
ExitShort("매도청산", AtStop, lowest(l,BarsSinceEntry)*atr(atrperiod)*atrs1);
}
SetStopLoss(loss,PercentStop);
SetStopEndofday(155000);
- 1. KakaoTalk_20160819_045352117.jpg (0.07 MB)
답변 1
예스스탁 예스스탁 답변
2016-08-19 10:30:02
안녕하세요
예스스탁입니다.
문법오류 수정해서 올려드립니다
1.
Inputs: length(5);
Variables: upband(0), downband(0), i(0);
arrays: dayh[30](0), dayl[30](0);
for i = 1 to length
{
dayh[i] = dayhigh(i);
dayl[i] = daylow(i);
upband = highest(dayh[i], length);
downband = lowest (dayl[i], length);
}
Plot1(upband, "상단밴드");
Plot2(downband, "하단밴드");
2
Inputs : length(2), loss(2), atrperiod(8), atrs1(4);
Variables : upband(0), downband(0), avgband(0), i(0);
arrays : dayh[30](0), dayl[30](0);
for i = 1 to length
{
dayh[i] = DayHigh(i);
dayh[i] = DayLow(i);
upband = Highest(dayh[i], length);
downband = lowest(dayh[i], length);
}
if crossup(c,upband) Then
{
buy("매수");
}
if MarketPosition == 1 Then
{
ExitLong("매수청산", atstop,Highest(h,BarsSinceEntry)-atr(atrperiod)*atrs1);
}
if CrossDown(c,downband) Then
{
sell("매도");
}
if MarketPosition == -1 Then
{
ExitShort("매도청산", AtStop, lowest(l,BarsSinceEntry)*atr(atrperiod)*atrs1);
}
SetStopLoss(loss,PercentStop);
SetStopEndofday(155000);
즐거운 하루되세요
> qha71 님이 쓴 글입니다.
> 제목 : 자꾸 에러가 뜹니다
> 10분봉을 이용한 채널 밴드를 만들어서 상단동파시 매수 하단 돌파시 매도전략을 하려 합니다
당일 청산이고 가격만을 이용한 매매식이고 지표식과 시스템식의 조합입니다
자꾸 에러가 뜨네요!
수식 채크좀 부탁드립니다!!
감사합니다.
<지표식>
Inputs: length(5);
Variables: upband(0), downband(0), i(0)
arrays: dayh[30](0), dayl[30](0);
for i = 1 to length
{
dayh[i] = dayhigh(i);
dayl[i] = daylow(i);
upband = highest(dayh[i], lenght);
downband = lowest (dayl[i], lenght);
}
Plot1(upband, "상단밴드");
Plot2(downband, "하단밴드");
<시스템식>
Inputs : length(2), loss(2), atrperiod(8), atrs1(4);
Variables : upbavd(0), downband(0), avgband(0), i(0);
arrays ; dayh[30](0), dayl[30](0);
for i = 1 to length
{
dayh[i] = DayHigh(i);
dayh[i] = DayLow(i);
upband = Highest(dayh[i], length);
downband = lowest(dayh[i], length);
}
if crossup(c,upband) Then
{
bay("매수");
}
if MarketPosition == 1 Then
{
ExitLong("매수청산", atstop,Highest(h,BarsSinceEntry)-atr(atrperiod)*atrs1);
}
CrossDown(c,downband) Then
{
sell("매도");
}
if MarketPosition == -1 Then
{
ExitShort("매도청산", AtStop, lowest(l,BarsSinceEntry)*atr(atrperiod)*atrs1);
}
SetStopLoss(loss,PercentStop);
SetStopEndofday(155000);
다음글