// 안녕하세요 아래식 엉터리 로 짜셨군요
// 몇시간째 거래후 시스템 재설정이나 컴을 끄고 재로고인하면 시스템 성능보고서
// 거래 내역이 변화가 일어납니다 이건 못써요 재수정 부탁 드리겠습니다
input : StartTime(70000),EndTime(70000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Inputs: VtyPercent(0.16),ATRperiod(50);
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == 1 Then
Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == -1 Then
ExitLong ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> 1 Then
ExitShort ("Vty_LE2", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE2)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == 1 Then
ExitShort ("Vty_LE3", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == -1 Then
Sell ("Vty_SE3)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
답변 1
예스스탁
예스스탁 답변
2023-04-26 10:58:06
안녕하세요
예스스탁입니다.
올려주신 내용 수식은 수정할 부분이 없습니다.
실시간에서 발생한 신호가 재적용시 변경이 된다면 원인은 두가지 입니다.
하나는 시세누락이고 다른 하나는 봉가정입니다.
실시간에서 시세 누락이 발생하면 차트 재조회시에 서버에서
다시 완전한 데이타를 받으므로 신호가 변경될 수 있습니다.
일반 분주기와 같은 경우에는 시고저종에 해당 하는 시세의 누락만 없으면
신호가 변경되지 않지만 틱주기의 경우 틱봉은 수신되는 시세갯수로 봉을 만들게 되므로
시세 누락이 발생하면 봉 자체의 시고저종이 변경이 되므로 실시간과 시뮬레이션의 시세가 다를 수 있습니다.
차트의 과거봉에는 시고저종으로만 만들고 모든시세가 있지 않습니다.
그러므로 과거봉의 내부의 움직임은 가설을 지정해서
해당 가설과 같이 움직인것으로 보고 신호가 발생합니다.
사용하시는 식은 미완성시에 가격조건을 체크해서 진입하는 내용입니다.
과거데이타가 실시간이었을때와 이후 시뮬레이션 봉일때 가설에 따른 움직임과 다를수 있으므로
신호가 발경이 될수 있습니다.
해당 부분을 해결하려면 신호를 보완성시로 작성하셔야 합니다.
현재 미완성시에 가격조건 충족하는 내용이면 해당 부분을 해결할 방법이 없습니다.
input : StartTime(70000),EndTime(70000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Inputs: VtyPercent(0.16),ATRperiod(50);
If MarketPosition <= 0 and CrossUp(C,Close + (VtyPercent * ATR(ATRperiod))) Then
Buy ("Vty_LE");
If MarketPosition == 1 and CrossDown(c,Close - (VtyPercent * ATR(ATRperiod))) Then
ExitLong ("Vty_SE");
If MarketPosition() == 1 and CrossUp(c,Close + (VtyPercent * ATR(ATRperiod))) Then
Buy ("Vty_LE1");
If MarketPosition == 1 and CrossDown(c,Close - (VtyPercent * ATR(ATRperiod))) Then
ExitLong ("Vty_SE1");
If MarketPosition == 1 and CrossUp(c,Close + (VtyPercent * ATR(ATRperiod))) Then
ExitShort ("Vty_LE2");
If MarketPosition() >= 0 and CrossDown(c,Close - (VtyPercent * ATR(ATRperiod))) Then
Sell ("Vty_SE2");
If MarketPosition() == 1 and CrossUp(c,Close + (VtyPercent * ATR(ATRperiod))) Then
ExitShort ("Vty_LE3") ;
If MarketPosition() == -1 and CrossDown(c, Close - (VtyPercent * ATR(ATRperiod))) Then
Sell ("Vty_SE3");
즐거운 하루되세요
> 신들의전쟁 님이 쓴 글입니다.
> 제목 : 엉터리 시스템 였네요
> // 안녕하세요 아래식 엉터리 로 짜셨군요
// 몇시간째 거래후 시스템 재설정이나 컴을 끄고 재로고인하면 시스템 성능보고서
// 거래 내역이 변화가 일어납니다 이건 못써요 재수정 부탁 드리겠습니다
input : StartTime(70000),EndTime(70000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Inputs: VtyPercent(0.16),ATRperiod(50);
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == 1 Then
Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == -1 Then
ExitLong ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> 1 Then
ExitShort ("Vty_LE2", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE2)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == 1 Then
ExitShort ("Vty_LE3", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() == -1 Then
Sell ("Vty_SE3)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));