답변완료
화면바턍색 조건설정
항상 감사드립니다
아래조건식을 이용해서 화면 바탕에 강조를 표현하고 싶습니다
1.엔벨로프 삼각가중 중심선이 그물망 var11을 상향돌파시 화면바탕색 분홍색
2.엔벨로프 삼각가중 중심선이 그물망 var11을 하향돌파시 화면바탕색 하늘색
***앤밸로프 삼각가중**********
Input : Period(20), Percent(0.2);
var : TLen(0),center(0),UPline(0),DNline(0);
TLen = Ceiling((Period + 1) * .5);
center = ma(ma(C, TLen), TLen);
UPline = center*(1+Percent/100);
Dnline = center*(1-Percent/100);
Plot1(center, "중앙선");
Plot2(UPline, "EnvelopeUp");
Plot3(Dnline, "EnvelopeDown");
*****그물망챠트 ****
input:period(20),횡보율(0.001);
var11=ema(c,period+10);
if var11>var11[1]*(1+횡보율/100) then plot11(var11,"이동평균11",red,def,3); else if var11<var11[1]*(1-횡보율/100) then plot11 (var11,"이동평균11",blue,def,3); else plot11 (var11,"이동평균11",cyan,def,3);
2021-11-02
669
글번호 153306
강조
답변완료
문의 드립니다.
항상 감사드립니다.
응용을 해보고 있는데요.
아래 수식에 문제점이 있는 거 같습니다.
확인 및 수정 부탁드립니다.
input : n1(10),n2(30);
input : StartTime(223000),EndTime(235000);
input : 익절틱수(80),손절틱수(0);
var : Tcond(false);
Array : H1[50](0),L1[50](0),H2[50](0),L2[50](0);
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;
if Tcond == true Then
{
#봉완성 매수
if C > H1[n1]+PriceScale*1 and C > H2[n2]+PriceScale*1 and C > O Then
Buy("b");
#봉완성 매도
if C < L1[N1]-PriceScale*1 and C < L2[N2]-PriceScale*1 and C < O Then
Sell("s");
#즉시 매수
if NextBarOpen <= H1[n1] and NextBarOpen <= H2[n2] Then
Buy("b1",AtStop,H1[n1]+PriceScale*1 and H2[n2]+PriceScale*1);
#즉시 매도
if NextBarOpen >= L1[n1] and NextBarOpen >= L2[n2] Then
Sell("s1",AtStop,L1[n1]-PriceScale*1 and L2[n2]-PriceScale*1);
#매수진입 후 매수봉의 저가보다 1틱이상 낮은 시세 발생하면 청산
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1);
#매도진입 후 매도봉의 고가보다 1틱이상 높은 시세 발생하면 청산
if MarketPosition == -1 Then
ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1);
#매수진입 후 매수봉의 다음봉의 저가보다 1틱이상 낮은 시세 발생하면 청산
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L-PriceScale*1);
#매도진입 후 매도봉의 다음봉의 고가보다 1틱이상 높은 시세 발생하면 청산
if MarketPosition == -1 Then
ExitShort("sx",AtStop,H+PriceScale*1);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-11-01
915
글번호 153297
시스템
답변완료
문의 드립니다.
지난번에 수식 검증을 한번 받은 것인데, 오늘 잘못되어 나오는 부분이 있어
다시 한번 확인 부탁드립니다.
# 15분 시작에 매수 신호가 나왔어도, 매수는 양봉에만 진입하는 것이므로 18분봉에 진입하지 않아야 하는데 진입되었습니다.
혹시 거래시간을 101200으로 해서 그런건지요?
조건이 만족할 시 매수는 양봉에만, 매도는 음봉에만 진입하는 것이 적용된 것인지요?
수식에 주석 달아 주시면 좋겠습니다.
# 추가로
종가에 매수 매도 신호가 나오고 다음 봉에서 진입할 때에 진입가격을 재 돌파할 시 매수 매도 들어가게 하는 수식에 대해 별도로 주시면 좋겠습니다.
--- 아래에 해당 수식과 거래된 파일 자료 남겨드립니다.
감사합니다~~
input : StartTime(101200),EndTime(114000);
input : Length(20), D1(2);
input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(2);
var : Tcond(false),profit(0),loss(0);
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;
profit = 0;
loss = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("bp1.",1) or IsExitName("bp2.",21) or IsExitName("bp1",1) or IsExitName("bp2",21) or
IsExitName("sp1.",1) or IsExitName("sp2.",1) or IsExitName("sp1",1) or IsExitName("sp2",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl1.",1) or IsExitName("bl2.",1) or IsExitName("bl1",1) or IsExitName("bl2",1) or
IsExitName("sl1.",1) or IsExitName("sl2.",1) or IsExitName("sl1",1) or IsExitName("sl2",1) Then
loss = loss+1;
Else
loss = 0;
}
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and (c > o or (C==O and C >= C[1])) and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Buy("b",OnClose,DEF,1);
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1.",AtLimit,C+PriceScale*익절1,"",1,1);
ExitLong("bl1.",AtStop,C-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2.",AtLimit,C+PriceScale*익절2,"",1,1);
ExitLong("bl2.",AtStop,C-PriceScale*손절2,"",1,1);
}
}
If CrossDown(L,Var2) and (C < O or (C==O and C < C[1])) and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1.",AtLimit,C-PriceScale*익절1,"",1,1);
ExitShort("sl1.",AtStop,C+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2.",AtLimit,C-PriceScale*익절2,"",1,1);
ExitShort("sl2.",AtStop,C+PriceScale*손절2,"",1,1);
}
}
}
if MarketPosition == 1 Then
{
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*익절1,"",1,1);
ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*익절2,"",1,1);
ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2,"",1,1);
}
}
if MarketPosition == -1 Then
{
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절1,"",1,1);
ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*익절2,"",1,1);
ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2,"",1,1);
}
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-11-01
663
글번호 153295
시스템
답변완료
수식 문의
안녕하세요.
아래와 같은 수식을 문의드리고 싶습니다.
-----------------------------------
n일전, 분봉에서, 마지막 종가에 해당하는
볼린저 밴드 상단선
볼린저 밴드 하단선 가격을
n-1일의 분봉에 고정시켜 횡선으로 긋고 싶습니다.
또한,
n-2일의 분봉
n-3일의 분봉
n-4일의 분봉
n-5일의 분봉
n-6일의 분봉
n-7일의 분봉
n-8일의 분봉
n-9일의 분봉
n-10일의 분봉에도
n일의 가격을 횡선으로 표현하고 싶습니다.
----------------------------
항상 친절한 답변 감사드립니다.
위와 비슷한 형태의 수식을 도움 받은바 있는데
실력이 미천하여 변용하지 못하겠어 다시 문의 드립니다.
참고 하시기 바랍니다.
-------참고----------
## n봉기간 동안 늘려라
if bdate != bdate[1] Then
{
idx = 0;
value[0] = 0;
for cnt = 1 to 19
{
value[cnt] = value[cnt-1][1];
}
}
idx = idx+1;
## 시간대 설정
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) then
{
Tcond = true;
Condition1 = false;
}
if (sdate != sdate[1] and stime >= 040000) or
(sdate == sdate[1] and stime >= 040000 and stime[1] < 040000) then
{
Tcond = False;
}
## 골드 & 데드
if Tcond == true Then
{
if crossup(c,x1) or CrossDown(c,y1) Then
{
Condition1 = true;
var1 = x1;
}
if Condition1 == true Then
value[0] = var1;
Else
value[0] = x1;
}
if idx <= n then
{
if value[1] > 0 Then
plot1(value[1],"1");
if value[2] > 0 Then
plot2(value[2],"2",iff(value[2] > dayopen,RGB(255,216,216),RGB(217,229,255)));
if value[3] > 0 Then
plot3(value[3],"3",iff(value[3] > dayopen,RGB(255,167,167),RGB(178,204,255)));
if value[4] > 0 Then
plot4(value[4],"4",iff(value[4] > dayopen,RGB(241,95,095),RGB(103,153,255)));
if value[5] > 0 Then
plot5(value[5],"5",iff(value[5] > dayopen,RGB(204,061,061),RGB(67,116,217)));
if value[6] > 0 then
plot6(value[6],"6",iff(value[6] > dayopen,RGB(152,000,000),RGB(0,51,153)));
if value[7] > 0 Then
plot7(value[7],"7",iff(value[7] > dayopen,RGB(152,000,000),RGB(0,51,153)));
if value[8] > 0 Then
plot8(value[8],"8",iff(value[8] > dayopen,RGB(152,000,000),RGB(0,51,153)));
if value[9] > 0 Then
plot9(value[9],"9",iff(value[9] > dayopen,RGB(152,000,000),RGB(0,51,153)));
if value[10] > 0 Then
plot10(value[10],"10",iff(value[10] > dayopen,RGB(152,000,000),RGB(0,51,153)));
}
2021-11-02
851
글번호 153293
지표