Skip to main content

Top finder for Amibroker (AFL)

wildeazoscar over 13 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 4)
  • Tags:
    amibroker, pattern

Midas Topfinder—— as detailed by Paul Levin

Indicator / Formula

Copy & Paste Friendly
SetBarsRequired(sbrAll);

sd = ParamDate("Input Date","2012-02-14",0); 
st=ParamTime("input time","1:44",0);
dn = DateNum(); 
tn=TimeNum();
 
start = dn == sd AND tn==st; 


 
mp =  ParamField("Price field",-1);
 
PV1= Cum(mp * V); 
CV1= Cum( V ); 

D=Param("D",6120000000,50000,9000000000000);

PV=PV1-ValueWhen(sd==dn AND tn==st,PV1,1);
CV=CV1-ValueWhen(sd==dn AND tn==st,CV1,1);

E=CV*(1-CV/D);

ET=CV-E;


startloop=EndValue(ValueWhen(sd==dn AND tn==st,BarIndex(),1));
endloop=EndValue(IIf(CV>D,ValueWhen(CV<D,BarIndex(),1),BarCount));

barint=0;

TBF=mp;

for (j=startloop+1;j<endloop;j++)
	{
				k=0;
				i=startloop+1;
		while (ET[j]>0 AND k==0)
					{
				
				if (CV[i]>ET[j])
							{
							k=1;
							
							}
					i=i+1;
					}

		if (k==1)
					{
					barint[j]=i-1;
					}

		Volint[j]=CV[barint[j]]-ET[j];
		Mpint[j]=Low[barint[j]]*Volint[j];

		CVint[j]=CV[j]-CV[barint[j]]+Volint[j];
		PVint[j]=PV[j]-PV[barint[j]]+Mpint[j];
		TBF[0]=Low[0];
		TBF[j]=PVint[j]/CVInt[j];
		


			
		}

TBF1=IIf(BarsSince(start),TBF,Null);

PCT=100*CV/D;



tbf2=IIf(BarIndex()<endloop,TBF1,Null);
	
		

		





Plot(TBF2,"PCT="+WriteVal(PCT,1.0)+"TBF",ParamColor( "Color", colorCycle ), ParamStyle("Style") );
	
		

		


6 comments

1. hmsanil
over 13 years ago

hi,

Nothing displayed on screen.

Tell us how to use it

Thanks

over 13 years ago

It does not give any error but also does not display anything on screen. Can someone please post Picture of this AFL.

about 13 years ago

Get a copy of the basic work of Paul Levin MIDAS system to understand. This is a professional tool and not to be understood in one line.

Leave Comment

Please login here to leave a comment.