예스스탁
예스스탁 답변
2023-09-04 11:29:52
안녕하세요
예스스탁입니다.
input : StartTime(210000),EndTime(045900);
Input : 당일수익틱수(250),당일손실틱수(250);
var : 당일수익(0),당일손실(0),N1(0),Xcond(False),daypl(0);
var : Tcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
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;
Xcond = false;
N1 = NetProfit;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 or daypl <= -당일손실 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
}
///////////////////////////////////////////////////////////////////////////////////////
input : Period(10);
var : Counter(0), Lowval(0), Highval(0), DownVel(0),UpVel(0), DnAroon(0),UpAroon(0) ;
Lowval= Lowest(Low, Period+1);
Highval = Highest(High, Period+1);
For counter= 0 To Period {
If Low[counter] == Lowval Then
DownVel = counter;
If High[counter] == highval Then
UpVel = counter;
}
UpAroon = 100*(Period-UpVel)/Period;
DnAroon = 100*(Period-DownVel)/Period;
if Tcond == true and Xcond == False Then
{
if crossup(UpAroon,DnAroon) Then
buy("Aroon_LE");
if CrossDown(UpAroon,DnAroon) Then
sell("Aroon_SE");
}
if MarketPosition == 1 then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
즐거운 하루되세요
> 하늘북 님이 쓴 글입니다.
> 제목 : 문의드립니다.
>
늘 감사합니다.
아래 수식에 당일수익 250틱 이상이면 진입금지
당일손실 -250틱 이상이면 진입금지
수정부탁드립니다.
/////////////////////////////////////////////////////////////////////
input : StartTime(210000),EndTime(045900);
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);
}
}
///////////////////////////////////////////////////////////////////////////////////////
input : Period(10);
var : Counter(0), Lowval(0), Highval(0), DownVel(0),UpVel(0), DnAroon(0),UpAroon(0) ;
Lowval= Lowest(Low, Period+1);
Highval = Highest(High, Period+1);
For counter= 0 To Period {
If Low[counter] == Lowval Then
DownVel = counter;
If High[counter] == highval Then
UpVel = counter;
}
UpAroon = 100*(Period-UpVel)/Period;
DnAroon = 100*(Period-DownVel)/Period;
if crossup(UpAroon,DnAroon) Then
buy("Aroon_LE");
if CrossDown(UpAroon,DnAroon) Then
sell("Aroon_SE");
수정해주신 글 잘 보았습니다.
해당시스템이 잘 동작하지 않습니다.
당일 수익과 손실이 발생하면 진입이 금지되어야 하나 계속들어갑니다.
누적수익과 누적손실이 250틱 발생하면 진입금지 하게 수정부탁드립니다.
** 지금은 매매설정창에서 15포인트 수익청산, -15포인트 손절로 진행중이며,
그 누적 수익과 손실을 적용하여 주시면 감사하겠습니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 문의드립니다.
> 안녕하세요
예스스탁입니다.
input : StartTime(210000),EndTime(045900);
Input : 당일수익틱수(250),당일손실틱수(250);
var : 당일수익(0),당일손실(0),N1(0),Xcond(False),daypl(0);
var : Tcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
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;
Xcond = false;
N1 = NetProfit;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 or daypl <= -당일손실 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
}
///////////////////////////////////////////////////////////////////////////////////////
input : Period(10);
var : Counter(0), Lowval(0), Highval(0), DownVel(0),UpVel(0), DnAroon(0),UpAroon(0) ;
Lowval= Lowest(Low, Period+1);
Highval = Highest(High, Period+1);
For counter= 0 To Period {
If Low[counter] == Lowval Then
DownVel = counter;
If High[counter] == highval Then
UpVel = counter;
}
UpAroon = 100*(Period-UpVel)/Period;
DnAroon = 100*(Period-DownVel)/Period;
if Tcond == true and Xcond == False Then
{
if crossup(UpAroon,DnAroon) Then
buy("Aroon_LE");
if CrossDown(UpAroon,DnAroon) Then
sell("Aroon_SE");
}
if MarketPosition == 1 then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
즐거운 하루되세요
> 하늘북 님이 쓴 글입니다.
> 제목 : 문의드립니다.
>
늘 감사합니다.
아래 수식에 당일수익 250틱 이상이면 진입금지
당일손실 -250틱 이상이면 진입금지
수정부탁드립니다.
/////////////////////////////////////////////////////////////////////
input : StartTime(210000),EndTime(045900);
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);
}
}
///////////////////////////////////////////////////////////////////////////////////////
input : Period(10);
var : Counter(0), Lowval(0), Highval(0), DownVel(0),UpVel(0), DnAroon(0),UpAroon(0) ;
Lowval= Lowest(Low, Period+1);
Highval = Highest(High, Period+1);
For counter= 0 To Period {
If Low[counter] == Lowval Then
DownVel = counter;
If High[counter] == highval Then
UpVel = counter;
}
UpAroon = 100*(Period-UpVel)/Period;
DnAroon = 100*(Period-DownVel)/Period;
if crossup(UpAroon,DnAroon) Then
buy("Aroon_LE");
if CrossDown(UpAroon,DnAroon) Then
sell("Aroon_SE");