커뮤니티
지표문의
2017-06-15 13:32:56
149
글번호 110449
관리자님...수고하시고...감사합니다.^^
지표문의 질문번호 53639 에 이어서 다시 한번 부탁 드립니다.
아래 전략을 인디게이트로 전환해 주셨으면 감사하겠습니다...
Input : Period(20);
Var : value(0);
value = ma(bids,period)-ma(asks,period);
if date != date[1] Then{
value1 = value;
value2 = value;
}
if value > value1 Then
value1 = value;
if value < value2 Then
value2 = value;
If value > value[1] Then
var1=(value);
Else
var1=(value);
Var11=(value1); # ,"당일최고");
Var12=(value1-1000); # ,"당일최고", BLUE,def,1);
var22=(value2); # ,"당일최저");
Var13=(value2+1000); # ,"당일최저", RED,def,1);
value10=(0); # ,"기준선");
value12=(1500); # ,"2800", RED,def,0.5);
value13=(-1500); # ,"-2800", BLACK,def,0.5);
#=== 매수진입, 매수청산, 매수손절매 ==================/*==========*/=============#
#============ 매수====1==========================================================#
if stime>090000 and stime<152000 and CrossUp(var1, Var13) Then
Buy("B1", atlimit, c-PriceScale*1);
SetStopEndofday(152000);
#============ 매수청산 ==========================================================#
If marketposition==1 Then exitlong("매수수익청산1",Atlimit,entryprice+0.8);
SetStopLoss(0.5,PointStop);
#============ 매수====2==========================================================#
if stime>090000 and stime<123000 and CrossUp(value, value12) Then
Buy("B2", atlimit, c-PriceScale*1);
#============ 매수청산2 =========================================================#
If marketposition==1 Then exitlong("매수수익청산2",Atlimit,entryprice+0.8);
SetStopLoss(0.5,PointStop);
SetStopEndofday(152000);
#=== 매도진입, 매도청산, 매도손절매 ===================/*==========*/============#
#============ 매도1==============================================================#
if stime>090000 and stime<152000 and CrossDown(var1,Var12) Then
Sell("S1",Atlimit,c+PriceScale*1);
#============ 매도청산1 =========================================================#
If marketposition==-1 Then exitshort("매도수익청산1",Atlimit,entryprice-0.8);
SetStopLoss(0.5,PointStop);
#============ 매도2==============================================================#
if stime>090000 and stime<123000 and CrossDown(value,value13) Then
Sell("S2",Atlimit,c+PriceScale*1);
#============ 매도청산2 =========================================================#
If marketposition==-1 Then exitshort("매도수익청산2",Atlimit,entryprice-0.8);
SetStopLoss(0.5,PointStop);
SetStopEndofday(152000);
먼저 감사 인사드립니다.^^
답변 1
예스스탁 예스스탁 답변
2017-06-15 14:17:36
안녕하세요
예스스탁입니다.
Input : Period(20);
Var : value(0),Tcond(False),pst(0),EP(0);
value = ma(bids,period)-ma(asks,period);
if Bdate != Bdate[1] Then{
Tcond = true;
value1 = value;
value2 = value;
}
if stime == 152000 or (stime > 152000 and stime[1] < 152000) Then{
Tcond = false;
pst = 0;
}
if value > value1 Then
value1 = value;
if value < value2 Then
value2 = value;
If value > value[1] Then
var1=(value);
Else
var1=(value);
Var11=(value1); # ,"당일최고");
Var12=(value1-1000); # ,"당일최고", BLUE,def,1);
var22=(value2); # ,"당일최저");
Var13=(value2+1000); # ,"당일최저", RED,def,1);
value10=(0); # ,"기준선");
value12=(1500); # ,"2800", RED,def,0.5);
value13=(-1500); # ,"-2800", BLACK,def,0.5);
if Tcond == true Then{
if pst <= 0 and L <= C[1]-PriceScale*1 and crossup(var1[1],var13[1]) Then{
pst = 1;
if O <= C[1]-PriceScale*1 Then
EP = O;
Else
EP = C[1]-PriceScale*1;
}
if pst <= 0 and L <= C[1]-PriceScale*1 and crossup(value[1],value12[1]) Then{
pst = 1;
if O <= C[1]-PriceScale*1 Then
EP = O;
Else
EP = C[1]-PriceScale*1;
}
if pst >= 0 and H >= C[1]+PriceScale*1 and CrossDown(var1[1],var12[1]) Then{
pst = -1;
if O >= C[1]+PriceScale*1 Then
EP = O;
Else
EP = C[1]+PriceScale*1;
}
if pst <= 0 and H >= C[1]+PriceScale*1 and CrossDown(value[1],value13[1]) Then{
pst = -1;
if O >= C[1]+PriceScale*1 Then
EP = O;
Else
EP = C[1]+PriceScale*1;
}
if pst == 1 and (L <= EP-0.5 or H >= EP+0.8) Then
pst = 0;
if pst == -1 and (H >= EP+0.5 or L <= EP-0.8) Then
pst = 0;
}
if pst == 1 then{
plot1(99999999999,"지표1");
plot2(0,"지표2");
}
if pst == -1 then{
plot1(0,"지표1");
plot2(99999999999,"지표2");
}
if pst == 0 then{
plot1(0,"지표1");
plot2(0,"지표2");
}
즐거운 하루되세요
> song1212 님이 쓴 글입니다.
> 제목 : 지표문의
> 관리자님...수고하시고...감사합니다.^^
지표문의 질문번호 53639 에 이어서 다시 한번 부탁 드립니다.
아래 전략을 인디게이트로 전환해 주셨으면 감사하겠습니다...
Input : Period(20);
Var : value(0);
value = ma(bids,period)-ma(asks,period);
if date != date[1] Then{
value1 = value;
value2 = value;
}
if value > value1 Then
value1 = value;
if value < value2 Then
value2 = value;
If value > value[1] Then
var1=(value);
Else
var1=(value);
Var11=(value1); # ,"당일최고");
Var12=(value1-1000); # ,"당일최고", BLUE,def,1);
var22=(value2); # ,"당일최저");
Var13=(value2+1000); # ,"당일최저", RED,def,1);
value10=(0); # ,"기준선");
value12=(1500); # ,"2800", RED,def,0.5);
value13=(-1500); # ,"-2800", BLACK,def,0.5);
#=== 매수진입, 매수청산, 매수손절매 ==================/*==========*/=============#
#============ 매수====1==========================================================#
if stime>090000 and stime<152000 and CrossUp(var1, Var13) Then
Buy("B1", atlimit, c-PriceScale*1);
SetStopEndofday(152000);
#============ 매수청산 ==========================================================#
If marketposition==1 Then exitlong("매수수익청산1",Atlimit,entryprice+0.8);
SetStopLoss(0.5,PointStop);
#============ 매수====2==========================================================#
if stime>090000 and stime<123000 and CrossUp(value, value12) Then
Buy("B2", atlimit, c-PriceScale*1);
#============ 매수청산2 =========================================================#
If marketposition==1 Then exitlong("매수수익청산2",Atlimit,entryprice+0.8);
SetStopLoss(0.5,PointStop);
SetStopEndofday(152000);
#=== 매도진입, 매도청산, 매도손절매 ===================/*==========*/============#
#============ 매도1==============================================================#
if stime>090000 and stime<152000 and CrossDown(var1,Var12) Then
Sell("S1",Atlimit,c+PriceScale*1);
#============ 매도청산1 =========================================================#
If marketposition==-1 Then exitshort("매도수익청산1",Atlimit,entryprice-0.8);
SetStopLoss(0.5,PointStop);
#============ 매도2==============================================================#
if stime>090000 and stime<123000 and CrossDown(value,value13) Then
Sell("S2",Atlimit,c+PriceScale*1);
#============ 매도청산2 =========================================================#
If marketposition==-1 Then exitshort("매도수익청산2",Atlimit,entryprice-0.8);
SetStopLoss(0.5,PointStop);
SetStopEndofday(152000);
먼저 감사 인사드립니다.^^