예스스탁
예스스탁 답변
2020-02-17 18:53:50
안녕하세요
예스스탁입니다.
1분에서 5분,10분과 10분에서 30분,60분의 수식은 같습니다.
외부변수에서 타분봉 주기만 변경하시면 됩니다.
1
Input : ntime1(5),ntime2(10);
var : cnt(0),S1(0),D1(0),TM(0),TF1(0),TF2(0);
Array : C1[10](0),O1[10](0);
Array : C2[10](0),O2[10](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TimeToMinutes(stime)%ntime1;
TF2 = TimeToMinutes(stime)%ntime2;
if Bdate != Bdate[1] or
(bdate == bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or
(bdate == bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or
(bdate == bdate[1] and ntime1 == 1 and TM > TM[1]) Then{
O1[0] = O;
for cnt = 1 to 99
{
O1[cnt] = O1[cnt-1][1];
C1[cnt] = C1[cnt-1][1];
}
}
C1[0] = C;
if Bdate != Bdate[1] or
(bdate == bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or
(bdate == bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or
(bdate == bdate[1] and ntime2 == 1 and TM > TM[1]) Then{
O2[0] = O;
for cnt = 1 to 99
{
O2[cnt] = O2[cnt-1][1];
C2[cnt] = C2[cnt-1][1];
}
}
C2[0] = C;
var1 = 0;
if C > O then
var1 = var1+1;
if C1[0] > O1[0] then
var1 = var1+1;
if C2[0] > O2[0] then
var1 = var1+1;
plot1(var1);
}
2
input : short(12),long(26),sig(9);
Input : ntime1(5),ntime2(10);
var : macdv(0),macds(0);
var : S1(0),D1(0),TM(0),EP1(0),EP2(0),EP3(0);
var : TF1(0),xma11(0),xma12(0),idx1(0),Prexma11(0),Prexma12(0),MACDV1(0),MACDS1(0),PreMACDS1(0);
var : TF2(0),xma21(0),xma22(0),idx2(0),Prexma21(0),Prexma22(0),MACDV2(0),MACDS2(0),PreMACDS2(0);
MACDV = MACD(short,long);
MACDs = ema(MACDv,sig);
Ep1 = 2/(short+1);
Ep2 = 2/(long+1);
Ep3 = 2/(sig+1);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%ntime1;
TF2 = TM%ntime2;
if Bdate != Bdate[1] or
(bdate == bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or
(bdate == bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or
(bdate == bdate[1] and ntime1 == 1 and TM > TM[1]) Then
{
idx1 = idx1 + 1;
Prexma11 = xma11[1];
Prexma12 = xma12[1];
PreMACDS1 = MACDS1[1];
}
if idx1 <= 1 then {
xma11 = C;
xma12 = C;
MACDV1 = xma11-xma12;
MACDS1 = MACDV1;
}
else{
xma11 = C * EP1 + Prexma11 * (1-EP1);
xma12 = C * EP2 + Prexma12 * (1-EP2);
MACDV1 = xma11-xma12;
MACDS1 = MACDV1 * EP3 + PreMACDS1 * (1-EP3);
}
if Bdate != Bdate[1] or
(bdate == bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or
(bdate == bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or
(bdate == bdate[1] and ntime2 == 1 and TM > TM[1]) Then
{
idx2 = idx2 + 1;
Prexma21 = xma21[1];
Prexma22 = xma22[1];
PreMACDS2 = MACDS2[1];
}
if idx2 <= 1 then {
xma21 = C;
xma22 = C;
MACDV2 = xma21-xma22;
MACDS2 = MACDV2;
}
else{
xma21 = C * EP1 + Prexma21 * (1-EP1);
xma22 = C * EP2 + Prexma22 * (1-EP2);
MACDV2 = xma21-xma22;
MACDS2 = MACDV2 * EP3 + PreMACDS2 * (1-EP3);
}
plot1(MACDV);
plot2(MACDS);
plot3(MACDV1);
plot4(MACDS1);
plot5(MACDV2);
plot6(MACDS2);
}
3
Input : ntime1(5),ntime2(10);
input : Length(14);
var : cnt(0),S1(0),D1(0),TM(0),TF1(0),TF2(0),RSIV(0);
var : SigSum1(0),RSIsig1(0),DownAmt1(0), UpAmt1(0), UpSum1(0), DownSum1(0), UpAvg1(0), DownAvg1(0);
var : idx1(0), PreUpAvg1(0), preDownAvg1(0),RSIV1(0);
var : SigSum2(0),RSIsig2(0),DownAmt2(0), UpAmt2(0), UpSum2(0), DownSum2(0), UpAvg2(0), DownAvg2(0);
var : idx2(0), PreUpAvg2(0), preDownAvg2(0),RSIV2(0);
Array : C1[100](0);
Array : C2[100](0);
RSIv = RSI(length);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TimeToMinutes(stime)%ntime1;
TF2 = TimeToMinutes(stime)%ntime2;
if Bdate != Bdate[1] or
(bdate == bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or
(bdate == bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or
(bdate == bdate[1] and ntime1 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
C1[cnt] = C1[cnt-1][1];
}
PreUpAvg1 = UpAvg1[1];
preDownAvg1 = DownAvg1[1];
idx1 = idx1 + 1;
}
C1[0] = C;
If idx1 == Length+2 Then {
UpSum1 = 0;
DownSum1 = 0;
For cnt = 0 To Length - 1 {
UpAmt1 = C1[cnt] - C1[cnt+1];
If UpAmt1 >= 0 Then
DownAmt1 = 0;
Else{
DownAmt1 = -UpAmt1;
UpAmt1 = 0;
}
UpSum1 = UpSum1 + UpAmt1;
DownSum1 = DownSum1 + DownAmt1;
}
UpAvg1 = UpSum1 / Length;
DownAvg1 = DownSum1 / Length;
}
If idx1 > Length+2 Then {
UpAmt1 = C1[0] - C1[1];
If UpAmt1 >= 0 Then
DownAmt1 = 0;
Else {
DownAmt1 = -UpAmt1;
UpAmt1 = 0;
}
UpAvg1 = (PreUpAvg1 * (Length - 1) + UpAmt1) / Length;
DownAvg1 = (preDownAvg1 * (Length - 1) + DownAmt1) / Length;
}
If UpAvg1 + DownAvg1 <> 0 Then
RSIv1 = 100 * UpAvg1 / (UpAvg1 + DownAvg1);
Else
RSIv1 = 0;
if Bdate != Bdate[1] or
(bdate == bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or
(bdate == bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or
(bdate == bdate[1] and ntime2 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
C2[cnt] = C2[cnt-1][1];
}
PreUpAvg2 = UpAvg2[1];
preDownAvg2 = DownAvg2[1];
idx2 = idx2 + 1;
}
C2[0] = C;
If idx2 == Length+2 Then {
UpSum2 = 0;
DownSum2 = 0;
For cnt = 0 To Length - 1 {
UpAmt2= C2[cnt] - C2[cnt+1];
If UpAmt2 >= 0 Then
DownAmt2 = 0;
Else{
DownAmt2 = -UpAmt2;
UpAmt2 = 0;
}
UpSum2 = UpSum2 + UpAmt2;
DownSum2 = DownSum2 + DownAmt2;
}
UpAvg2 = UpSum2 / Length;
DownAvg2 = DownSum2 / Length;
}
If idx2 > Length+2 Then {
UpAmt2 = C2[0] - C2[1];
If UpAmt2 >= 0 Then
DownAmt2 = 0;
Else {
DownAmt2 = -UpAmt2;
UpAmt2 = 0;
}
UpAvg2 = (PreUpAvg2 * (Length - 1) + UpAmt2) / Length;
DownAvg2 = (preDownAvg2 * (Length - 1) + DownAmt2) / Length;
}
If UpAvg2 + DownAvg2 <> 0 Then
RSIv2 = 100 * UpAvg2 / (UpAvg2 + DownAvg2);
Else
RSIv2 = 0;
plot1(RSIv);
plot2(RSIv1);
plot3(RSIv2);
}
즐거운 하루되세요
> 양치기 님이 쓴 글입니다.
> 제목 : 지표식 부탁드립니다.
> 항상 도움 주셔서 감사합니다.
아래 조건에 맞는 지표식 부탁드립니다.
종목 : 해선(오일)
타임 : 1분
요청 지표식1) : 1분차트에서 시간계산을 하여
1분차트, 5분차트,10분차트 모두 양봉이면 지표를 3으로 표시하고 싶습니다.
예) 1분차트 양봉이면 지표값에 1을 더하고,
5분차트 양봉이면 지표값에 1을 더하고,
10분차트 양봉이면 지표값에 1을 더함
즉, 1개봉이 양봉이면 1, 2개봉이 양봉이면 2, 3개 모두 양봉이면 지표값은 3임
종목 : 해선(오일)
타임 : 10분
요청 지표식2) : 10분차트에서 시간계산을 하여
10분차트, 30분차트,60분차트 모두 양봉이면 지표를 3으로 표시하고 싶습니다.
예) 10분차트 양봉이면 지표값에 1을 더하고,
30분차트 양봉이면 지표값에 1을 더하고,
60분차트 양봉이면 지표값에 1을 더함
즉, 1개봉이 양봉이면 1, 2개봉이 양봉이면 2, 3개 모두 양봉이면 지표값은 3임
종목 : 해선(오일)
타임 : 1분
지표 : MACD-기간:12,26
요청 지표식3) : 1분차트에서 시간계산을 하여
1분차트의 MACD, 5분차트의 MACD,10분차트의 MACD를 구하여
3개의 MACD 라인을 하나의 지표로 표시하고 싶습니다.
종목 : 해선(오일)
타임 : 10분
지표 : MACD-기간:12,26
요청 지표식4) : 10분차트에서 시간계산을 하여
10분차트의 MACD, 30분차트의 MACD,60분차트의 MACD를 구하여
3개의 MACD 라인을 하나의 지표로 표시하고 싶습니다.
종목 : 해선(오일)
타임 : 1분
지표 : RSI-기간:14
요청 지표식5) : 1분차트에서 시간계산을 하여
1분차트의 RSI, 5분차트의 RSI,10분차트의 RSI을 구하여
3개의 RSI 라인을 하나의 지표에 표시하고 싶습니다.
종목 : 해선(오일)
타임 : 10분
지표 : RSI-기간:14
요청 지표식6) : 10분차트에서 시간계산을 하여
10분차트의 RSI, 30분차트의 RSI,60분차트의 RSI을 구하여
3개의 RSI 라인을 하나의 지표에 표시하고 싶습니다.
수식 부탁드립니다.