예스스탁
예스스탁 답변
2025-02-18 15:13:08
안녕하세요
예스스탁입니다.
input : wPeriod(20),wDv(2);
input : mPeriod(12),mDv(2);
Input : 중심1색상(Black),중심1색하(darkyellow), 상단1색상(Black),상단1색하(darkyellow), 하단1색상(Black),하단1색하(darkyellow);
var : wcnt(0),wsum(0),wSumSqrt(0);
var : wStdv(0),wBBmd(0),wBBup(0),wBBdn(0);
Array : weekC[100](0);
var : mcnt(0),msum(0),mSumSqrt(0);
var : mStdv(0),mBBmd(0),mBBup(0),mBBdn(0);
Array : monthC[100](0);
if dayofweek(bdate) < dayofweek(bdate[1]) Then
{
for wcnt = 99 downto 1
{
weekC[wcnt] = weekC[wcnt-1];
}
}
weekC[0] = C;
If weekC[wPeriod] != 0 Then
{
wsum = 0;
for wcnt = 0 to wPeriod-1
{
wsum = wsum+weekC[wcnt];
}
wBBmd = wsum/wPeriod;
wSumSqrt = 0;
For wcnt = 0 To wPeriod - 1
{
wSumSqrt = wSumSqrt + (weekC[wcnt] - wBBmd)^2;
}
wStdv = SquareRoot(wSumSqrt / wPeriod);
wBBup = wBBmd + (wDv * wStdv);
wBBdn = wBBmd - (wDv * wStdv);
Plot1(wBBmd, "중심선추세",IFf(wBBmd>=wBBmd[1],중심1색상,중심1색하));
Plot2(wBBup, "상단선추세",IFf(wBBup>=wBBup[1],상단1색상,상단1색하));
Plot3(wBBdn, "하단선추세",IFf(wBBdn>=wBBdn[1],하단1색상,하단1색하));
}
if bdate > bdate[1]+30 Then
{
for mcnt = 99 downto 1
{
monthC[mcnt] = monthC[mcnt-1];
}
}
monthC[0] = C;
If monthC[mPeriod] != 0 Then
{
msum = 0;
for mcnt = 0 to mPeriod-1
{
msum = msum+monthC[mcnt];
}
mBBmd = msum/mPeriod;
mSumSqrt = 0;
For mcnt = 0 To mPeriod - 1
{
mSumSqrt = mSumSqrt + (monthC[mcnt] - mBBmd)^2;
}
mStdv = SquareRoot(mSumSqrt / mPeriod);
mBBup = mBBmd + (mDv * mStdv);
mBBdn = mBBmd - (mDv * mStdv);
Plot4(mBBmd, "중심선추세",IFf(mBBmd>=mBBmd[1],중심1색상,중심1색하));
Plot5(mBBup, "상단선추세",IFf(mBBup>=mBBup[1],상단1색상,상단1색하));
Plot6(mBBdn, "하단선추세",IFf(mBBdn>=mBBdn[1],하단1색상,하단1색하));
}
즐거운 하루되세요
> 해피오 님이 쓴 글입니다.
> 제목 : 수식문의입니다
>
Input : Period1(20), D1(2);
var : MAv1(0),BBup1(0),BBdn1(0);
Input : 중심1색상(Black),중심1색하(darkyellow), 상단1색상(Black),상단1색하(darkyellow), 하단1색상(Black),하단1색하(darkyellow);
MAv1 = ema(C,Period1);
BBup1 = BollBandUp(Period1,D1);
BBdn1 = BollBandDown(Period1,D1);
Plot1(MAv1, "중심선추세",IFf(MAv1>=MAv1[1],중심1색상,중심1색하));
Plot2(BBup1, "상단선추세",IFf(BBup1>=BBup1[1],상단1색상,상단1색하));
Plot3(BBdn1, "하단선추세",IFf(BBdn1>=BBdn1[1],하단1색상,하단1색하));
위와 같은 구성으로 주봉상의 볼밴선(20/2)과 월봉상의 볼밴선(12/2)을
일봉상 차트에 표시되게 할수 있는 수식을 부탁드립니다.