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

Re: [amibroker] Steve Dugas



PureBytes Links

Trading Reference Links




Steve,
 
When I run one of your indicators 
against a group of stocks using Explore, most of them show 'Max $ DD' and 'Max % 
DD' as zero. A few show non-zero values. Any idea why this is? Here is my 
include file, in case this gives a clue:
 
TestBars    
=126;       // bars in testperiod (most recent 
bars)StartDate   = 991231; // start date for earlier test 
periodEndDate     = 
0;       // end date for earlier test 
periodGoLong      = 
1;       // 1 = take long positions, 0 = no long 
positionsGoShort     = 
1;       // 1 = take short positions, 0 = no short 
positionsSignalPrice = Close;   // array used for trade signals 
and plotting indicatorTradeDelay  = 
1;       // bars after trade signal to execute 
tradeTradePrice  = Open;    // array used for trade 
executionsInitEquity  = 100000;   // initial 
equityReInvest    = 1;       // 
1 = initial equity, 2 = compounded equityCommAmount  = 
0.5;      // commission 
amountCommType    = 2;       // 
1 = $/trade, 2 = %/trade, 3 = c/shareEnterBarOne = 
1;       // 1 = always open trade on 1st test bar, 
0 = don'tOptimizeBy  = 1;       // 1 = 
annual % return, 2 = peak equity at close/all 
trades                       
// 3 = % winning trades, 4 = avg % 
return/trade                       
// 5 = % return/worst trade, 6 = drawdown/starting equity
 
Also AB settings use n and 
n=1
 
Thanks,
 
Steve
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Steve Dugas 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Saturday, April 05, 2003 4:13 
  AM
  Subject: Re: [amibroker] Steve 
Dugas
  Hi Stephen - Thank you for the kind words. Please see my 
  replies to yourquestions below:----- Original Message 
  -----From: "Stephen Almond (T)" <<A 
  href="">s.almond@xxxxxxxxx>To: "Ami" 
  <<A 
  href="">amibroker@xxxxxxxxxxxxxxx>Sent: 
  Friday, April 04, 2003 5:15 AMSubject: [amibroker] Steve 
  Dugas> Steve, congratulations on you excellent .DLL. I would 
  like to make acouple> of comments:>> 1. On the 
  attached chart of your TRIX indicator, the buy/sell signals seem> too 
  good to be true. Seems the programme picks the peak before the> 
  subsequent down day which defines that peak (same for troughs, of 
  course).> Can you introduce a couple of days delay to make the trades 
  more 'real'?>The chart shows the trade signals while the 
  reported results are based onthe actual trades. TRIX uses a reversal 
  system, so the indicator will changecolor on the day that it reverses - 
  you can confirm this by hovering thecursor over the day that it changes 
  color, and also the 2 days before, andreading the values in the tool tips. 
  I deliberately programmed the charts toshow the signals so that it would 
  alert me to signals on the current bar.Actually, the signal is given on 
  the day that the DOT (not the line) changescolor. I added the dots because 
  in line mode, AB uses the new color toconnect the signal bar to the 
  previous bar,  possibly giving the impressionthat the signal occurred 
  the day before it actually did. In real time itdoesnt matter because the 
  color change for the latest bar will will show upon the dot and the line 
  at the same time, but when looking at past signals,it is the first DOT of 
  a new color that signals the reversal.You can select when the actual 
  trades take place, similar to AA settings, bysetting the TradePrice and 
  TradeDelay variables at the top of the code. Theyare preset to execute the 
  trade on the open of the day following the signal,but for example, if your 
  style is to trade at the close on the day of thesignal,  just change 
  TradePrice to "Close" and TradeDelay to "0".> 2. I notice that if I 
  use 63 days (~1/4 year) for my Testbars and get a> return of 12%, then 
  the Annual return is shown as 48%. Is the lack of> compounding correct, 
  or are you simply erring on the conservative side?The program uses 2 
  methods to figure annual return, one if you arereinvesting initial equity 
  and the other if you are reinvesting compoundedequity. If you want to 
  reinvest compounded equity (and also calculate annualreturn based on this 
  method), just set ReInvest variable to "2".>> 3. I note in 
  you help document that you say the backtest isn't completely> 
  consistent with the explorations. Do you hope to remedy this? As 
  anexample> if I use testbars =126, should I be able to backtest 
  over 126 bars and at> least get the same number of trades as indicated 
  by the exploration?>Well, actually, the DLL has its own 
  built-in backtester, which it runs whenyou do an exploration. That is how 
  it determines the optimal parameters - ittests all combinations you select 
  and returns the most profitable one. Idont think that the results will 
  ever be identical to AB's backtesterbecause there are a number of 
  variables to consider and I dont know exactlyhow Tomasz handles them all 
  in his code. For example, AB calculates interestwhen you are out of the 
  market - I didnt bother to add interest in the DLLbecause it seems like a 
  relatively minor amount these days, but maybe I willadd it in the future. 
  Another example is if you choose to reinvest initialequity, the DLL will 
  actually reinvest the lesser of initial equity oractual equity (in case 
  you lose money on the first trade for example, thisis more realistic) I 
  think this would correspond to using  AB "positionsize"with "allow 
  shrinking" turned on . Another example is that the DLL allowsyou to open a 
  trade on the first bar of the test period if you want to,rather than wait 
  for the first signal to occur. If you select this method,it will look 
  backwards from the 1st test bar to find the previous signal andthen enter 
  the trade on the 1st bar of the test period. I added this becauseI usually 
  concentrate on what the stock has been doing very recently and ifsome 
  stocks make me wait for half the test period before opening a trade,that 
  makes it hard to make a valid comparison over such a short time. To getas 
  close to AB results as possible, you can set all parameters to be asclose 
  to AB settings as possible. In my limited testing of this, I have seenthat 
  it is possible to come pretty close.> Thanks for the great 
  programmeYou are welcome  : - )>>> Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxx> Send 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 <A 
  href="">http://docs.yahoo.com/info/terms/>>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. 







Yahoo! Groups Sponsor












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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.