예스스탁
예스스탁 답변
2021-06-14 15:23:14
안녕하세요
예스스탁입니다.
청산은 x1은 90%, x1는 95%로 지정해 드립니다.
원하시는 다른값으로 수정하시기 바랍니다.
1. 2회분할청산(x1에 b1청산, x2에 b2청산)
input : StartTime(080000),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.618;
B2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.764;
X1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.900;
X2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.950;
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*300,PointStop);
SetStopLoss(PriceScale*20,PointStop);
2. 1회청산(x1에 모두 청산)
input : StartTime(080000),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.618;
B2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.764;
X1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.900;
X2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.950;
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);
}
}
SetStopProfittarget(PriceScale*300,PointStop);
SetStopLoss(PriceScale*20,PointStop);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식작성
> input : StartTime(080000),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.618;
B2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.580;
X1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.950;
X2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.900;
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*300,PointStop);
SetStopLoss(PriceScale*20,PointStop);
---------------------------------
전일 피보나치 수열을 하단 0 상단 100 으로 했을때 당일 시가가 전일의 61.8 ~ 76.4 %
구간일때 위의 수식어의 적용과 진입과 청산은 b1 , b2 1회와 2회의 2가지 수식어를
부탁드립니다.
늘 감사합니다.