DALEE!! USING INITIAL STOP METHODS (DATE SPECIFIC VERSION) ! Author: Sylvain Vervoort, TASC, May 2009 ! Coded by: Richard Denning 3/14/09 ! INPUTS: TLpct is 14. mo is 10. da is 2. yr is 2008. isLong is 1. ! 1 = for longs, 0 = for shorts ! ABBREVIATIONS: C is [close]. C1 is valresult(C,1). ! FIXED-PERCENTAGE TRAILING STOP FROM DATE startDate is makeDate(mo,da,yr). daysSinceStart is scanany(ruledate() = startDate, 5040) then offSetToDate(month(),day(),year()). loss is C * TLpct / 100. longStop is C-Loss. shortStop is C+Loss. maxVal is iff(reportdate() >= startDate,^highresult(longStop,^daysSinceStart+1),C). minVal is iff(reportdate() >= startDate,^lowresult(shortStop,^daysSinceStart+1),C). ! PLOT "TRAIL" AS CUSTOM INDICATOR TO SEE STOP ON CHART: trail is iff(reportdate() >= startDate and isLong = 1,maxVal, iff(reportdate() >= startDate and isLong <> 1,minVal,C)). Buy if reportdate() = startDate and isLong = 1. Exit if C < trail. SellShort if reportdate() = startDate and isLong <> 1. Cover if C > trail.  Rule Libraryÿÿ CCodeViewBuyÿÿ CReportViewÐSymbolÀ<¡daysSinceStartÀa SellShort€ÐSymbolÀ<Rnas100ÿÿÿÿÿÿ CBackTestPropertyBuyExit2PP»ÄInitialStops_Date BuySPXPCCnas100 ¸yã@ˆyã@ÿÿÿÿ ã@zã@€ SellShortCover"PP¸ÃInitialStops_Date SellShortSPXPCCnas100 ¸yã@ˆyã@ÿÿÿÿ@ã@ yã@00:00