커뮤니티
죄송한데 다시여쭈어볼께요...
2013-03-14 17:43:59
183
글번호 60727
현재 제가 만들어놓은 프로그램에 짜집기를 하려니 잘 안되서..ㅠ
짜집기좀 부탁드릴께요..ㅠ
1.현재 프로그램..
Input : af(0.02), maxAF(0.2) ;
Var : value(0);
value = csar(af,maxAF);
if stime >= 09100 and crossdown(c,var1) Then
sell("s",AtMarket);
# 매수/매도청산
If C > value Then
{
buy();
}
# 매도/매수청산
If C < value Then
{
sell();
}
SetStopLoss(1.0,pointstop);
SetStopEndofday(145500)
2.보내주신 프로그램..
var : cond2(0,data2),cond3(0,data3),cond4(0,data4);
if data2(매수조건) Then
cond2 = 1;
if data2(매도조건) Then
cond2 = -1;
if data3(매수조건) Then
cond3 = 1;
if data3(매도조건) Then
cond3 = -1;
if data4(매수조건) Then
cond4 = 1;
if data5(매도조건) Then
cond4 = -1;
if (cond2+cond3+cond4) == 3 and (cond2[1]+cond3[1]+cond4[1]) != 3 Then
buy();
if (cond2+cond3+cond4) == -3 and (cond2[1]+cond3[1]+cond4[1]) != -3 Then
sell();
이걸 조합하려니 자꾸에러가 떠서요...
부탁드립니다..
그리고 참조챠트를 위식으로해놓고 3개를 뛰우면 되는거죠??
감사합니다..수고하세요..^^
답변 1
예스스탁 예스스탁 답변
2013-03-15 09:08:21
안녕하세요
예스스탁입니다.
참조데이터 3개에서 동시에 만족할 경우이므로
아래와 같이 작성하시면 됩니다.
Input : af(0.02), maxAF(0.2) ;
Var : val1(0,data2),val2(0,data2),val3(0,data2);
val1 = data2(csar(af,maxAF));
val1 = data3(csar(af,maxAF));
val1 = data4(csar(af,maxAF));
if data1(stime >= 09100 and crossdown(c,var1)) and
data1(stime >= 09100 and crossdown(c,var1)) and
data1(stime >= 09100 and crossdown(c,var1))
Then
sell("s",AtMarket);
# 매수/매도청산
If data2(C > val1) and data3(C > val2) and data4(C > val3) Then
{
buy();
}
# 매도/매수청산
If data2(C < val1) and data3(C < val2) and data4(c < val3) Then
{
sell();
}
SetStopLoss(1.0,pointstop);
SetStopEndofday(145500);
즐거운 하루되세요
> 신천지 님이 쓴 글입니다.
> 제목 : 죄송한데 다시여쭈어볼께요...
> 현재 제가 만들어놓은 프로그램에 짜집기를 하려니 잘 안되서..ㅠ
짜집기좀 부탁드릴께요..ㅠ
1.현재 프로그램..
Input : af(0.02), maxAF(0.2) ;
Var : value(0);
value = csar(af,maxAF);
if stime >= 09100 and crossdown(c,var1) Then
sell("s",AtMarket);
# 매수/매도청산
If C > value Then
{
buy();
}
# 매도/매수청산
If C < value Then
{
sell();
}
SetStopLoss(1.0,pointstop);
SetStopEndofday(145500)
2.보내주신 프로그램..
var : cond2(0,data2),cond3(0,data3),cond4(0,data4);
if data2(매수조건) Then
cond2 = 1;
if data2(매도조건) Then
cond2 = -1;
if data3(매수조건) Then
cond3 = 1;
if data3(매도조건) Then
cond3 = -1;
if data4(매수조건) Then
cond4 = 1;
if data5(매도조건) Then
cond4 = -1;
if (cond2+cond3+cond4) == 3 and (cond2[1]+cond3[1]+cond4[1]) != 3 Then
buy();
if (cond2+cond3+cond4) == -3 and (cond2[1]+cond3[1]+cond4[1]) != -3 Then
sell();
이걸 조합하려니 자꾸에러가 떠서요...
부탁드립니다..
그리고 참조챠트를 위식으로해놓고 3개를 뛰우면 되는거죠??
감사합니다..수고하세요..^^