커뮤니티
당일 매매 계산식 궁금점
2010-03-21 13:21:32
566
글번호 28792
input : entrycnt(50);
var : cnt(0),count(0);
var : PLR(0),XCommission(0),XSlippage(0),OpenPL(0),dayPL(0);
XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정
XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정
PLR = 0;
count = 0;
for var1 = 1 to 100{
if sdate == EntryDate(var1) Then{
PLR = PLR+PositionProfit(var1);
}
}
if MarketPosition() == 0 Then{
OpenPL = 0;
dayPL = PLR;
}
Else{
OpenPL = (PositionProfit-(XCommission+XSlippage));
dayPL = PLR+OpenPL;
}
count = 0;
for cnt = 0 to 50{
if sDate == EntryDate(cnt) Then
count = count+1;
}
if stime >=90000 then
Var3 = dayindex()+1; #당일봉개수
if count < entrycnt and 090000 < stime and stime < 144300 Then{
if count == 0 and MarketPosition == 0 and C > DayLow()[1]+1.0 Then
Buy("롱진입",AtStop,C);
....
위와 같이 매수식이 당일 저가보다 1포인트 초과하면 매수인데,
첨부파일과 같이 두번째 봉에서 매수를 해버렸습니다.
혹시 전일 종가까지 계산되어서 그런것인지 확인 부탁드릴께요.
뭐가 잘못되었을까요?
- 1. why.png (0.02 MB)
답변 1
예스스탁 예스스탁 답변
2010-03-22 08:59:34
안녕하세요
예스스탁입니다.
당일 첫봉의 시간이 90000보다 클경우가 발생하면
두번쨰 봉에도 신호가 발생하고 이때 daylow[1]은 전일봉의 값을 사용하게 됩니다.
수식을 수정했습니다.
input : entrycnt(50);
var : cnt(0),count(0);
var : PLR(0),XCommission(0),XSlippage(0),OpenPL(0),dayPL(0);
XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정
XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정
PLR = 0;
count = 0;
for var1 = 1 to 100{
if sdate == EntryDate(var1) Then{
PLR = PLR+PositionProfit(var1);
}
}
if MarketPosition() == 0 Then{
OpenPL = 0;
dayPL = PLR;
}
Else{
OpenPL = (PositionProfit-(XCommission+XSlippage));
dayPL = PLR+OpenPL;
}
count = 0;
for cnt = 0 to 50{
if sDate == EntryDate(cnt) Then
count = count+1;
}
if stime >=90000 then
Var3 = dayindex()+1; #당일봉개수
if count < entrycnt and dayindex > 0 and stime < 144300 Then{
if count == 0 and MarketPosition == 0 and C > DayLow()[1]+1.0 Then
Buy("롱진입",AtStop,C);
}
즐거운 하루되세요
> forKaren 님이 쓴 글입니다.
> 제목 : 당일 매매 계산식 궁금점
> input : entrycnt(50);
var : cnt(0),count(0);
var : PLR(0),XCommission(0),XSlippage(0),OpenPL(0),dayPL(0);
XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정
XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정
PLR = 0;
count = 0;
for var1 = 1 to 100{
if sdate == EntryDate(var1) Then{
PLR = PLR+PositionProfit(var1);
}
}
if MarketPosition() == 0 Then{
OpenPL = 0;
dayPL = PLR;
}
Else{
OpenPL = (PositionProfit-(XCommission+XSlippage));
dayPL = PLR+OpenPL;
}
count = 0;
for cnt = 0 to 50{
if sDate == EntryDate(cnt) Then
count = count+1;
}
if stime >=90000 then
Var3 = dayindex()+1; #당일봉개수
if count < entrycnt and 090000 < stime and stime < 144300 Then{
if count == 0 and MarketPosition == 0 and C > DayLow()[1]+1.0 Then
Buy("롱진입",AtStop,C);
....
위와 같이 매수식이 당일 저가보다 1포인트 초과하면 매수인데,
첨부파일과 같이 두번째 봉에서 매수를 해버렸습니다.
혹시 전일 종가까지 계산되어서 그런것인지 확인 부탁드릴께요.
뭐가 잘못되었을까요?