예스스탁
예스스탁 답변
2023-04-24 14:52:22
안녕하세요
예스스탁입니다.
input : n(3);
input : Length(14),Period(20);
var : TR(0),DMPlus(0),DMMinus(0),SDMPlus1(0),Str1(0);
var : STR(0),SDMPlus(0),SDMMinus(0),SDMMinus1(0);
var : ADXv(0),cnt(0);
var : DIPMA(0), DIMMA(0);
var :d1(0),idx(0),tf(0);
var : oo(0),hh(0),ll(0),cc(0);
var : xClose(0),xOpen(0),xHigh(0),xLow(0);
var : xClose1(0),xOpen1(0),xHigh1(0),xLow1(0);
var : sum(0),sum1(0),sum2(0),CSum1(0),CSum2(0);
Array :DIP[100](-1),DIM[100](-1),DX[100](-1);
if Bdate != Bdate[1] or Index == 0 Then
{
D1 = sdate;
idx = 0;
}
Else
idx = idx+1;
if D1 > 0 Then
{
TF = idx%n;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) or Index == 0 Then
{
oo = o;
hh = h;
ll = l;
value1 = value1+1;
For cnt = 99 DownTo 1
{
DIP[cnt] = DIP[cnt-1];
DIM[cnt] = DIM[cnt-1];
DX[cnt] = DX[cnt-1];
}
xopen1 = xopen;
xclose1 = xclose;
xhigh1 = xhigh;
xlow1 = xlow;
SDMPlus1 = SDMPlus[1];
SDMMinus1 = SDMMinus[1];
STR1 = STR[1];
}
if hh > 0 and h > hh Then
hh = h;
if ll > 0 and l < ll Then
ll = l;
cc = c;
if value1 == 1 then
{
xOpen = oo;
xClose = (oo+hh+ll+cc)/4;
xHigh = MaxList(hh, xOpen, xClose);
xLow = MinList(ll, xOpen,xClose);
}
if value1 > 1 then
{
xClose = (oo+hh+ll+cc)/4;
xOpen = (xOpen1 + xClose1)/2 ;
xHigh = MaxList(hh, xOpen, xClose) ;
xLow = MinList(ll, xOpen, xClose) ;
}
if xclose1 > 0 Then
{
TR = max(max(xhigh-xlow, abs(xhigh-xclose1)), abs(xlow-xclose1));
DMPlus = iff(xhigh-xhigh1 > xlow1-xlow , max(xhigh-xhigh1, 0) , 0);
DMMinus = iff(xlow1-xlow > xhigh-xhigh1 , max(xlow1-xlow, 0) , 0);
STR = STR1 - (STR1/Length) + TR;
SDMPlus = SDMPlus1 - (SDMPlus1/Length) + DMPlus;
SDMMinus = SDMMinus1 - (SDMMinus1/Length) + DMMinus;
DIP[0] = SDMPlus / STR * 100;
DIM[0] = SDMMinus / STR * 100;
DX[0] = abs(DIP[0] - DIM[0]) / (DIP[0] + DIM[0])*100;
if DX[Length-1] >= 0 Then
{
sum = 0;
For cnt = 0 to Length-1
{
sum = sum + DX[cnt];
}
ADXv = sum/Length;
plot1(ADXv,"ADX",White);
}
plot2(DIP[0],"+DI",magenta);
plot3(DIM[0],"-DI",Lime);
if DIP[Period-1] >= 0 and DIM[Period-1] >= 0 Then
{
sum1 = 0;
CSum1 = 0;
sum2 = 0;
CSum2 = 0;
For cnt = 0 To Period - 1
{
Sum1 = Sum1 + DIP[cnt] * (Period - cnt);
CSum1 = CSum1 + Period - cnt;
Sum2 = Sum2 + DIM[cnt] * (Period - cnt);
CSum2 = CSum2 + Period - cnt;
}
DIPMA = sum1/CSum1;
DIMMA = sum2/CSum2;
plot4(DIPMA,"DIPMA",Cyan);
plot5(DIMMA,"DIMMA",Red);
}
PlotBaseLine1(30,"30",Gold);
PlotBaseLine2(20,"20",Gold);
PlotBaseLine3(10,"10",Gold);
}
}
즐거운 하루되세요
> 당일선물 님이 쓴 글입니다.
> 제목 : 타주기분 지표식 부탁드립니다.
> 수고하십니다.
아래지표식을 타주기분(N배) 로 변환부탁드립니다.
//===============
var : xClose(0),xOpen(0),xHigh(0),xLow(0);
if index == 0 then
{
xOpen = open;
xClose = (O+H+L+C)/4;
xHigh = MaxList( high, xOpen, xClose);
xLow = MinList( low, xOpen,xClose);
}
else
{
xClose = (O+H+L+C)/4;
xOpen = (xOpen [1] + xClose [1])/2 ;
xHigh = MaxList(High, xOpen, xClose) ;
xLow = MinList(Low, xOpen, xClose) ;
}
##
input : Length(14),Period(20);
var : TR(0),DMPlus(0),DMMinus(0);
var : STR(0),SDMPlus(0),SDMMinus(0);
var : DIP(0),DIM(0),DX(0),ADXv(0);
var : DIPMA(0), DIMMA(0);
TR = max(max(xhigh-xlow, abs(xhigh-xclose[1])), abs(xlow-xclose[1]));
DMPlus = iff(xhigh-xhigh[1] > xlow[1]-xlow , max(xhigh-xhigh[1], 0) , 0);
DMMinus = iff(xlow[1]-xlow > xhigh-xhigh[1] , max(xlow[1]-xlow, 0) , 0);
STR = STR - (STR/Length) + TR;
SDMPlus = SDMPlus - (SDMPlus/Length) + DMPlus;
SDMMinus = SDMMinus - (SDMMinus/Length) + DMMinus;
DIP = SDMPlus / STR * 100;
DIM = SDMMinus / STR * 100;
DX = abs(DIP - DIM) / (DIP + DIM)*100;
ADXv = ma(DX, Length);
DIPMA = WMa(DIP,Period);
DIMMA = WMa(DIM,Period);
###
plot1(ADXv,"ADX",White);
plot2(DIP,"+DI",magenta);
plot3(DIM,"-DI",Lime);
plot4(DIPMA,"DIPMA",Cyan);
plot5(DIMMA,"DIMMA",Red);
PlotBaseLine1(30,"30",Gold);
PlotBaseLine2(20,"20",Gold);
PlotBaseLine3(10,"10",Gold);
//===========
감사합니다