예스스탁
예스스탁 답변
2021-04-23 14:42:33
안녕하세요
예스스탁입니다.
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);
Var3 = ma(C,480);
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("bs1");
if isentryname("b") == true and crossdown(var1,var3) then
sell("bs2");
if crossdown(var2,var3) Then
Exitlong("sbx",onclose,def,"sb1");
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("sb1");
if isentryname("s") == true and crossup(var1,var3) then
buy("sb2");
if crossup(var2,var3) Then
ExitShort("bsx",onclose,def,"bs1");
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 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);
}
}
--------------------
위의 수식어에서 추가되는 내용입니다
sell일때 5선 480선 골든크로스는 buy전환
buy 일때 5선 480선 데드크로스는 sell전환의 수식어 추가입니다