guru_trader 485 posts msg #42499 - Ignore guru_trader | 
3/26/2006 4:38:11 AM
  Has anyone read the article about "Average Peak Excursion" in the April 2006 issue of Technical Analysis of Stocks and Commodities (TASC)?  I would like to see an SF filter for it. 
 
 Claims:
 Using APE, you can:
 1. Select stocks that tend to yield higher-trading rates of returns than other stocks
 2. Select stocks for a higher relative reward compared with risk
 3. Determine the best trading time frame to maximize the rate of return for a given stock
 
 ...
 
 
  | 
Koronbock 201 posts msg #42501 - Ignore Koronbock | 
3/26/2006 9:08:56 AM
  I do not have the article. If someone is to help you, some kind of formula or at least written "rules" are needed to convert it to something SF can deal with. 
 
 
 
 
  | 
woodsmen63 23 posts msg #42503 - Ignore woodsmen63 | 
3/26/2006 9:40:58 AM
  http://www.traders.com/Documentation/FEEDbk_docs/TradersTips/TradersTips.html
 
 This month's tips include formulas and programs for: 
 
   TRADESTATION: AVERAGE PEAK EXCURSION (APE) 
   METASTOCK: AVERAGE PEAK EXCURSION (APE) 
   WEALTH-LAB: AVERAGE PEAK EXCURSION (APE) 
   AMIBROKER: AVERAGE PEAK EXCURSION (APE) 
   eSIGNAL: AVERAGE PEAK EXCURSION (APE) 
   NEUROSHELL TRADER: AVERAGE PEAK EXCURSION (APE) 
   NEOTICKER: AVERAGE PEAK EXCURSION (APE) 
   TRADING SOLUTIONS: AVERAGE PEAK EXCURSION (APE) 
   AIQ SYSTEMS: AVERAGE PEAK EXCURSION (APE) 
   TECHNIFILTER PLUS: AVERAGE PEAK EXCURSION (APE) 
   TRADECISION: AVERAGE PEAK EXCURSION (APE) 
   BIOCOMP DAKOTA: AVERAGE PEAK EXCURSION (APE)
   TRADE NAVIGATOR/TradeSense: AVERAGE PEAK EXCURSION (APE)
   VTTRADER: AVERAGE PEAK EXCURSION (APE) 
 
 This all I could find, has to do with absolute value
 
 
 
 
  | 
TheRumpledOne 6,529 posts msg #42506 - Ignore TheRumpledOne modified | 
3/26/2006 10:37:30 AM
  Here's the code for TradeStation:
 
 inputs:
 	Period( 20 ) ;
 
 variables:
 	APELength( 250 ),
 	TestOpen( 0 ),
 	OneDayPE( 0 ),
 	PE( 0 ),
 	APE1( 0 ),
 	APEN( 0 ),
 	Count( 0 ) ;
 
 array:
 	OneDayPEArray[ 250 ]( 0 ),
 	PEArray[ 250 ]( 0 ) ;
 
 TestOpen = Open[ Period - 1 ] ;
 
 OneDayPE = MaxList( High - Open, Open - Low ) / Open ;
 PE = MaxList( TestOpen - Lowest( Low, Period ), 
 	Highest( High, Period ) - TestOpen) / TestOpen ;
 
 for Count = 250 downto 2
    begin
    OneDayPEArray[ Count ] =  OneDayPEArray[ Count - 1 ];
    PEArray[ Count ] = PEArray[ Count - 1 ] ;
    end ;
 OneDayPEArray[ 1 ] = OneDayPE ;
 PEArray[ 1 ] = PE ;
 
 if CurrentBar > 250 then
 	begin
 	APEN = AverageArray( PEArray, APELength ) ;
 	APE1 = AverageArray( OneDayPEArray, APELength ) ;
 	Plot1( APE1, "APE-1" ) ;
 	Plot2( APEN, "APE-N" ) ;
 	end ;
 if APE1 > 0 and Log( Period ) > 0 then
 	Plot3( Log( APEN /APE1 ) / Log( Period ), "Alpha" );
 
 
 first attempt:
 
  	    
 
 
 
  | 
TheRumpledOne 6,529 posts msg #42507 - Ignore TheRumpledOne modified | 
3/26/2006 10:37:42 AM
  Attempt one POTENTIAL FILTER ERROR.. BLEW UP!
 
 So let's see how far we can go:
 
  	    
 
 So far, so good.
 
 
 
  | 
TheRumpledOne 6,529 posts msg #42508 - Ignore TheRumpledOne modified | 
3/26/2006 10:37:54 AM
 
  	    
 
 Some interesting things happening...
 
 
 
 
  | 
TheRumpledOne 6,529 posts msg #42509 - Ignore TheRumpledOne modified | 
3/26/2006 10:38:12 AM
 
  	    
 
 It's still working...
 
 
 
  | 
TheRumpledOne 6,529 posts msg #42510 - Ignore TheRumpledOne modified | 
3/26/2006 10:39:56 AM
 
  	    
 
 SF doesn't like:
 
 set{LogPeriod, Log(20) } 
 add column LogPeriod
 
 
 
 
 
  | 
TheRumpledOne 6,529 posts msg #42511 - Ignore TheRumpledOne modified | 
3/26/2006 11:01:54 AM
 
  	    
 
 Got it to work!!  Looks like SF has a small bug.
 
 But will have to compare this filter to TradeStation to see if the values match...
 
 
 
 
 
 
  | 
TheRumpledOne 6,529 posts msg #42512 - Ignore TheRumpledOne modified | 
3/26/2006 11:16:54 AM
  So far...
 
 APE1 matches TradeStation
 
 APEN and ALPHA doesn't match.
 
 OK, got the above working.  
 
 APEN within .01.
 
 MAY ALL YOUR FILLS BE COMPLETE.
 
 P.S. guru_trader, you owe me BIGTIME for this one ... LOL!
 
 
 
 
 
 
 
 
  |