DALE!! THE MEGAN RATIO.TASC Jan 2008 ! Author: Oscar G. Cagigas ! Coded by: Richard Denning 11/06/2008 ! TradersEdgeSystems.com Symbols if symbol() <> "SYSTEM1" and symbol() <> "SYSTEM2" and symbol() <> "SYSTEM3". !! SYSTEM 1 (from article): H is [high]. H1 is valresult(H,1). L is [low]. O is [open]. C is [close]. PD is {position days}. LE1 if H > highresult(H,20,1) and Symbols. EntryPr1 is max(H1,O). LX1 if L < lowresult(L,10,1) and PD >= 2. ExitPr1 is min(lowresult(L,10,1),O). !! SYSTEM 2 (from article): Setup if simpleavg(C,5) > simpleavg(C,20). LE2 if valrule(Setup,1) and H > H1 and Symbols. EntryPr2 is max(O,H1). LX2 if L < lowresult(L,2,1) and PD >= 2. ExitPr2 is min(lowresult(L,2,1),O). !! SYSTEM 2 WITH ADDED FILTER (from article): LE2F if LE2 and (month() < 4 or month() > 7). ! All other parts fo the system are the same !------------------------------------------------------------------------ !---After running system tests, use the summary reports ! to get the inputs which must be manually typed in below ! then run the EDS reports: !! INPUTS FROM THE SYSTEM TESTS ! RUN IN PORTFOLIO MANAGER ! THREE SYSTEMS CAN BE COMPARED: ! INPUT1: BegEq1 is 100000. EndEq1 is 5839557. TotTrds1 is 85.55. AvgHold1 is 29.70. ! INPUT2: BegEq2 is 100000. EndEq2 is 2283895. TotTrds2 is 443.15. AvgHold2 is 5.45. ! INPUT3: BegEq3 is 100000. EndEq3 is 990958. TotTrds3 is 294.5. AvgHold3 is 5.80. ! COMPUTE METRICS AND MEGAN RATIO: TWR1 is EndEq1 / BegEq1. GeoMean1 is Power(TWR1,1/TotTrds1). MaxTrdsYr1 is 252 / AvgHold1. MeganRatio1 is MaxTrdsYr1 * ln(GeoMean1). SystemReport1 if symbol() = "SYSTEM1". TWR2 is EndEq2 / BegEq2. GeoMean2 is Power(TWR2,1/TotTrds2). MaxTrdsYr2 is 252 / AvgHold2. MeganRatio2 is MaxTrdsYr2 * ln(GeoMean2). SystemReport2 if symbol() = "SYSTEM2". TWR3 is EndEq3 / BegEq3. GeoMean3 is Power(TWR3,1/TotTrds3). MaxTrdsYr3 is 252 / AvgHold3. MeganRatio3 is MaxTrdsYr3 * ln(GeoMean3). SystemReport3 if symbol() = "SYSTEM3".  Rule Libraryÿÿ CCodeView SystemReport1ÿÿ CReportView ÐSymbolÀ<¡BegEq1À;¡EndEq1À; ¡TotTrds1À@ ¡AvgHold1À=¡TWR1À2 ¡GeoMean1À? ¡MaxTrdsYr1ÀK ¡MeganRatio1ÀNSYSTEM1PÃGŠ5²Jš«Bš™íA•iB~;†?ðÁA‰Î> SystemReport2€ ÐSymbolÀ<¡BegEq2À8¡EndEq2À< ¡TotTrds2À= ¡AvgHold2À9¡TWR2À2 ¡GeoMean2ÀB ¡MaxTrdsYr2ÀD ¡MeganRatio2ÀISYSTEM2PÃGÜe J3“ÝCff®@+¶¶A&è€?Bô8Bn!§> SystemReport3€ ÐSymbolÀ<¡BegEq3À<¡EndEq3À> ¡TotTrds3ÀH ¡AvgHold3À?¡TWR3À3 ¡GeoMean3ÀI ¡MaxTrdsYr3ÀL ¡MeganRatio3ÀSSYSTEM3PÃGàîqI@“Cš™¹@¤A0?Ë-By>­>LE1€ÐSymbolÀ<LE2€ÐSymbolÀ<EXMILMNWNRLE2F€ÐSymbolÀ<EXMILMNWNRgMEGANÿÿÿÿÿÿ CBackTestPropertyLE1LX1PPdŠMegan Ratio LE1SPXPEntryPr1ExitPr1MEGAN ¸iã@ˆiã@ÿÿÿÿÖá@Cã@€LE2LX2PPd‹Megan Ratio LE2SPXPEntryPr2ExitPr2MEGAN ¸iã@ˆiã@ÿÿÿÿÖá@ Cã@€LE2FLX2PPd‹Megan Ratio LE2FSPXPEntryPr2ExitPr2MEGAN Øiã@¨iã@ÿÿÿÿÖá@ Cã@00:00