답변완료
그물망 타주기 조건식
항상 감사드립니다
아래조건식을 타주기식에 적용코져합니다.
####################
###신거래선 기준 ###
####################
var:var3(0),var960(0);
if V == highest(V,3) Then
var3 = (C+H+L)/3; #120거래선#
if V == highest(V,960) Then
var960 = (C+H+L)/3; #240거래선#
#############
RMI 매매식
#############
input : MOM기간(5),적용기간(14),시그널기간(5);
var : RMI(0),RMIsig(0);
var: t70(0);
RMI = iff((ma(iff(c<c[MOM기간],(c[MOM기간]-c),0),적용기간))<=0,100,
(100-(100/(1+((ma(iff(c>c[MOM기간],(c-c[MOM기간]),0),적용기간))/(ma(iff(c<c[MOM기간],(c[MOM기간]-c),0),적용기간)))))));
RMIsig = ma(RMI,시그널기간);
if crossup(RMI,50) Then
t70 = 100 ;
if crossdown(RMI,50) Then
t70 = 0;
###############################
### 그물망 ###
################################
input:period90(60),횡보율(0.001);
var : var301(0),var302(0),var303(0),var304(0),var305(0),var306(0),var307(0),var308(0),var309(0),var310(0);
var : var311(0),var312(0),var313(0),var314(0),var315(0),var316(0),var317(0),var318(0),var319(0),var320(0),var321(0);
var : t60(0);
var301=ema(c,period90);
var302=ema(c,period90+1);
var303=ema(c,period90+2);
var304=ema(c,period90+3);
var305=ema(c,period90+4);
var306=ema(c,period90+5);
var307=ema(c,period90+6);
var308=ema(c,period90+7);
var309=ema(c,period90+8);
var310=ema(c,period90+9);
var311=ema(c,period90+10);
var312=ema(c,period90+11);
var313=ema(c,period90+12);
var314=ema(c,period90+13);
var315=ema(c,period90+14);
var316=ema(c,period90+15);
var317=ema(c,period90+16);
var318=ema(c,period90+17);
var319=ema(c,period90+18);
var320=ema(c,period90+19);
var321=ema(c,period90+20);
value1 = 0;
value2 = 0;
value3 = 0;
if var301>var301[1]*(1+횡보율/100) then value1 = value1+1;
else if var301<var301[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var302>var302[1]*(1+횡보율/100) then value1 = value1+1;
else if var302<var302[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var303>var303[1]*(1+횡보율/100) then value1 = value1+1;
else if var303<var303[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var304>var304[1]*(1+횡보율/100) then value1 = value1+1;
else if var304<var304[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var305>var305[1]*(1+횡보율/100) then value1 = value1+1;
else if var305<var305[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var306>var306[1]*(1+횡보율/100) then value1 = value1+1;
else if var306<var306[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var307>var307[1]*(1+횡보율/100) then value1 = value1+1;
else if var307<var307[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var308>var308[1]*(1+횡보율/100) then value1 = value1+1;
else if var308<var308[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var309>var309[1]*(1+횡보율/100) then value1 = value1+1;
else if var309<var309[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var310>var310[1]*(1+횡보율/100) then value1 = value1+1;
else if var310<var310[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var311>var311[1]*(1+횡보율/100) then value1 = value1+1;
else if var311<var311[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var312>var312[1]*(1+횡보율/100) then value1 = value1+1;
else if var312<var312[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var313>var313[1]*(1+횡보율/100) then value1 = value1+1;
else if var313<var313[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var314>var314[1]*(1+횡보율/100) then value1 = value1+1;
else if var314<var314[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var315>var315[1]*(1+횡보율/100) then value1 = value1+1;
else if var315<var315[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var316>var316[1]*(1+횡보율/100) then value1 = value1+1;
else if var316<var316[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var317>var317[1]*(1+횡보율/100) then value1 = value1+1;
else if var317<var317[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var318>var318[1]*(1+횡보율/100) then value1 = value1+1;
else if var318<var318[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var319>var319[1]*(1+횡보율/100) then value1 = value1+1;
else if var319<var319[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var320>var320[1]*(1+횡보율/100) then value1 = value1+1;
else if var320<var320[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var321>var321[1]*(1+횡보율/100) then value1 = value1+1;
else if var321<var321[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if value1 == 21 Then
t60 = 1 ;
else if value2 == 21 Then
t60 = -1;
Else if value3 == 21 Then
t60 = 0;
/*=======================*/
var: t90(0);
if t60 == 1 Then
T90 = 1 ;
if t60 == -1 Then
T90 = -1 ;
var3>var960 and t70==100 and t90==1이면 매수
var3<var960 and t70==0 and t90==-1이면 매도
감사합니다.
2021-02-10
891
글번호 146276
시스템
답변완료
문의
아래 수식과 반대인 buy 수식을 작성해보았습니다.
b3 진입이 발생하지 않는데 수식 검토바랍니다.
input : 진입시간(090000),진입제한시간(151500);
input : 거래횟수(20);
input : b1(40),진입눌림1(10),진입돌파1(10);
input : b2(40),진입눌림2(10),진입돌파2(10);
input : b3(40),진입눌림3(10),진입돌파3(10);
var : T1(0),entry(0),LL(0),EH(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0);
var : Tcond(false);
Var : loss(0);
if bdate != bdate[1] Then
loss = 0;
if TotalTrades > TotalTrades[1] and PositionProfit(1) < 0 Then
loss = loss+1;
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then{
T1 = TotalTrades;
E1 = 0;
LL = L;
}
if stime >= 진입시간 then
{
if L < LL Then
LL = L;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 Then
{
if E1 == 0 and C >= LL+PriceScale*B1 and C[1] < LL+PriceScale*B1 Then
{
E1 = 1;
H1 = H;
i1 = index;
V1 = LL; //시작점 종가
}
if E1 == 1 and index > i1 then
{
if H > H1 Then
H1 = H;
#저가가 시작봉종가보다 클때만 눌림체크
if L >= V1 and L <= H1-PriceScale*진입눌림1 Then
{
E1 = 2;
i1 = index;
S1 = H1;
}
}
//시작점 종가보다 낮은 가격이 발생하면 초기화
if E1 >= 1 and L < V1 Then
{
E1 = 0;
LL = L;
}
if E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파1 and Tcond == true Then
{
buy("b1");
}
}
if TotalTrades > TotalTrades[1] Then
{
E1 = 0;
LL = L;
}
if L < LL Then
LL = L;
if MarketPosition == 0 and entry == 1 and entry < 거래횟수 Then
{
if E1 == 0 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2 Then
{
E1 = 1;
H1 = H;
i1 = index;
}
if E1 == 1 and index > i1 then
{
if H > H1 Then
H1 = H;
}
#저가가 시작봉종가보다 클때만 눌림체크
if L >= V1 and L <= H1-PriceScale*진입눌림2 Then
{
E1 = 2;
i1 = index;
S1 = H1;
}
}
//시작점 종가보다 낮은 가격이 발생하면 초기화
if E1 >= 1 and L < V1 Then
{
E1 = 0;
LL = L;
}
if E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파2 and Tcond == true Then
{
buy("b2");
}
if MarketPosition == 0 and entry >= 2 and entry < 거래횟수 Then
{
if E1 == 0 and C >= LL+PriceScale*B3 and C[1] < LL+PriceScale*B3 Then
{
E1 = 1;
H1 = H;
i1 = index;
}
if E1 == 1 and index > i1 then
{
if H > H1 Then
H1 = H;
#저가가 시작봉종가보다 클때만 눌림체크
if L >= V1 and L <= H1-PriceScale*진입눌림3 Then
{
E1 = 2;
i1 = index;
S1 = H1;
}
}
if E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파3 and Tcond == true Then
{
buy("b3");
}
}
}
**************************************************************************************
input : 진입시간(090000),진입제한시간(151500);
input : 거래횟수(20);
input : d1(40),진입눌림1(10),진입돌파1(10);
input : d2(40),진입눌림2(10),진입돌파2(10);
input : d3(40),진입눌림3(10),진입돌파3(10);
var : T1(0),entry(0),HH(0),LL(0),EH(0),EL(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then{
T1 = TotalTrades;
E1 = 0;
HH = H;
}
if stime >= 진입시간 then
{
if H > HH Then
HH = H;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 Then
{
if E1 == 0 and C <= HH-PriceScale*d1 and C[1] < HH-PriceScale*d1 Then
{
E1 = 1;
L1 = L;
i1 = index;
V1 = HH; //시작점 종가
}
if E1 == 1 and index > i1 then
{
if L < L1 Then
L1 = L;
#고가가 시작봉종가보다 작을 때만 눌림체크
if H <= V1 and H >= L1+PriceScale*진입눌림1 Then
{
E1 = 2;
i1 = index;
S1 = L1;
}
}
//시작점 종가보다 높은 가격이 발생하면 초기화
if E1 >= 1 and H > V1 Then
{
E1 = 0;
HH = H;
}
if E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파1 and Tcond == true Then
{
sell("d1");
}
}
if TotalTrades > TotalTrades[1] Then
{
E1 = 0;
HH = H;
}
if H > HH Then
HH = H;
if MarketPosition == 0 and entry == 1 and entry < 거래횟수 Then
{
if E1 == 0 and C <= HH-PriceScale*d2 and C[1] < HH-PriceScale*d2 Then
{
E1 = 1;
L1 = L;
i1 = index;
}
if E1 == 1 and index > i1 then
{
if L < L1 Then
L1 = L;
if H >= L1+PriceScale*진입눌림2 Then
{
E1 = 2;
i1 = index;
S1 = L1;
}
}
if E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파2 and Tcond == true Then
{
sell("d2");
E1 = 0;
}
}
if MarketPosition == 0 and entry >= 2 and entry < 거래횟수 Then
{
if E1 == 0 and C <= HH-PriceScale*d3 and C[1] < HH-PriceScale*d3 Then
{
E1 = 1;
L1 = L;
i1 = index;
}
if E1 == 1 and index > i1 then
{
if L < L1 Then
L1 = L;
if H >= L1+PriceScale*진입눌림3 Then
{
E1 = 2;
i1 = index;
S1 = L1;
}
}
if E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파3 and Tcond == true Then
{
sell("d3");
E1 = 0;
}
}
}
2021-02-10
843
글번호 146273
시스템
답변완료
수정좀 부탁합니다
안녕하세요
재차 질문을 드립니다
우선 아래식에서 반복적으로 같은 문구를 많이 사용한듯 합니다
온전이 제가 만들것이 아니라서요 정리좀 부탁합니다
식의 면화를 주지 마시고요
질문은 매도의 경우만 하겠습니다
매수도 같은 답변부탁드립니다
질문1
아래 식을 보시면
매도은 이전조건1(1) 최고점과 현재조건1 최고점과 비교해서 같거나 낮으면 매도를
하겠금 한 식입니다
식에서 보시면 같은 부분의 기호가 빠진들 합니다
확인좀 해주세요
같은 식의 이미지는 아니지만 참고 이미지를 보시면 알듯 합니다
질문2
장 시작하면 첫번째 두번째 신호에 한해서만 조건1 이 같거나 낮거나가 아닌 조건1에 해당하면 바로 신호를 나오게 부탁합니다
세번째 네번째 에서는 아래 식대로 사용할 생각입니다
매도1 매도2 이런식으로 만들어야 하지 않나 생각이 들어요
질문3
식에서 보시면 (참고 이미지 꼭 참고 해주세요)
매수신호 나오고 직전 저점이 손절가 입니다
이 식이 틀린것은 아니지만
제가 원하는 식은
매수신호 진입하고 조건2가 나올때 마다 저점이 높아지면 손절가 역시 조건2 의 저점이 올라간만큼 손절가 역시 올라갔으면 합니다
참고로 전 매수청산색상을 사용합니다
그리고 이미지에서 빨간색 점선을 보시면 이해할듯 합니다
두번째 질문이라서 좀 자세히 적었는데 이해가 될지 모르겠네요
글이라서 좀 힘드네요
감사합니다
var : T(0),L1(0),L2(0),H1(0),H2(0);
var : T1(0),T2(0),T3(0),T4(0),T5(0),T6(0),T7(0),T8(0);
var : T11(0),T22(0),T33(0),T44(0),T55(0),T66(0),T77(0),T88(0);
var : BL1(0),SH1(0),TL(0),TX1(0);
var1 = ma(C,10);
--------------------------------------------------- 조건 1 아래로
if T <= 0 and
dayindex > 0
and countif(C<O or (C==O),2) == 2
Then
-----------------------------------------------------조건 1 위로
{
T = 1;
L1 = l;
L2 = L1[1];
if H1 < H2 and H2 > 0 Then
Sell("매도");
}
-------------------------------------------------------------- 조건 2 아래로
if T >= 0 and
dayindex > 0
and countif(C>O or (C==O),2) == 2
Then
--------------------------------------------------------------- 조건 2 위로
{
T = -1;
H1 = H;
H2 = H1[1];
if L1 > L2 and L2 > 0 Then
buy("매수");
}
if T == 1 Then
{
if L < L1 Then
L1 = L;
}
if T == -1 Then
{
if H > H1 Then
H1 = H;
}
if MarketPosition == 1 Then
{
if MarketPosition(0)[1] != 1 then
{
BL1 = L1[BarsSinceEntry]-PriceScale;
}
ExitLong("손절 ",AtStop,BL1);
}
if MarketPosition == -1 then
{
if MarketPosition != MarketPosition[1] Then
{
SH1 = H1[BarsSinceEntry]+PriceScale;
}
ExitShort("손절",AtStop,SH1);
}
if MarketPosition == 1 Then{
if Condition11 == false and H >= EntryPrice+PriceScale*30 Then{
Condition11 = true;
T1 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T1, 255);
Text_SetStyle(T1,2,1);
}
if Condition12 == false and H >= EntryPrice+PriceScale*60 Then{
Condition12 = true;
T2 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T2, 14483711);
Text_SetStyle(T2,2,1);
}
if Condition13 == false and H >= EntryPrice+PriceScale*90 Then{
Condition13 = true;
T3 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T3, 58623);
Text_SetStyle(T3,2,1);
}
if Condition14 == false and H >= EntryPrice+PriceScale*120 Then{
Condition14 = true;
T4 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T4, 4114503);
Text_SetStyle(T4,2,1);
}
if Condition15 == false and H >= EntryPrice+PriceScale*150 Then{
Condition15 = true;
T5 = Text_New(sdate,stime,H," ♥");
Text_SetColor(T5, 16711681);
Text_SetStyle(T5,2,1);
}
}
Else
{
Condition11 = false;
Condition12 = false;
Condition13 = false;
Condition14 = false;
Condition15 = false;
Condition16 = false;
Condition17 = false;
Condition18 = false;
}
if MarketPosition == -1 Then{
if Condition21 == false and L <= EntryPrice-PriceScale*30 Then{
Condition21 = true;
T11 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T11, 255);
Text_SetStyle(T11,2,3);
}
if Condition22 == false and L <= EntryPrice-PriceScale*60 Then{
Condition22 = true;
T22 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T22, 14483711);
Text_SetStyle(T22,2,3);
}
if Condition23 == false and L <= EntryPrice-PriceScale*90 Then{
Condition23 = true;
T33 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T33, 58623);
Text_SetStyle(T33,2,3);
}
if Condition24 == false and L <= EntryPrice-PriceScale*120 Then{
Condition24 = true;
T44 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T44, 4114503);
Text_SetStyle(T44,2,3);
}
if Condition25 == false and L <= EntryPrice-PriceScale*150 Then{
Condition25 = true;
T55 = Text_New(sdate,stime,L," ♥");
Text_SetColor(T55, 16711681);
Text_SetStyle(T55,2,3);
}
}
Else
{
Condition21 = false;
Condition22 = false;
Condition23 = false;
Condition24 = false;
Condition25 = false;
Condition26 = false;
Condition27 = false;
Condition28 = false;
}
2021-02-10
720
글번호 146246
시스템