답변완료
수식 부탁드립니다
질문사항들을 자세하게 알려주셔서 감사합니다
한가지 더 부탁 드리겠습니다
아래 서식에서 data1의 값이 - 값일때
+ 의 값으로 변환하여 항상 + 값으로 파라볼릭 작성하고자 합니다
그래서 data1의 값이 - 일때는 *(-1)을 곱하여 +값으로 만들고
+일때는 +1을 곱하여 그대로 + 를 유지하여
둘을 더한 합을 /2로 나누어 보았는데 잘 안되는것 같습니다
절대값을 주고도 해봤는데 안되는것 같습니다
부탁 드립니다 감사합니다
Input : AF(0.02), AFMAX(0.2),period(2);
Input : p(0);
var : OIV(0),oi1(0),v1(0),v2(0),v3(0);
var : Diff(0), mav(0);
Var : Direction(0), SAR_Value(Diff), AF_Value(.02);
var : HighValue(diff), LowValue(diff), EP(0),CSARV(0);
v1 = (Oi-oi1);
if v1 < 0 Then
v2 = v1*(-1) ;
if v1 > 0 Then
v3 = v1*(1);
OIV = ((v2+v3)/2);
if (bdate != bdate[1] or index == 0) Then
oi1 = oiv;
Diff = OIV;
mav = (ma(Diff,P));
if Diff == 0 Then
Diff = Diff[1];
if EP != 0 Then
{
if Direction == 1 then
{
EP = HighValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Diff > HighValue then
{
HighValue = Diff;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Diff < SAR_Value then
{
Direction = -1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
LowValue = Diff ;
}
}
else
{
EP = LowValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Diff < LowValue then
{
LowValue = Diff;
AF_Value = AF_Value + Af;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Diff > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = Diff;
}
}
CSarv = SAR_Value;
}
else
{
if SAR_Value != 0 && EP == 0 then
{
if Direction == 1 then
{
EP = HighValue;
AF_Value = AF;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Diff > HighValue then
{
HighValue = Diff;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
else
{
EP = LowValue;
AF_Value = Af;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Diff < LowValue then
{
LowValue = Diff;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
CSarv = SAR_Value;
}
else
{
if Direction == 0 then
{
if Diff > Diff[1] then Direction = 1;
else
if Diff < Diff[1] then Direction = -1;
}
else
{
if Direction == 1 then
{
if Diff < Diff[1] then
{
Direction = -1;
SAR_Value = HighValue;
CSarv = SAR_Value;
}
}
if Direction == -1 then
{
if Diff > Diff[1] then
{
Direction = 1;
SAR_Value = LowValue;
CSarv = SAR_Value;
}
}
}
LowValue = min(Diff, LowValue);
HighValue = max(Diff, HighValue);
}
}
plot1(diff,"(OI - bv)");
plot2(CSARv,"diff파라볼릭"); //속성에서 점그래프
2019-10-23
124
글번호 133021
지표