[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Re: auto-optimize experiences



PureBytes Links

Trading Reference Links




<SPAN 
class=570094919-18122003>The key question is whether any information available 
*beforehand* can tell you what MA period to use *going forward*. 

<SPAN 
class=570094919-18122003> 
<SPAN 
class=570094919-18122003>It's not my impression that prior performance, at 
least as captured by the simple measures I applied to equity feedback, does 
this very well. Unfortunately, that conclusion was the main take-away I got from 
the auto-optimization framework. Maybe I didn't use the right performance 
metrics, or go far enough in some other sense. 
<SPAN 
class=570094919-18122003> 
<SPAN 
class=570094919-18122003>If you figure out how to make it sing the song of the 
grail, Clue Me (:-)
<SPAN 
class=570094919-18122003> 
<SPAN 
class=570094919-18122003>Dave
<SPAN 
class=570094919-18122003> 
<BLOCKQUOTE 
>Dave 
  and Dimitris,Is it possible that Dimitri's InspectionPoints approach, 
  or your Continuous Equity Feedback method could help in the following 
  situation:My trade signals are generated by OB/OS indicators in 
  conjunction with the underlying market trend. Market trend is determined 
  either by MA crossovers or the one day ROC of a moving average. The 
  problem of course is what MA to use. One that worked well in 1997 for 
  example was pretty useless in 1999. This can be seen using the following 
  simplified code where the MA has been optimized for each 
  year.period = IIf(Year() == 1995, 105,IIf(Year() == 1996, 
  29,IIf(Year() == 1997, 143,IIf(Year() == 1998, 4,IIf(Year() == 
  1999, 1,IIf(Year() == 2000, 25,IIf(Year() == 2001, 150,IIf(Year() 
  == 2002, 43,33))))))));Buy = ROC(MA(C,period),1)>0;Sell = 
  ROC(MA(C,period),1)<0;Short=Sell;Cover=Buy;Run on QQQ with no 
  margin it produces a net% profit of 2677%, but that is with perfect rear 
  vision. I tried unsuccessfully to modify your code to handle this (must 
  spend more time with the user guide) What do you think? Is it worth 
  pursuing?Keith--- In amibroker@xxxxxxxxxxxxxxx, "Dave 
  Merrill" <dmerrill@xxxx> wrote:> while Demitris' was looking 
  into InspectionPoints, I've been investigating> continuous equity 
  feedback as a way of setting parameters for trading> indicators. 
  where InspectionPoints test past performance every specified> 
  number of days, the code below tests performance for this stock and 
  adjusts> parameter settings on every bar. it also skips the trade 
  completely if no> parameter combination was profitable. the 
  performance metric used is> smoothed return over the prior 3 
  years.> > results have been more mixed than I expected. for 
  certain stocks, it works> quite while, for many others, not well at 
  all. testing the NASDAQ 100 from> 1/1/94 to present, 51% of stocks 
  made a profit, 42% lost, and 8% didn't> trade at all.> 
  > since it does work very well on some stocks, one interesting next 
  step would> be to trade it as a ranked portfolio, using past 
  performance as> PositionScore. however, for PositionScore to have the 
  effect of selecting> only stocks that trade profitably this way, 
  there have to be significantly> more simultaneous entry signals 
  than available positions. this requires> widening the universe of 
  stocks examined well beyond the N100. for other> systems I've done 
  using that principle, I used the whole NASDAQ, but with> bar by bar 
  optimization of each individual stock, this auto-optimization> 
  system is quite slow. the N100 took somewhere upwards of 30 minutes on 
  my> 800mHz PIII laptop, so running the whole NASDAQ as a scored 
  portfolio is out> of reach for me I think.> > anyway, 
  here's the code, for comments, bug finding, and food for thought.> 
  > dave> > ===========================> // 
  CONFIG> has_min_vol = (MA(v, 50) > 1000000) or (MarketID(1) == 
  "Mutual Funds");> is_min_price_long = c > 1;> 
  is_min_price_short = c > 5;> equity_lookback_bars = 252 * 3;> 
  equity_lookback_smoothing = 5;> > // SIGNALS> best_profit 
  = 0;> best_range = 0;> best_smoothing = 0;> for(range = 
  2; range <= 50; range++) {>       
  for(smoothing = 2; smoothing <= 50; smoothing++) {> 
              // calc 
  indicator      w those settings> 
              stoD = 
  StochD(range, smoothing, smoothing);>       
        stoK = StochK(range, smoothing);> 
              sig = stoD - 
  stoK;>             // 
  calc buy/sell/short/cover w those settings> 
              long_signal = 
  Cross(sig, 0);>       
        short_signal = Cross(0, sig);> 
              buy = cover = 
  long_signal;>       
        sell = short = short_signal;> 
              buy = buy and 
  is_min_price_long and has_min_vol;>       
        short = short and is_min_price_short and 
  has_min_vol;>       
        // calc performance w those settings> 
              e = Equity(0, 
  0);>             
  e_ref = Ref(e, -equity_lookback_bars);>       
        profit = MA((e - e_ref) / e_ref, 
  equity_lookback_smoothing) * 100;>       
        // track settings w best performance and 
  resulting performance>       
        is_new_best = IIf(profit > best_profit, 1, 
  0);>             
  best_profit = IIf(is_new_best, profit, best_profit);> 
              best_range = 
  IIf(is_new_best, range, best_range);>       
        best_smoothing = IIf(is_new_best, smoothing, 
  best_smoothing);>       }> 
  }> > // calc real signals w optimal settings> stoK 
  => 
  MA(100*(C-LLV(L,best_range))/(HHV(H,best_range)-LLV(L,best_range)),best_smoo> 
  thing);> stoD = MA(stoK, best_smoothing);> sig = stoD - 
  stoK;> > // calc buy/sell/short/cover w optimal settings> 
  long_signal = Cross(sig, 0);> short_signal = Cross(0, sig);> buy 
  = cover = long_signal;> sell = short = short_signal;> buy = buy 
  and is_min_price_long and has_min_vol;> short = short and 
  is_min_price_short and has_min_vol;> > // don't buy or short 
  unless profitable> buy = buy and best_profit > 0;> short = 
  short and best_profit > 0;Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html





Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.