예스스탁
예스스탁 답변
2020-02-13 12:45:51
안녕하세요
예스스탁입니다.
input : Period(12),Period1(20);
input : StartTime1(103000),EndTime1(125000);
input : StartTime2(141000),EndTime2(165000);
input : StartTime3(23000),EndTime3(015000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
Tcond = true;
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
Tcond = true;
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime3) or
(sdate == sdate[1] and stime >= StartTime3 and stime[1] < StartTime3) Then
Tcond = true;
if (sdate != sdate[1] and stime >= EndTime3) or
(sdate == sdate[1] and stime >= EndTime3 and stime[1] < EndTime3) Then
Tcond = False;
var1 = trix(Period);
var2 = ma(C,Period1);
if crossup(var1,0) Then
value1 = var2;
if var2 > value1 Then
value1 = var2;
if CrossDown(var1,0) Then
value2 = var2;
if var2 < value2 Then
value2 = var2;
#plot1(value1);
#plot2(value2);
input : g(12),r(25),s(2);
var11 = ema(ema(c-(highest(H,g) + lowest(L,g))*0.5,r),s) * 100/
(0.5 * ema(ema(highest(H,g)-lowest(L,g),r),s));
#plot1(var11);
#plot2(40);
#plot3(-40);
if tcond == true then
{
if MarketPosition <= 0 and
value1 < value1[1] and value1[1] == value1[2] and
abs(value1-value1[1]) > abs(value1-value2[1]) and
c > value1 then
{
ExitShort("sx2");
if var11 < 40 Then
buy("b1");
}
if MarketPosition(1) != 0 and
MarketPosition == 0 and
value1 > value1[1] and value1[1] == value1[2] and
value2 == value2[1] and
countif(value1 == value1[1],10)[1] < 10 and
c > value1 Then
buy("b2");
if MarketPosition == 1 then
{
ExitLong("bx1",AtStop,value2-PriceScale*13);
if c <= value1-PriceScale*25 Then
ExitLong("bx3");
}
if MarketPosition >= 0 and
value1 > value1[1] and value1[1] == value1[2] and
abs(value2-value2[1]) > abs(value2-value1[1]) and
c < value2 then
{
ExitLong("bx2");
if var11 > -40 Then
sell("s1");
}
if MarketPosition(1) != 0 and
MarketPosition == 0 and
value1 < value1[1] and value1[1] == value1[2] and
value2 == value2[1] and
countif(value2 == value2[1],10)[1] < 10 and
c < value2 Then
sell("s2");
if MarketPosition == -1 then
{
ExitShort("sx1",AtStop,value2+PriceScale*13);
if c >= value1+PriceScale*25 Then
ExitShort("sx3");
}
}
즐거운 하루되세요
> as8282 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 질문 65995에서
1. if MarketPosition <= 0 and
value1 < value1[1] and value1[1] == value1[2] then 의 매수식에서
** value1의 가격이 ( 내려간 value1의 가격 ) 전봉의 value1 가격과의 폭이
전봉의 value2 가격과의 폭보다 커야 매수
if MarketPosition >= 0 and
value2 > value2[1] and value2[1] == value2[2] then 의 매도식에서
** value2의 가격이 ( 올라온 value2의 가격 ) 전봉의 value1 가격과의 폭이
전봉의 value2 가격과의 폭보다 작아야 매도
2. if MarketPosition(1) != 0 and
MarketPosition == 0 and
value1 > value1[1] and value1[1] == value1[2] and
value2 == value2[1] Then 의 매수식에서
** value1 전봉의 가격을확인해서 전 10봉이상이 같은 가격이면 매수금지
10봉 이하면 매수
if MarketPosition(1) != 0 and
MarketPosition == 0 and
value1 < value1[1] and value1[1] == value1[2] and
value2 == value2[1] Then 의 매도식에서
** value2 전봉의 가격을확인해서 전 10봉이상이 같은 가격이면 매도금지
10봉 이하면 매도
3.매수공통조건 : 종가가 plot1 보다 커야한다.
매도공통조건 : 종가가 plot2 보다 작아야한다.
는 조건식을 추가부탁드립니다.
미리 감사드립니다.