Dynamice zone MACD ---CAN ANY ONE CONVERT INTO AFL...????

rocky01

Active Member
#1
LegacyColorValue = true];

{REMEMBER! The input values for this Indicator MUST be the
same as the input values for the Dynamic Zones System!}


Input: Ind((MACD(C,12,26))*10), N(70), StartPrB(0.12), StartPrS(0.12);
Vars: BuyZone(0), SellZone(0), Indicator(0);

BuyZone = DZBuy(Ind, StartPrB, N);
SellZone = DZSell(Ind, StartPrS, N);
Indicator = (Xaverage(MACD(C,12,26),9)*10);

{Please use the area below for all trade related adjustments
=================================================}

Plot1(Ind,"Indicator");
Plot2(BuyZone,"BuyZone");
Plot3(SellZone,"SellZone");
Plot4(Indicator,"Slow");

Function DZBuy

[LegacyColorValue = true];

{User Function: DZBuy

Return: The value of the Upper Bound such that Probability of a given indicator
to be above this bound is equal to the given probability +- given accuracy.

Example. Indicator's values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 9. The Probability required is
0.2 with an accuracy 0.05. Then the Upper bound for this indicator will be 8.
The Probability that the indicator is above 8 is equal 0.2 with the accuracy
0.05 because if it is 7 then the Probability is 0.30 and it is out of bounds.

Provided by: RINA Systems, Inc.

!!The only place to be changed here is the default value for the variable BNumb!!}


Input: Indictor(NUMERICSERIES), InitVal(NUMERIC), N(NUMERIC);

Vars: Left(-10000), Right(10000),count(0),j(0),j1(0),Prob(0),eps(0.001),yval(0),k(0),delt(0),
BNumb(35775),BNumb1(30208);
array: return[750](0);

{Right is the value of the indicator that serves as a high above which the probability is within
the bounds}

{If 1=1 {and (BlockNumber=BNumb or BlockNumber=BNumb1)} and CurrentDate <20000306 then
begin}
value5=Indictor;

If BarNumber>N then
begin
For k=0 to N-2
begin
return[k]=return[k+1];
end;
return[N-1]=value5;
end
else
begin
j=BarNumber-1;
return[j]=value5;
end;
If BarNumber>=N then
begin
yval=(left+right)/2;
delt=yval-left;
while delt>0.005 and value1<50
begin
value1=value1+1;
For j1=0 to N-1
begin
IF return[j1]<yval then
begin
count=count+1;
end;
end;
Prob=count/N;

IF Prob>InitVal+eps then
begin
right=yval;
yval=(yval+left)/2;
end;
IF Prob<InitVal-eps then
begin
left=yval;
yval=(yval+right)/2;
end;
IF Prob<InitVal+eps and Prob>InitVal-eps then
begin
right=yval;
yval=(yval+left)/2;
end;
delt=yval-left;
count=0;
end;
If value1<>500 then
value1=0;
DZBuy=yval;
Right=10000;
Left=-10000;
Prob=0;
end;
If BarNumber=CurrentBar and value1=500 then
print("You have chosen too high accuracy for this system. Please try again.");

{end;

If (BlockNumber<>BNumb and BlockNumber<>BNumb1) then
DZBuy=0;
}


function dzsell

[LegacyColorValue = true];

{
User Function: DZSell

Return: The value of the Upper Bound such that Probability of a given indicator
to be above this bound is equal to the given probability +- given accuracy.

Example. Indicator's values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 9. The Probability required is
0.2 with an accuracy 0.05. Then the Upper bound for this indicator will be 8.
The Probability that the indicator is above 8 is equal 0.2 with the accuracy
0.05 because if it is 7 then the Probability is 0.30 and it is out of bounds.

Provided by: RINA Systems, Inc.

!!The only place to be change here is the default value for the variable BNumb!!

}

Input: Indictor(NUMERICSERIES), InitVal(NUMERIC), N(NUMERIC);

Vars: Left(-10000), Right(10000),count(0),j(0),j1(0),Prob(0),eps(0.001),yval(0),k(0),delt(0),
BNumb(35775),BNumb1(30208);
array: return[750](0);

{Right is the value of the indicator that serves as a high above which the probability is within the bounds}

{If 1=1 {and (BlockNumber=BNumb or BlockNumber=BNumb1)} and CurrentDate < 20000306 then
begin}

value5=Indictor;

If BarNumber>N then
begin
For k=0 to N-2
begin
return[k]=return[k+1];
end;
return[N-1]=value5;

end
else
begin
j=BarNumber-1;
return[j]=value5;
end;
If BarNumber>=N then
begin
yval=(right+left)/2;
delt=right-yval;
while delt>0.005 and value1<50
begin
value1=value1+1;
For j1=0 to N-1
begin
IF return[j1]>yval then
begin
count=count+1;
end;
end;
Prob=count/N;

IF Prob>InitVal+eps then
begin
left=yval;
yval=(yval+right)/2;
end;
IF Prob<InitVal-eps then
begin
right=yval;
yval=(yval+left)/2;
end;
IF Prob<InitVal+eps and Prob>InitVal-eps then
begin
left=yval; {if we want to maximize high}
yval=(yval+right)/2;
end;
count=0;
delt=right-yval;
end;
If value1<>500 then
value1=0;
DZSell=yval;
Right=10000;
Left=-10000;
Prob=0;
end;
If BarNumber=CurrentBar and value1=500 then
print("You have chosen too high accuracy for this system. Please try again.");

{end;}

{
If (BlockNumber<>BNumb and BlockNumber<>BNumb1) then
DZSell=10000;
}
 

rocky01

Active Member
#3
Dont mind but you post your chart formula nuthing wrong in it,i m haveing some problems with my pc as soon as it get solved i will pst it but by that time you post your formula in alf language,....your work will be definately be appriciated.. :)
 

rocky01

Active Member
#5
yes ..!! thats right i suppose plz post it on massage board so that evry 1 including me can use it..gr8 job .....kindly post it on board