예스스탁
예스스탁 답변
2021-03-24 14:23:44
안녕하세요
예스스탁입니다.
input : StartTime(70000),EndTime(050000),xtime(055000);
input : N(115);
Input : 당일수익틱수(120),당일손실틱수(30);
var : Tcond(false);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
if sDate != sDate[1] Then
SetStopEndofday(xtime);
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
{
var1 = O;
Tcond = true;
Xcond = false;
N1 = NetProfit;
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;
}
if Tcond == true and Xcond == False Then
{
if MarketPosition <= 0 and L >= DayOpen-N*PriceScale Then
Buy("b",AtLimit,DayOpen-1*PriceScale);
if MarketPosition <= 0 and L >= DayOpen-N*PriceScale Then
Sell("s",AtLimit,DayOpen+120*PriceScale);
}
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));
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식어 부탁드립니다
> input : StartTime(70000),EndTime(050000);
input : N(115);
var : Tcond(false);
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
{
var1 = O;
Tcond = true;
SetStopEndofday(0);
}
if Tcond == true Then
{
if MarketPosition <= 0 and L >= DayOpen-N*PriceScale Then
Buy("b",AtLimit,DayOpen-1*PriceScale);
if MarketPosition <= 0 and L >= DayOpen-N*PriceScale Then
Sell("s",AtLimit,DayOpen+120*PriceScale);
}
--------------------
상기 수식어에서
07시부터 05시까지 총수익 120틱에 매매정지
07시부터 05시까지 총손실 30틱에 매매정지
매매 청산시간은 익일 05시50분으로 부탁드립니다.