커뮤니티
수정부탁드립니다
2013-06-07 11:23:49
248
글번호 64075
var: N지표(0),cnt(0),count(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then
N지표 = 0;
If dayindex > 0 Then
{
If Close[0] > Close[1] Then
N지표= N지표[1] + Volume;
Else
If Close[0] < Close[1] Then
N지표= N지표[1] - Volume;
Else
N지표= N지표[1];
}
var1 = highest(N지표,dayindex+1);
var2 = Lowest(N지표,dayindex+1);
if dayindex > 0 and count == 0 and MarketPosition == 0 Then{
if crossup(N지표,3500) Then
buy("b1");
if CrossDown(N지표,-3500) Then
sell("s1");
}
if dayindex > 0 and count == 1 and MarketPosition == 0 Then{
if MarketPosition(1) == 1 and CrossDown(N지표,var1-5700) Then
sell("b2");
if MarketPosition(1) == -1 and CrossUp(N지표,var2+5700) Then
buy("s2");
}
if MarketPosition == 1 Then{
if IsExitName("b1") == true and CrossDown(N지표,var1-3000) Then
exitlong("bx1");
if IsExitName("b2") == true and CrossDown(N지표,var1-3000) Then
exitlong("bx2");
}
if MarketPosition == -1 Then{
if IsExitName("s1") == true and CrossUp(N지표,var2+3000) Then
ExitShort("sx1");
if IsExitName("s2") == true and CrossDown(N지표,var2+3000) Then
ExitShort("sx2");
}
1.
당일 시초가에 N지표의 값을 0으로 보고
시스템식의 b1,s1의 진입은 되나 bx1,sx1의 청산과
b2,s2의 진입 bx2,sx2의청산이 되지않고있습니다 수정부탁드립니다
2.b1-bx1 or s1-sx1의 첫진입 수익일시 b2,s2의 진입을 제한하는 식
답변 1
예스스탁 예스스탁 답변
2013-06-07 12:34:56
안녕하세요
예스스탁입니다.
1, 수정한 식입니다. (진입명의 이름은 IsEntryName로 지정하셔야 합니다)
var: N지표(0),cnt(0),count(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then
N지표 = 0;
If dayindex > 0 Then
{
If Close[0] > Close[1] Then
N지표= N지표[1] + Volume;
Else
If Close[0] < Close[1] Then
N지표= N지표[1] - Volume;
Else
N지표= N지표[1];
}
var1 = highest(N지표,dayindex+1);
var2 = Lowest(N지표,dayindex+1);
if dayindex > 0 and count == 0 and MarketPosition == 0 Then{
if crossup(N지표,3500) Then
buy("b1");
if CrossDown(N지표,-3500) Then
sell("s1");
}
if dayindex > 0 and count == 1 and MarketPosition == 0 Then{
if MarketPosition(1) == 1 and CrossDown(N지표,var1-5700) Then
sell("s2");
if MarketPosition(1) == -1 and CrossUp(N지표,var2+5700) Then
buy("b2");
}
if MarketPosition == 1 Then{
if IsEntryName("b1") == true and CrossDown(N지표,var1-3000) Then
exitlong("bx1");
if IsEntryName("b2") == true and CrossDown(N지표,var1-3000) Then
exitlong("bx2");
}
if MarketPosition == -1 Then{
if IsEntryName("s1") == true and crossup(N지표,var2+3000) Then
ExitShort("sx1");
if IsEntryName("s2") == true and crossup(N지표,var2+3000) Then
ExitShort("sx2");
}
2.
var: N지표(0),cnt(0),count(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then
N지표 = 0;
If dayindex > 0 Then
{
If Close[0] > Close[1] Then
N지표= N지표[1] + Volume;
Else
If Close[0] < Close[1] Then
N지표= N지표[1] - Volume;
Else
N지표= N지표[1];
}
var1 = highest(N지표,dayindex+1);
var2 = Lowest(N지표,dayindex+1);
if dayindex > 0 and count == 0 and MarketPosition == 0 Then{
if crossup(N지표,3500) Then
buy("b1");
if CrossDown(N지표,-3500) Then
sell("s1");
}
if dayindex > 0 and count == 1 and MarketPosition == 0 and PositionProfit(1) < 0 Then{
if MarketPosition(1) == 1 and CrossDown(N지표,var1-5700) Then
sell("s2");
if MarketPosition(1) == -1 and CrossUp(N지표,var2+5700) Then
buy("b2");
}
if MarketPosition == 1 Then{
if IsEntryName("b1") == true and CrossDown(N지표,var1-3000) Then
exitlong("bx1");
if IsEntryName("b2") == true and CrossDown(N지표,var1-3000) Then
exitlong("bx2");
}
if MarketPosition == -1 Then{
if IsEntryName("s1") == true and crossup(N지표,var2+3000) Then
ExitShort("sx1");
if IsEntryName("s2") == true and crossup(N지표,var2+3000) Then
ExitShort("sx2");
}
즐거운 하루되세요
> 1231241 님이 쓴 글입니다.
> 제목 : 수정부탁드립니다
> var: N지표(0),cnt(0),count(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then
N지표 = 0;
If dayindex > 0 Then
{
If Close[0] > Close[1] Then
N지표= N지표[1] + Volume;
Else
If Close[0] < Close[1] Then
N지표= N지표[1] - Volume;
Else
N지표= N지표[1];
}
var1 = highest(N지표,dayindex+1);
var2 = Lowest(N지표,dayindex+1);
if dayindex > 0 and count == 0 and MarketPosition == 0 Then{
if crossup(N지표,3500) Then
buy("b1");
if CrossDown(N지표,-3500) Then
sell("s1");
}
if dayindex > 0 and count == 1 and MarketPosition == 0 Then{
if MarketPosition(1) == 1 and CrossDown(N지표,var1-5700) Then
sell("b2");
if MarketPosition(1) == -1 and CrossUp(N지표,var2+5700) Then
buy("s2");
}
if MarketPosition == 1 Then{
if IsExitName("b1") == true and CrossDown(N지표,var1-3000) Then
exitlong("bx1");
if IsExitName("b2") == true and CrossDown(N지표,var1-3000) Then
exitlong("bx2");
}
if MarketPosition == -1 Then{
if IsExitName("s1") == true and CrossUp(N지표,var2+3000) Then
ExitShort("sx1");
if IsExitName("s2") == true and CrossDown(N지표,var2+3000) Then
ExitShort("sx2");
}
1.
당일 시초가에 N지표의 값을 0으로 보고
시스템식의 b1,s1의 진입은 되나 bx1,sx1의 청산과
b2,s2의 진입 bx2,sx2의청산이 되지않고있습니다 수정부탁드립니다
2.b1-bx1 or s1-sx1의 첫진입 수익일시 b2,s2의 진입을 제한하는 식
다음글
이전글