예스스탁
예스스탁 답변
2021-05-21 09:54:29
안녕하세요
예스스탁입니다.
1
Input : 당일수익틱수(200);
var : entry(0),mav1(0),mav2(0);
var : B(0),S(0),LL(0),HH(0);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
if bdate != bdate[1] Then
{
entry = 0;
Condition1 = False;
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;
}
mav1 = ma(C,2);
mav2 = ma(c,10);
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Condition1 == false and L <= DayHigh-PriceScale*100 Then
{
Condition1 = true;
B = 0;
}
if Condition1 == true Then
{
if CrossUp(mav1,mav2) Then
{
B = B+1;
if B == 1 Then
LL = Lowest(L,5);
if B == 2 and MarketPosition <= 0 and entry < 1 and Xcond == false Then
{
B = 3;
Buy("b");
}
}
}
if MarketPosition == 1 Then
{
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*100);
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if CrossDown(mav1,mav2) Then
ExitLong();
}
if Condition2 == false and H >= DayLow+PriceScale*100 Then
{
Condition2 = true;
S = 0;
}
if Condition2 == true Then
{
if CrossDown(mav1,mav2) Then
{
S = S+1;
if S == 1 Then
HH = highest(H,5);
if S == 2 and MarketPosition >= 0 and entry < 1 and Xcond == false Then
Sell("s");
}
}
if MarketPosition == -1 Then
{
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*100);
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if CrossDown(mav1,mav2) Then
ExitShort();
}
if sdate != sdate[1] Then
SetStopEndofday(55000);
if bdate != bdate[1] Then
SetStopEndofday(0);
2
input : StartTime1(070000),EndTime1(220000),진입횟수1(1);
input : StartTime2(220000),EndTime2(055000),진입횟수2(2);
input : Xtime(055000),당일수익틱수(200);
var : entry(0),Tcond1(false),Tcond2(False);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false),mav1(0),mav2(0),B(0),S(0),HH(0),LL(0);
mav1 = ma(C,2);
mav2 = ma(c,10);
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
Tcond1 = False;
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond1 = true;
entry = 0;
Xcond = false;
N1 = NetProfit;
Condition1 = False;
Condition2 = False;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
Tcond2 = False;
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond2 = true;
entry = 0;
Condition1 = False;
Condition2 = False;
}
당일수익 = 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;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Condition1 == false and L <= DayHigh-PriceScale*160 Then
{
Condition1 = true;
B = 0;
}
if Condition1 == true Then
{
if CrossUp(mav1,mav2) Then
{
B = B+1;
if B == 1 Then
LL = Lowest(L,5);
if B == 2 and MarketPosition <= 0 and Xcond == False and ((Tcond1 == true and entry < 진입횟수1) or (Tcond2 == true and entry < 진입횟수2)) Then
{
B = 3;
Buy("b");
}
}
}
if MarketPosition == 1 Then
{
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*100);
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if CrossDown(mav1,mav2) Then
ExitLong();
}
if Condition2 == false and H >= DayLow+PriceScale*200 Then
{
Condition2 = true;
S = 0;
}
if Condition2 == true Then
{
if CrossDown(mav1,mav2) Then
{
S = S+1;
if S == 1 Then
HH = highest(H,5);
if S == 2 and MarketPosition >= 0 and Xcond == False and ((Tcond1 == true and entry < 진입횟수1) or (Tcond2 == true and entry < 진입횟수2)) Then
Sell("s");
}
}
if MarketPosition == -1 Then
{
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*150);
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if CrossUp(mav1,mav2) Then
ExitShort();
}
if sdate != sdate[1] Then
SetStopEndofday(Xtime);
if bdate != bdate[1] Then
SetStopEndofday(0);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식작성
> var : entry(0);
if bdate != bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition <= 0 and entry < 1 Then
buy("b",atlimit,dayhigh-PriceScale*100);
if MarketPosition == 1 Then
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*100);
if MarketPosition >= 0 and entry < 1 Then
sell("s",atlimit,daylow+PriceScale*100);
if MarketPosition == -1 Then
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*100);
if sdate != sdate[1] Then
SetStopEndofday(55000);
if bdate != bdate[1] Then
SetStopEndofday(0);
---------------------------
input : StartTime1(070000),EndTime1(220000),진입횟수1(1);
input : StartTime2(220000),EndTime2(055000),진입횟수2(2);
input : Xtime(055000),당일수익틱수(150);
var : entry(0),Tcond1(false),Tcond2(False);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
Tcond1 = False;
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond1 = true;
entry = 0;
Xcond = false;
N1 = NetProfit;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
Tcond2 = False;
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond2 = true;
entry = 0;
}
당일수익 = 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;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition <= 0 and Xcond == False and ((Tcond1 == true and entry < 진입횟수1) or (Tcond2 == true and entry < 진입횟수2)) Then
buy("b",atlimit,dayhigh-PriceScale*160);
if MarketPosition == 1 Then
{
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*100);
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
}
if MarketPosition >= 0 and Xcond == False and ((Tcond1 == true and entry < 진입횟수1) or (Tcond2 == true and entry < 진입횟수2)) Then
sell("s",atlimit,daylow+PriceScale*200);
if MarketPosition == -1 Then
{
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*150);
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
}
if sdate != sdate[1] Then
SetStopEndofday(Xtime);
if bdate != bdate[1] Then
SetStopEndofday(0);
---------------------------------------------------------
2가지 수식어의 추가 입니다.
조건만족후
buy 진입은 2분 10분 2회 골든크로스
buy 청산은 2분 10분 1회 데드크로스
진입의 손절은 1번째 골든크로스 전 캔들5봉 후 캔들5봉 의 저점의 이탈 입니다.
반대포지션도 동일 내용이며
당일 목표수익은 200틱의 수식어도 부탁드립니다.