예스스탁
예스스탁 답변
2021-04-30 11:37:09
안녕하세요
예스스탁입니다.
input : StartTime(213000),EndTime(055000),진입횟수(10),익절틱수(120),손절틱수(25);
Input : Period(20);
Input : 당일수익틱수(600);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
Var : value(0),Tcond(false),entry(0),B1(0),B2(0),X1(0),X2(0);
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
{
SetStopEndofday(0);
Tcond = true;
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);
B1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.382;
B2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.236;
X1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.800;
X2 = DayHigh(1);
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true and Xcond == False and entry < 진입횟수 Then
{
if MarketPosition == 0 and C > O Then
{
Buy("b1");
}
if MarketPosition == 0 and C < O Then
{
Sell("s1");
}
If CrossUP(value, 100) Then
{
Buy("b2");
}
If CrossDown(value, 1500) Then
{
ExitLong("bx");
}
if (MarketPosition == 0 or (MarketPosition == 1 and MaxEntries == 1)) Then
{
if entry < 5 and L > B1 Then
Buy("b3",AtLimit,B1);
if entry < 5 and L > B2 Then
Buy("b4",AtLimit,B2);
}
if marketposition == 1 then
{
if isentryname("b2") == 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 >= 213000 or EntryTime < Endtime Then
ExitLong("bpx",AtLimit,EntryPrice+PriceScale*20);
}
if marketposition == -1 then
{
if isentryname("s2") == 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 >= 213000 or EntryTime < Endtime Then
ExitShort("spx",AtLimit,EntryPrice-PriceScale*20);
}
if MarketPosition == 1 Then
{
ExitLong("bx3",AtLimit,X1,"B3");
ExitLong("bx4",AtLimit,X2,"B4");
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식어 부탁드립니다
> input : StartTime(213000),EndTime(055000),진입횟수(5),익절틱수(120),손절틱수(25);
var : Tcond(false),entry(0);
if StartTime < EndTime 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
{
if StartTime > EndTime Then
SetStopEndofday(0);
Tcond = true;
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true Then
{
if MarketPosition == 0 and C > O and entry < 진입횟수 Then
{
Buy("b");
}
if MarketPosition == 0 and C < O and entry < 진입횟수 Then
{
Sell("s");
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
--------------------------------------
input : StartTime(180000),EndTime(055000),xtime(055500);
Input : Period(20);
Input : 당일수익틱수(600);
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, 1500) and Xcond == False Then
{
ExitLong();
}
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 >= 213000 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 >= 213000 or EntryTime < Endtime Then
ExitShort("spx",AtLimit,EntryPrice-PriceScale*20);
}
-------------------------
input : StartTime(70000),EndTime(55000),Xtime(55500);
var : Tcond(false),B1(0),B2(0),X1(0),X2(0),entry(0);
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);
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
B1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.382;
B2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.236;
X1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.800;
X2 = DayHigh(1);
if Tcond == true Then
{
if (MarketPosition == 0 or (MarketPosition == 1 and MaxEntries == 1)) Then
{
if entry < 5 and L > B1 Then
Buy("b1",AtLimit,B1);
if entry < 5 and L > B2 Then
Buy("b2",AtLimit,B2);
}
if MarketPosition == 1 Then
{
ExitLong("bx1",AtLimit,X1,"B1");
ExitLong("bx2",AtLimit,X2,"B2");
}
}
SetStopProfittarget(PriceScale*150,PointStop);
SetStopLoss(PriceScale*30,PointStop);
--------------------
매매시간 및 진입횟수 ,익절, 손절은 아래 내용으로 통일해주시고 다른 진입허용으로
상기 수식어 3개의 합체를 부탁드립니다.
StartTime(213000),EndTime(055000),진입횟수(10),익절틱수(120),손절틱수(25)