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

Re: [amibroker] Re: I'm on the ledge an I swear I'm going to JUMP!



PureBytes Links

Trading Reference Links

Fred,

Simply because things defined inside formula always override the settings.
So if you write
BuyPrice = Open;

it enters on OPEN, regardless of settings. That's why there is a problem.
Now when OPEN price is equal to CLOSE price the backtester does
not really know if you have different entry price than in the settings or not.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Fred" <fctonetti@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, May 17, 2003 11:36 PM
Subject: [amibroker] Re: I'm on the ledge an I swear I'm going to JUMP!


> Uhhh ... I'm not sure I follow you here ... If the settings are buy 
> on close then no other info about the bar is relevant because of 
> course the close occured after in time from every other piece of info 
> about the bar.  Why would the backtester care about any other 
> information related to the bar ?
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
> wrote:
> > Fred,
> > 
> > This is exactly what I tried to tell in my previous message :-) 
> > .. the only difference is that in my opinion you simply can NOT 
> depend on PRICES.
> > 
> > Why? there is a simple example:
> > let's assume that entry and exit bars where DOJIs.
> > 
> > So Close == Open;
> > 
> > Now the user writes
> > 
> > BuyPrice = Open;
> > 
> > Settings are set to buy price = Close.
> > Now backtester checks the price and it is (say) 10.25
> > and looks for open for given bar - and it is 10.25 but then... hey
> > the close is 10.25 TOO !
> > Now how AmiBroker should know if this is open or close price.
> > 
> > So I belive that the only way is to add special info about timing.
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: "Fred" <fctonetti@xxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Saturday, May 17, 2003 11:12 PM
> > Subject: [amibroker] Re: I'm on the ledge an I swear I'm going to 
> JUMP!
> > 
> > 
> > > TJ,
> > > 
> > > We're talking about fine points here but ...
> > > 
> > > On day of entry if entry is at close, close is the only piece of 
> > > meaningful info.  If entry is based on the open then you can tell 
> no 
> > > more about whether the high occured before the low regardless of 
> > > whether one has written Buy = Open +/- X or one writes Buy = 
> Open.  
> > > As a result one has to assume in a worst case scenario that the 
> high 
> > > occured before the low and that at the end of the bar the DD is 
> > > related to the High and the low of that bar.  Similarly on day of 
> > > exit if entry is at open, open is the only piece of meaningful 
> > > information but if one writes Sell = Open +/- X or Sell = Close 
> then 
> > > the high and low of that last bar should also be involved in the 
> > > calculation of DD.
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" 
> <amibroker@xxxx> 
> > > wrote:
> > > > Fred,
> > > > 
> > > > You are right but... making assumptions about inside-bar timing 
> is 
> > > somewhat tricky.
> > > > In fact I already told the whole story sometime ago, but here 
> is a 
> > > short version.
> > > > Let's assume that user has Entry and Exit on Close  set in the 
> > > settings dialog.
> > > > 
> > > > Now the formula includes the following code:
> > > > 
> > > > ... formula here..
> > > > BuyPrice = Open;
> > > > SellPrice = Open;
> > > > 
> > > > Now should AMiBroker use entry bar H-L or not ? (settings and 
> > > formula say opposite things)
> > > > 
> > > > You may say that it should test if buyprice is open and then 
> use 
> > > appropriate range.
> > > > OK, but what about this:
> > > > 
> > > > Buy = ...
> > > > Sell = ...
> > > > BuyPrice = Open + 0.01;
> > > > SellPrice = Open - 0.01; // for slippage
> > > > 
> > > > In that case there is really no way to correctly guess the 
> timing.
> > > > 
> > > > So as I wrote already in the past this could be addressed only 
> in 
> > > one way
> > > > - by adding intra-bar timing information to trading rules 
> (since 
> > > depending on prices is not really an option).
> > > > And this will be possible after rewrite of the backtester that 
> is 
> > > due.
> > > > 
> > > > Hope this addresses your concerns.
> > > > 
> > > > Best regards,
> > > > Tomasz Janeczko
> > > > amibroker.com
> > > > ----- Original Message ----- 
> > > > From: "Fred" <fctonetti@xxxx>
> > > > To: <amibroker@xxxxxxxxxxxxxxx>
> > > > Sent: Saturday, May 17, 2003 10:43 PM
> > > > Subject: [amibroker] Re: I'm on the ledge an I swear I'm going 
> to 
> > > JUMP!
> > > > 
> > > > 
> > > > > However the description you provided is not accurate in terms 
> of 
> > > what 
> > > > > should happen.
> > > > > 
> > > > > The H & L are not relevant information on the day of entry 
> when 
> > > > > entries are based on close nor on day of exit when exits are 
> > > based on 
> > > > > open.
> > > > > 
> > > > > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" 
> > > <amibroker@xxxx> 
> > > > > wrote:
> > > > > > MessageDale,
> > > > > > 
> > > > > > Let's start with reading manual:
> > > > > > Max. system % drawdown: The largest percentage distance 
> between 
> > > > > equity peak value and the following trough value experienced 
> by 
> > > the 
> > > > > system 
> > > > > > 
> > > > > > In other words it is max PEAK-TROUGH % distance experienced 
> by 
> > > the 
> > > > > system. For longs Peak is calculated from High, trough is 
> > > calculated 
> > > > > from Low (I think this is obvious).
> > > > > > 
> > > > > > As it was already explained on this list if you use "worst 
> > > case" 
> > > > > then draw down calculations use H-L prices from the entry bar 
> to 
> > > the 
> > > > > exit bar (including those bars).
> > > > > > In your case the highest high since entry happens on 
> 4/15/2003 
> > > > > (37.42) and since this is the last bar of the trade the after-
> > > peak 
> > > > > trough is the low of the same bar
> > > > > > (this is a worst-case assumption, since EOD bar does not 
> have 
> > > any 
> > > > > timing information about if low happened before or after the 
> > > high, 
> > > > > the worst case is assumed
> > > > > > (low after high)) so the low is 35.15 (also on 4/15/2003 ). 
> The 
> > > > > difference between peak and trough after peak is = - 2,27 , 
> in 
> > > > > percents since peak this is = -6.07%
> > > > > > and this is what is reported in the report. Note that worst 
> > > case 
> > > > > setting includes exit H-L range even if you exit on open 
> because 
> > > > > there is no timing information in sell rule. This does not 
> happen 
> > > > > when you use other drawdown settings (use open or use close). 
> So 
> > > it 
> > > > > would be probably
> > > > > > easier to understand if you set 'Base drawdowns on open 
> price'.
> > > > > >  
> > > > > > Best regards,
> > > > > > Tomasz Janeczko
> > > > > > amibroker.com
> > > > > >   ----- Original Message ----- 
> > > > > >   From: dingo 
> > > > > >   To: _amibroker_yahoo 
> > > > > >   Sent: Saturday, May 17, 2003 7:45 PM
> > > > > >   Subject: [amibroker] I'm on the ledge an I swear I'm 
> going to 
> > > > > JUMP!
> > > > > > 
> > > > > > 
> > > > > >   I need some help!  I'm trying to take the part of the 
> help 
> > > file 
> > > > > that Tomasz posted for me and translate that into an example 
> for 
> > > > > calculating Max Drawdown percentage.
> > > > > > 
> > > > > >    
> > > > > > 
> > > > > >   My settings are Delay 1, Open and Worst Case for 
> drawdowns 
> > > and I 
> > > > > am still having a stupidly difficult time understanding how 
> to 
> > > > > calculate it.  The help file states: (and I have read it many 
> > > > > times) "To calculate the dip you can use the worst case 
> scenario: 
> > > low 
> > > > > price for long trades and high price for short trades".
> > > > > > 
> > > > > >    
> > > > > > 
> > > > > >   Using the example of the "long" below the problem I'm 
> having 
> > > is 
> > > > > not with the Low price but the other price - what is the 
> other 
> > > price? 
> > > > > The documentation leaves this part out.  Is it the original 
> open 
> > > > > price? Is it the highest open price?  Is it the highest high 
> > > price? 
> > > > > Is it the price of tea in China?
> > > > > > 
> > > > > >    
> > > > > > 
> > > > > >    
> > > > > > 
> > > > > >         Ticker
> > > > > >        Date/Time
> > > > > >        Buy
> > > > > >        Sell
> > > > > >        Short
> > > > > >        Cover
> > > > > >        Open
> > > > > >        Low
> > > > > >        High
> > > > > >        Close
> > > > > >        Shares
> > > > > >        Equity
> > > > > >        Profit
> > > > > >         
> > > > > >        
> > > > > >         AD
> > > > > >        04/10/2003
> > > > > >        1
> > > > > >        0
> > > > > >        0
> > > > > >        0
> > > > > >        34.84
> > > > > >        34.29
> > > > > >        34.85
> > > > > >        34.45
> > > > > >        289.939
> > > > > >        10,000.00
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >         AD
> > > > > >        04/11/2003
> > > > > >        0
> > > > > >        0
> > > > > >        0
> > > > > >        0
> > > > > >        34.49
> > > > > >        34.20
> > > > > >        34.90
> > > > > >        34.47
> > > > > >         
> > > > > >        10,000.00
> > > > > >        0.00
> > > > > >         
> > > > > >        
> > > > > >         AD
> > > > > >        04/14/2003
> > > > > >        0
> > > > > >        0
> > > > > >        0
> > > > > >        0
> > > > > >        34.47
> > > > > >        34.47
> > > > > >        35.50
> > > > > >        35.36
> > > > > >         
> > > > > >        9,994.20
> > > > > >        -5.80
> > > > > >         
> > > > > >        
> > > > > >         AD
> > > > > >        04/15/2003
> > > > > >        0
> > > > > >        1
> > > > > >        0
> > > > > >        0
> > > > > >        35.25
> > > > > >        35.15
> > > > > >        37.42
> > > > > >        37.42
> > > > > >         
> > > > > >        10,220.35
> > > > > >        220.35
> > > > > >         
> > > > > >        
> > > > > >         AD
> > > > > >        04/16/2003
> > > > > >        0
> > > > > >        0
> > > > > >        0
> > > > > >        0
> > > > > >        37.59
> > > > > >        36.62
> > > > > >        37.66
> > > > > >        36.75
> > > > > >         
> > > > > >        10,898.81
> > > > > >        898.81
> > > > > >         
> > > > > >        
> > > > > >          
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        ^
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >          
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        |
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >         System drawdown:
> > > > > >        -84.08
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        |
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >         Max. system drawdown:
> > > > > >        -658.16
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        From Exploration
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >         Max. system % drawdown:
> > > > > >        -6.07%
> > > > > >        <-- From Back test Report
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >         Max. trade drawdown:
> > > > > >        -658.16
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        From back test Run
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >         Max. trade % drawdown:
> > > > > >        -6.07%
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        |
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >         Trade drawdown:
> > > > > >        -84.08
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        |
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >          
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        |
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >          
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        v
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >          
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >         
> > > > > >        
> > > > > >         Ticker
> > > > > >        Trade
> > > > > >        Date
> > > > > >        Price
> > > > > >        Ex. date
> > > > > >        Ex. Price
> > > > > >        % chg.
> > > > > >        Profit
> > > > > >        % Profit
> > > > > >        Shares
> > > > > >        Position value
> > > > > >        Cum. Profit
> > > > > >        # bars
> > > > > >        Profit/bar
> > > > > >        
> > > > > >         AD
> > > > > >        Long
> > > > > >        04/11/2003
> > > > > >        34.49
> > > > > >        04/16/2003
> > > > > >        37.59
> > > > > >        9.00%
> > > > > >        898.81
> > > > > >        9.00%
> > > > > >        289.939
> > > > > >        10000
> > > > > >        898.811
> > > > > >        4
> > > > > >        2.25%
> > > > > >        
> > > > > > 
> > > > > >    
> > > > > > 
> > > > > >   Thanks for you continued help for a confused old man!
> > > > > > 
> > > > > >    
> > > > > > 
> > > > > >   d
> > > > > > 
> > > > > >    
> > > > > > 
> > > > > > 
> > > > > >         Yahoo! Groups Sponsor 
> > > > > >               ADVERTISEMENT
> > > > > >              
> > > > > >        
> > > > > >        
> > > > > > 
> > > > > >   Send BUG REPORTS to bugs@xxxx
> > > > > >   Send SUGGESTIONS to suggest@xxxx
> > > > > >   -----------------------------------------
> > > > > >   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.
> > > > > 
> > > > > 
> > > > > 
> > > > > Send BUG REPORTS to bugs@xxxx
> > > > > Send SUGGESTIONS to suggest@xxxx
> > > > > -----------------------------------------
> > > > > 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 
> > > http://docs.yahoo.com/info/terms/ 
> > > > > 
> > > > > 
> > > > >
> > > 
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > 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 
> http://docs.yahoo.com/info/terms/ 
> > > 
> > > 
> > >
> 
> 
> 
> 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 http://docs.yahoo.com/info/terms/ 
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/uetFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/