예스스탁
예스스탁 답변
2023-01-13 10:44:25
안녕하세요
예스스탁입니다.
타주기가 어떤 주기인지 알수 없습니다.
타주기 분봉의 값을 계산하게 작성해 드립니다.
inputs : 분(10), ShortPeriod(38), LongPeriod(62), ATR_Period(30);
var : PreEmaSlow(0), PreEmaFast(0), FastEP(0), SlowEP(0), EmaFast(0), EmaSlow(0);
Var : S1(0),D1(0),TM(0),TF(0),cnt(0);
Var : LL(0), HH(0),idx(0);
Array : OO[99](0), CC[99](0), TrueR[99](0), CATR[99](0);
FastEP = 2 / (ShortPeriod+1);
SlowEp = 2 / (LongPeriod+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;
TF = TimeToMinutes(stime)%분;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 분 > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and 분 > 1 and TM >= TM[1]+분) or
(Bdate == Bdate[1] and 분 == 1 and TM > TM[1]) Then
{
idx = idx+1;
# 타주기 ATR 계산식
for cnt = 99 downto 1
{
CC[cnt] = CC[cnt-1];
TrueR[cnt] = TrueR[cnt-1];
CATR[cnt] = CATR[cnt-1];
}
LL = L;
HH = H;
PreEmaFast = EmaFast;
PreEmaSlow = EmaSlow;
}
CC[0] = C;
if LL > 0 and L < LL Then
LL = L;
if HH > 0 and H > HH Then
HH = H;
# 타주기 지수이동평균 계산식
if idx == 1 Then
{
EmaFast = C;
EmaSlow = C;
Condition1 = True;
}
if idx > 1 Then
{
EmaFast = (C*FastEP) + PreEmaFast * (1-FastEP);
EmaSlow = (C*SlowEp) + PreEmaSlow * (1-SlowEp);
}
# TrueRange 계산식
TrueR[0] = Max(HH,CC[1]) - Min(LL,CC[1]);
if TrueR[ATR_Period-1] > 0 Then
{
Var1 = 0;
For cnt = 0 to ATR_Period - 1
{
Var1 = Var1 + TrueR[cnt];
}
CATR[0] = Var1 / ATR_Period;
}
if Condition1 == True Then
{
Plot1(EmaFast,"EmaFast",IFF(EmaFast > EmaSlow, ReD, BluE),0,0);
Plot2(EmaSlow,"EmaSlow",IFf(EmaFast > EmaSlow, Red, Blue),0,2);
if EmaFast < EmaSlow and CrossDown(C, EmaFast) Then
Plot3(HH+CATR[0]*0.3,"Sell",Cyan,0,10);
Else
NoPlot(3);
if EmaFast > EmaSlow and CrossUp(C, EmaFast) Then
Plot4(LL-CATR[0]*0.3,"Buy",YelloW,0,10);
Else
NoPlot(4);
}
}
즐거운 하루되세요
> 비듬싸순 님이 쓴 글입니다.
> 제목 : 부탁 드립니다
> 타주기로 수식 부탁드립니다 항상 감사드리며 수고하십시오
input : ShortPeriod(38), LongPeriod(62);
var : EmaFast(0), EmaSlow(0);
EmaFast = ema(C, ShortPeriod);
EmaSlow = ema(C, LongPeriod);
Plot1(EmaFast, "EmaFast",IFf(EmaFast>EmaSlow,RED, BLUE),0, 0);
plot2(EmaSlow, "EmaSlow",IFf(EmaFast>EmaSlow,RED, BLUE),0, 2);
if EmaFast < EmaSlow and CrossDown(C, EmaFast) Then
plot3(H+ATR(30)*0.3,"Sell", CYAN, 0, 10);
if EmaFast > EmaSlow and CrossUp(C, EmaFast) Then
plot4(L-ATR(30)*0.3,"Buy", YELLOW, 0, 10);