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

[amibroker] Re: Expectancy - was { AP's RT data feed - for MarkK }



PureBytes Links

Trading Reference Links

I'll be posting a more formal explanation of my viewpoint, based on 
this thread, at the UKB within the next two weeks.

The current "Expectancy" post will be renamed to "Evaluation Metrics" 
and extended.

I will show the derivation of a class of metrics, that are based on 
the primary evaluation inputs, and the relationships between them 
(including their restatements).

I hope to make it sufficiently clear  why I am interested in root 
cause evaluation and, at the least, provide enough info for peopple 
to make informed decisions about when and where to use these metrics:

Win/Loss
PayOff Ratio
aveProfit/Loss
ProfitFactor
Expectancy
bars held

I will introduce some minor evaluation metrics, that are new to 
trading (AFAIK) - at least they are not included in AB's builtin 
metrics.

Possibly the post will be extended at a later date to include the 
Annualised metrics and those based on Equity curve analysis.

I might include a formal definition of PowerFactor or at least 
clarify why I elected to introduce the term to the trading community.

brian_z
 


--- In amibroker@xxxxxxxxxxxxxxx, "brian_z111" <brian_z111@xxx> wrote:
>
> Another FTR.
> 
> IMO Expectancy as defined by Van Tharp is not the best way to 
> measure "the edge" or how much we expect to win on average each 
time 
> we trade (flip the coin).
> 
> Van Tharp uses $values as the unit of measure for a win or a loss.
> If adjusted data is being used for backtesting the absolute value 
of 
> the win, or loss, in $ terms will have been lost in the adjusment 
> process (the further back in history you go the greater will be the 
> error).
> 
> I believe standardizing to % won or lost will minimize those errors 
> (wins and losses are measured in relative terms).
> 
> A better way is to measure individual trader performance in mean % 
> won or lost (growth).
> 
> Example (using Excel).
> 
> initial equity = $10,000
> final equity = $10,500
> period = 10
> growthfactor (per period) = (10,500/10,000)^(1/10) = 1.0049
> 
> You expect to win (on average) 0.49% each time you trade.
> 
> net return per trade = the edge (in%) - commissions (in %)
>                      = 0.49 - 0.11 
>                      = 0.38
> 
> To cross check the growth factor (reverse the equation):
> 
> 
> 10000 * 1.0049^10 = 10500
> 
> Note: that is the mean expected growth rate.
> To estimate variance requires a simulation (MonteCarlo ?)
> 
> brian_z
> 
> 
> Re "Another way to define ProfitFactor is:
> 
>  Number Wins/Number Losses * average % Win/average % Loss"
> 
> FTR -
> 
> A lot of my work is original so it is not out of the question that I
> use terms in ways that others don't.
> 
> I'm not sure about the above definition.
> I can't find any reference to it in the 20 - 30 books I have here so
> possibly I made it up (in which case I would call it something else
> like PowerFactor).
> 
> Anyway I intended it as the companion metric for a basic simulation
> that I have done in the past in Excel (it uses binomial probability
> and a distribution of the trade sample to plot equity curves).
> 
> I haven't worked out if it is possible and/or how to calculate
> expectancy from PowerFactor - it was always my intention to rely on
> simulation for the metrics.
> 
> brian the dross maker
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "brian_z111" <brian_z111@ wrote:
> 
>  Chris,
> 
>  Re Profit Factor and Expectancy
> 
>  I thought you might be interested since you focus on Expectancy as
>  the driver, which is similar to my focus on PF (it's the first
> place
>  I look).
> 
>  ProfitFactor and Expectancy are kissing cousins, mathematically and
>  conceptually.
> 
>   Profitunity = Expectancy per trade * number of trades per time
>  period.
>  
> 
>  Yes, I believe VanTharp first used the term Expectancy, although I
>  haven't read his book. That is what I meant (I picked the term up
>  from others who must have read him).
> 
>  AB's version of PF is correct so that:
> 
>  gross profit - gross loss = net profit
>  net profit/number of trades = expectancy in $ (on a per trade 
basis)
> 
> 
>  Another way to define ProfitFactor is:
> 
>  Number Wins/Number Losses * average % Win/average % Loss
> 
>  To standardize the backtests over time I am only interested in the
> %
>  win or loss so that is how I first started using that definition of
>  PF. Then later on I started to see what a useful evaluation metric
> it
>  was.
> 
>  Since I start by looking at the PF, and then look at Expectancy or
>  PA% later on, I thought I would share my observations with you.
> 
>  When doing design work PF has the advantage of giving us two
> metrics
>  that tell us a lot about the trade e.g. if the expectancy is OK but
>  the W/L ratio is < 50% I don't like it - I am not comfortable with
>  long losing sequences followed by one big win (not only
>  temperamentally but also based on my rules for design).
> 
>  When I look at the ave%W/ave%L it tells me how much of the positive
>  PF is due to the W/L ratio and how much is due to my stops e.g. you
>  can leave your stops the same and change the signal to benchmark
>  signals against each other.
> 
>  These kinds of things are vitally related to the design process.
> 
>  After I think I have an interesting trade I look at expectancy/PA%
> to
>  see if I it is profitable cf to costs (commissions etc - I don't
>  include commissions in backtests - I add them mentally later).
> 
>  Since ave%W/ave%L is only a ratio it is possible to have good PF
> but
>  not have a paying system e.g. if your ave win is 0.2% and your ave
>  loss is 0.1% you have a good ratio but you dont actually win much
>  i.e. the expectancy is low.
> 
>  It also brings risk into the equation since if you increase the
> risk
>  (move your stops) for the same PF the Expectancy goes up.
> 
>  Eventually you have to look at the %PA since that pays the annual
>  grocery bill.
> 
>  Obviously high frequency * high expectancy is a very exciting year
>  e.g. I consider turn around time for my systems - it is great to
> have
>  a high powered trade but if you are in for two days and then have
> to
>  wait 6 days for another trade to come along your frequency/PA%
> comes
>  right down.
> 
>  There is a lot in what I am saying - I have spent 100 of hours in
>  theroretical and practical consideration of evaluation - I have
> only
>  put a cryptic explanation here.
> 
>  (In my first post I also meant to add that variance in the equity
>  curve is derived from binomial probability of the W/L and variance
> in
>  the distribution of the trades, where the trades are measured in %
>  +_ )
> 
>  I understand that is probably a bit more info than you wanted but I
>  have talked about it a little in the past here and there and I
>  promised a couple of guys I would explain some more one day - today
>  was the day.
> 
> 
>  brian_z
> 
>  --- In amibroker@xxxxxxxxxxxxxxx, ChrisB <kris45mar@ wrote:
>  
>   Hi Brian
>  
>   Thanks for this extra comment.
>  
>   Your immediate prior post had me confused because by PF I assumed
>  you
>   meant Profit Factor and
>   the nearest I can understand this, is that
>  
>   Profit Factor = Gross Profit / Gross Loss
>   or as in the AB reports:
>   Profit Factor = Total Profit / Total Loss.
>  
>   I didn't understand how this related to a time series or per
> annum
>  gain.
>  
>   However reading between the lines of this last post, I think you
>  may be
>   referring to van Tharp's (was it he who coined this phrase? )
>   Profitunity factor?
>  
>   Where ....
>  
>   Profitunity = Expectancy per trade * number of trades per time
>  period.
>  
>   In which case it makes a little more sense to me.
>  
>   If not, I am happy to stand corrected.
>  
>   Regards
>  
>   ChrisB
>   brian_z111 wrote:
>   
>     I like PF (a derivation of it) and expectancy is really PF
>    translated
>     in return over time (PA%).
>   
>    FTR - to explain further what I meant about PF (my take on it).
>   
>    PF is the trades profile (a kind of quality measure) comprising
>  two
>    components (W/L ratio and ave%W/ave%L ratio).
>    The W/L ratio tells us something about the buy signal whereas
> the
>  %
>    W/L ratio tells us something about the exits (profit and loss
>  stops)
>    although they are interdependent.
>   
>    The W/L ratio is binomial and indicates the tendency towards
> runs
>    (losing/winning streaks) and the %W/%L quantifies that e.g. as
> an
>    equity curve.
>   
>    PF is the theoretical edge (as ratio).
>   
>    Looking at the two components of PF can tell us more about the
>  trade
>    than looking at PF alone.
>   
>    Expectancy standardises the edge (PF) to a per trade basis and
>    quantifies it (as %).
>   
>    Expectancy * trade frequency (trades per periods e.g. year)
>    quantifies the edge as return per period e.g. year.
>   
>    brian_z
>   
>    --- In amibroker@xxxxxxxxx ps.com
>    <mailto:amibroker%40yahoogroups.com, "brian_z111"
>  <brian_z111@ ...
>    wrote:
>    
>     Chris,
>    
>      This won't help you much but I thought I would chip in here,
>    anyway.
>    
>     On the contrary - I think it is very apt and insightful.
>    
>      I used to spend *hours* every week manually updating data
> etc
>      . What an agonising waste of time!.
>    
>     I agree with you.
>     Efficient use of time (a.k.a what works?) and leaving risk
>  behind
>    are
>     two major drivers behind the development of my style e.g.
>    fundamental
>     analysis requires a constant renewal of information whereas
> with
>     technical analysis the acquisition phase diminishes with time.
>    
>      Support and resistance are
>      still at the same level, and is never tick precise.
>    
>     I agree S&R is not tick precise.
>     In fact I am inclined to the view that it is generally a
> little
>     imprecise.
>    
>     Take a classical (theortical) example of support - one buyer
>  with
>     enough clout to make a difference is buying at a target - say
>  it is
>    a
>     whole number $20.00. In real life he or she is a person with
>    emotion
>     so 20 becomes 19.95. Also in real life the order has to be
>    physically
>     filled so spreads and market movement around 20.00 means 'buy
> at
>    20'
>     becomes +- 0.20.
>    
>     I am not a long term intraday trader but my observations so
> far
>  at
>     that S&R are easily identified on intraday charts than EOD
>  charts.
>    
>      The issue is: is the expectancy positive and can I continue
> to
>     trade
>      this. All three maintained a positive expectancy and when
> this
>    fell
>     away
>      this was the "stop trading this system" signal.
>    
>     I agree that expectancy is a significant metric.
>     I like PF (a derivation of it) and expectancy is really PF
>    translated
>     in return over time (PA%).
>    
>     PF is like the HP of an engine.
>     The more grunt you have the less you are affected by the
> little
>    bumps
>     (data errors, slippage, variance etc).
>    
>     Even a coin with a strong bias will produce its run of outs.
>    
>    
>     Thanks for your post,
>    
>     Good stuff.
>    
>     brian_z
>    
>    
>    
>     --- In amibroker@xxxxxxxxx ps.com
>    <mailto:amibroker%40yahoogroups.com, ChrisB <kris45mar@ wrote:
>     
>      Brian
>     
>      This won't help you much but I thought I would chip in here,
>    anyway.
>     
>      I used to spend *hours* every week manually updating data,
>    checking
>      splits consolidations rights issues etc every week with
> data
>  from
>      Justdata comparing with ASX published data in the back of
> the
>  old
>     Shares
>      magazine. What an agonising waste of time!.
>     
>      Now I only look at Fx. With this being retail broker based
> the
>    data
>     is
>      never clean.
>     
>      Toward the end of last year I ran a simple once a day
> system
>  on
>     three
>      different (demo: yes I know) platforms, entering Limit
> entries
>    for
>     the
>      day in the morning and off to work for the day, as a kind
> of
>  real
>     time
>      walk forward test. Surprising how much time this took to do.
>     
>      In the evening most times all three platforms had either
>  filled
>    my
>      orders or not, but it was surprising to see how many times
>     Platform1 and
>      Platform2 would have filled my limit entry, and one of them
>  had
>    got
>      stopped out, whereas the other had got to the Take Profit.
> On
>    other
>     days
>      Platform1 and Platform2 would have filled my entry order but
>     Platform3
>      ran without me: a missed trading opportunity.
>      At the end of the month all three platforms were in profit,
>  just
>    by
>      different amounts.
>     
>      Because I get my Fx data through MT3 plugin these are not
>  exactly
>     the
>      same prices as my live trading account.
>      To be honest I don't think this matters. Support and
>  resistance
>    are
>      still at the same level, and is never tick precise.
>      Others may choose to disagree.
>     
>      Just following three Fx data providers will show you by how
>  much
>     each
>      can differ, notwithstanding the different time zones and
>    therefore
>      differing candles we get. And that is not even talking about
>     economic
>      news times!
>     
>      The lesson for me was clear : the individual trade result is
>     irrelevant.
>      The issue is: is the expectancy positive and can I continue
> to
>     trade
>      this. All three maintained a positive expectancy and when
> this
>    fell
>     away
>      this was the "stop trading this system" signal.
>     
>      That to me is one of the advantages of Fx : no database
>  hassles.
>    No
>      company reports, no shareholder statements, no Chess holder
>     statements
>      and the inevitable shareholder bits of paper coming through
>  the
>     mail
>      after I have long closed the trades.
>     
>      The other way to think about it would be: well if Provider1
>  has
>      different Ticks to Provider2, just backtest and optimize
> for
>  each
>      respectively over the same time frame and the same tickers.
> If
>    your
>      parameters and results differ widely this may be a message
>  that
>     your
>      system is marginal. On the other hand, if all is well and
> the
>     results
>      are very similar, you have just done your own "should I
> care
>  how
>     clean
>      my data is?" test.
>     
>      Regards
>      ChrisB
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/