MetaStock -> Tools -> Indicator Builder -> New Copy and paste indicator formulae below. Warning: Do not attempt to trade this system. Doing so will collapse the existing multiple-parallel Quantum universe into a singular reality, in which the Holy Grail MkII system could not possibly exist in its present form. =========================== Holy Grail MkIV Long system =========================== ---8<------------------------------------- { Holy Grail Long MkIV system signals v7.5 } { Warning: Xperimental only - *Do Not Trade!* } { Ignore all signals without matching MkIV Money Management module! Enter Long = +1 (Close) Exit Long = -1 (Close) For JSE markets only.} { ©Copyright 2005 Jose Silva } { http://www.metastocktools.com } pds:=Input("Avg trade frequency",2,500,21); pdsN:=Input("Fibonator normalizing periods (1=none)",1,260,1); vFilter:=Input("Inactivity filter? [1]Yes, [0]No",0,1,1); delay:=Input("Entry and Exit delay",0,5,0); plot:=Input("[1]Signals, [2]Trade binary",1,2,1); vFilter:=If(vFilter=1,HHV(C,pds)>LLV(C,pds)*1.05,1); FibSeriesSum:=1+1/1+1/2+1/3+1/5+1/8+1/13+1/21+1/34+1/55+1/89+1/144+1/233+1/377+1/610; FibSeriesSumVal:=Frac(FibSeriesSum+LastValue(DPO(pds)+PREV-PREV)-FibSeriesSum); FibSeriesSumValNorm:=(FibSeriesSumVal-LLV(FibSeriesSumVal,pds))/(HHV(FibSeriesSumVal,pds)-LLV(FibSeriesSumVal,pds)+.000001)*100; avg:=Cum(FibSeriesSumValNorm)/Cum(IsDefined(FibSeriesSumValNorm)); pk:=Ref(FibSeriesSumValNorm,-1)=HHV(FibSeriesSumValNorm,3) AND Ref(FibSeriesSumValNorm,-1)>avg; pkVal:=ValueWhen(1,pk,Ref(FibSeriesSumValNorm,-1)); pkAvg:=Cum(pkVal)/Cum(IsDefined(pkVal)); tr:=Ref(FibSeriesSumValNorm,-1)=LLV(FibSeriesSumValNorm,3) AND Ref(FibSeriesSumValNorm,-1)0,entryLong-exitLong); entryLong:=x=1 AND (Alert(x<>1,2) OR InitSequence); exitLong:=x=-1 AND (Alert(x<>-1,2) OR InitSequence); binary:=ValueWhen(1,entryLong-exitLong<>0,entryLong-exitLong); { Plot in own window } Ref(If(plot=1,entryLong-exitLong,binary),-delay) ---8<------------------------------------- ==================================== Holy Grail MkIV system Profit Long % ==================================== ---8<----------------------------------- { System Profit Long % - fixed trade size - v2.2 Basic code - Entry/Exit on Close of signal. ©Copyright 2005~2006 Jose Silva. The grant of this license is for personal use only - no resale or repackaging allowed. All code remains the property of Jose Silva. http://www.metastocktools.com } {* Entry Long formula reference *} x:="Fml("Holy Grail MkIV Long system"); entry:=x=1; {* Exit Long formula reference *} exit:=x=-1; { User inputs } cost:=Input("Total Transaction costs (Brokerage + Slippage) %:",0,100,.2)/200; plot:=Input("plot: [1]%Profit, [2]Signals", 1,2,1); { Trade Binary & clean Entry/Exit signals } init:=Cum(IsDefined(entry+exit))=1; flag:=ValueWhen(1,entry-exit<>0 OR init,entry); entry:=flag*(Alert(flag=0,2) OR entry*Cum(entry)=1); exit:=(flag=0)*(Alert(flag,2) OR exit*Cum(exit)=1); { Profit % curve } EntryVal:=ValueWhen(1,entry,C*(1+cost)); Profit:=C*(1-cost)/EntryVal-1; ProfitPer:=(flag*Profit+Cum(exit*Profit))*100; { Plot in own window below chart } If(plot=1,ProfitPer,entry-exit) ---8<----------------------------------- http://www.metastocktools.com