Merhaba,
Aşağıdaki şekiIde deneyiniz,
Murray Math SqW:=Input("Square Width (Days)",4,256,64);
MM:=Input("Start Date Month",1,12,10);
DD:=Input("Start Date Day ",1,31, 5);
YY:=Input("Start Date Year ",1700,2100,1998);
T0:=LastValue(ValueWhen(1,DayOfMonth()=DD AND Month()=MM AND Year()=YY,Cum(1)));
Sqrs:=Int((LastValue(Cum(1))-T0)/SqW)-1;
S0:=T0+(Sqrs*SqW);
Lo:=LastValue(ValueWhen(1,Cum(1)=S0+SqW-1, LLV(Min(H,L),SqW)));
Hi:=LastValue(ValueWhen(1,Cum(1)=S0+SqW-1, HHV(Max(H,L),SqW)));
Sf:= If(Hi>25,If(Log(0.4*Hi)/Log(10)- Int(Log(0.4*Hi)/Log(10))>0,
Exp(Log(10)*(Int(Log(0.4*Hi)/Log(10))+1)), Exp(Log(10)*(Int(Log(0.4*Hi)/Log(10))))), 100*Exp(Log(8)*(Int(Log(0.005*Hi)/Log(8)))));
N:= If(Log(Sf/(Hi-Lo))/Log(8)<=0,0, If(Frac(Log(Sf/(Hi-Lo))/Log(8))=0, Int(Log(Sf/(Hi-Lo))/Log(8)), Int(Log(Sf/(Hi-Lo))/Log(8))+1));
Si:=Sf*Exp(-N*Log(8));
M:=Int(((1/Log(2))*Log((Hi-Lo)/Si))+.00001);
I:=Round(((Hi+Lo)*.5)/(Si*Exp((M-1)*Log(2))));
B:=(I-1)*Si*Exp((M-1)*Log(2));
TT:=(I+1)*Si*Exp((M-1)*Log(2));
Er:=If(Hi-TT>0.25*(TT-B) OR B-Lo>0.25*(TT-B),1,0);
MMX:=If(Er=0,M,If(Er=1 AND M<2,M+1,0));
NN:=If(Er=0,N,If(Er=1 AND M<2,N,N-1));
SiX:=Sf*Exp(-NN*Log(8));
IX:=Round(((Hi+Lo)*.5)/ (SiX*Exp((MMX-1)*Log(2))));
BX:=ValueWhen(1,Cum(1)>=S0, (IX-1)*SiX*Exp((MMX-1)*Log(2)));
TTX:=ValueWhen(1,Cum(1)>=S0, (IX+1)*SiX*Exp((MMX-1)*Log(2)));
{L1:=}ValueWhen(1,Cum(1)>=S0, BX+(0.125*(TT-B)));
{L2:=}ValueWhen(1,Cum(1)>=S0, BX+(2.0*(0.125*(TT-BX))));
{L3:=}ValueWhen(1,Cum(1)>=S0, BX+(3.0*(0.125*(TT-BX))));
{L4:=}ValueWhen(1,Cum(1)>=S0, BX+(4.0*(0.125*(TT-BX))));
{L5:=}ValueWhen(1,Cum(1)>=S0, BX+(5.0*(0.125*(TT-BX))));
{L6:=}ValueWhen(1,Cum(1)>=S0, BX+(6.0*(0.125*(TT-BX))));
{L7:=}ValueWhen(1,Cum(1)>=S0, BX+(7.0*(0.125*(TT-BX))));
TTX
iyi çaIışmaIar