예스스탁
예스스탁 답변
2021-04-23 11:06:14
안녕하세요
예스스탁입니다.
input : StartTime(140000),EndTime(055000),xtime(055500);
Input : Period(20);
Input : 당일수익틱수(120);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
Var : value(0),Tcond(false);
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
{
Tcond = true;
SetStopEndofday(0);
Xcond = false;
N1 = NetProfit;
}
당일수익 = PriceScale*당일수익틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true ) then
Xcond = true;
}
value = VR(Period);
var1 = ma(C,5);
var2 = ma(C,200);
If CrossUP(value, 100) and Xcond == False Then
{
Buy("b");
}
If CrossDown(value, 300) and Xcond == False Then
{
Sell("s");
}
if marketposition == 1 then
{
if isentryname("b") == true and crossdown(var1,var2) then
sell("bs");
if crossdown(var2,var3) Then
Exitlong("sbx",onclose,def,"sb");
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 and EntryTime < 190000 Then
{
ExitLong("bpx",AtLimit,EntryPrice+PriceScale*20);
ExitLong("blx",AtStop,EntryPrice-PriceScale*20);
}
}
if marketposition == -1 then
{
if isentryname("s") == true and crossup(var1,var2) then
buy("sb");
if crossup(var2,var3) Then
ExitShort("bsx",onclose,def,"bs");
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 and EntryTime < 190000 Then
{
ExitShort("spx",AtLimit,EntryPrice-PriceScale*20);
ExitShort("slx",AtStop,EntryPrice+PriceScale*20);
}
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식어 부탁드립니다
> input : StartTime(140000),EndTime(055000),xtime(055500);
Input : Period(20);
Input : 당일수익틱수(120);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
Var : value(0),Tcond(false);
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
{
Tcond = true;
SetStopEndofday(0);
Xcond = false;
N1 = NetProfit;
}
당일수익 = PriceScale*당일수익틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true ) then
Xcond = true;
}
value = VR(Period);
var1 = ma(C,5);
var2 = ma(C,200);
If CrossUP(value, 100) and Xcond == False Then
{
Buy("b");
}
If CrossDown(value, 300) and Xcond == False Then
{
Sell("s");
}
if marketposition == 1 then
{
if isentryname("b") == true and crossdown(var1,var2) then
sell("bs");
if crossdown(var2,var3) Then
Exitlong("sbx",onclose,def,"sb");
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 or EntryTime < Endtime Then
ExitLong("bpx",AtLimit,EntryPrice+PriceScale*20);
}
if marketposition == -1 then
{
if isentryname("s") == true and crossup(var1,var2) then
buy("sb");
if crossup(var2,var3) Then
ExitShort("bsx",onclose,def,"bs");
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 or EntryTime < Endtime Then
ExitShort("spx",AtLimit,EntryPrice-PriceScale*20);
}
------------------------------------------
아래는 위수식어 하단의 특정시간 매매수익에 관한것 입니다
if marketposition == 1 then
{
if isentryname("b") == true and crossdown(var1,var2) then
sell("bs");
if crossdown(var2,var3) Then
Exitlong("sbx",onclose,def,"sb");
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 or EntryTime < Endtime Then
ExitLong("bpx",AtLimit,EntryPrice+PriceScale*20);
}
if marketposition == -1 then
{
if isentryname("s") == true and crossup(var1,var2) then
buy("sb");
if crossup(var2,var3) Then
ExitShort("bsx",onclose,def,"bs");
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 or EntryTime < Endtime Then
ExitShort("spx",AtLimit,EntryPrice-PriceScale*20);
}
위의 수식어의 시간을 14시부터 19시까지 그리고 수익은 20틱 손실은 20틱으로 변경하고자 합니다