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

Re: [amibroker] Re: Perfect Profit and DOF



PureBytes Links

Trading Reference Links

> We might be reading different books. In my book, Design, Testing and
> optimization of Trading Systems written in 92. He defines PP as the
> dollar profit resulting from buying every valley and selling every
> peak that occurs in price movement. There isnt any example here. But
> I interpret that as the peaks and valleys that are of interest to my
> system. I dont see any point in including peaks and valleys that my
> system aren't even looking at.

Paul, but that's exactly the logic of this approach, IMHO. The fact that 
your trading system isn't looking at a lot of (tradeable) peaks and 
valleys shows that it is inefficient to a certain degree. By comparing 
the net profit of your system with PP (which is the theoretical maximum 
profit you can get from the same time series) you can see how 
inefficient it actually is. The number of trades is irrelevant. (I 
guess you wouldn't compare two trading systems only if they have the 
same number of trades, would you?) 

Well, that's how I understand it.

Regards,

Thomas

>
> --- In amibroker@xxxxxxxxxxxxxxx, Thomas Ludwig <Thomas.Ludwig@xxx>
>
> wrote:
> > > In an ideal world ie in a PP situation
> > > we would have no drawdown and 100% winrate.
> > > But I think PP would have the same no of trades, and roughly the
>
> same
>
> > > exposure as the real system.
> >
> > Paul, I don't think this is correct if you look at how Pardo
>
> describes
>
> > PP.
> >
> > Regards,
> >
> > Thomas
> >
> > > So I'm not sure if I understand what you
> > > meant by "the most profitable trading delta/frequency" Would you
>
> like
>
> > > to elaborate?
> > > /Paul.
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, Dennis Brown <see3d@> wrote:
> > > > > Now a few questions to both Thomas and Dennis
> > > > > What kind of insights can one obtain with this comparsion?
> > > > > and
> > >
> > > How do
> > >
> > > > > you intend to use it? And would you mind post some of your
> > >
> > > findings?
> > >
> > > > > Cheers
> > > > > Paul.
> > > >
> > > > Paul,
> > > >
> > > > The first insights are just the normal ones around the most
> > >
> > > profitable
> > >
> > > > trading delta/frequency.  I also use this as the denominator to
> > > > determine the relative efficiency of a system relative to what
>
> the
>
> > > > market is offering, and to determine the shifting nature of the
> > >
> > > market
> > >
> > > > over time.  I use it with broad market indexes, not individual
> > > > issues.  I am still experimenting with it to discover new ways
>
> to
>
> > > use
> > >
> > > > this information.
> > > >
> > > > BR,
> > > > Dennis
> > > >
> > > > On May 16, 2008, at 11:20 PM, Paul Ho wrote:
> > > > > Thomas
> > > > > I think the model efficency can be calculated in the CBT
>
> without
>
> > > > > directly getting PP, This can be done by obtaining the
> > > > > Theoretical buy point (tbp) around the actual buy point, and
> > > > > obtaining tsp
> > >
> > > around
> > >
> > > > > the sell point.
> > > > > The tbp can happen either before or just after the buy point.
> > > > > first look at the before scenario, you can either use trough
>
> or
>
> > > LLV
> > >
> > > > > function. the problem with the trough function is that the
> > > > > low obtained from Trough() could be quite far away. Lets say
> > > > > we
>
> use
>
> > > LLV
> > >
> > > > > (L, pds) where pds is half the average bars held obtained
> > > > > directly from CBT metrics
> > > > > so tbp_before = LLV(L, bars/2)
> > > > > To find tbp_after we can use the mae metrics from backtest
> > >
> > > directly
> > >
> > > > > tbp_after = (1 + mae)*buyprice;
> > > > > tbp = min(tbp_before, tbp_after);
> > > > > The cbt code for tbp could be as follows:
> > > > > ....
> > > > > bo = GetBacktesterObject();
> > > > > bo.Backtest();
> > > > > st.bo.GetPerformanceStats(0);
> > > > > bars = st.GetValue("AllavgBarsHeld");
> > > > > me = 0; //stores the sum of model eff per trade
> > > > > for( trade = bo.GetFirstTrade(); trade; trade =
>
> bo.GetNextTrade
>
> > > () )
> > >
> > > > > {
> > > > >   sym = trade.Symbol;
> > > > >   mae = trade.GetMAE();
> > > > >   lp = foregin(sym, "L");
> > > > >   tbp_before = lastvalue(valuewhen(datetime()==
> > >
> > > trade.EntryDateTime,
> > >
> > > > > LLV(lp,bars/2)));
> > > > >   tbp_after = (1+mae)*trade.EntryPrice;
> > > > >   tbp = min(tbp_before, tbp_after);
> > > > >   ........
> > > > >   tsp = max(tsp_before, tsp_after);
> > > > >   theoreticProfitratio = tsp/tbp;
> > > > >   realprofitratio = trade.ExitPrice/trade.EntryPrice;
> > > > >   me += realprofitratio/theoreticProfitratio;
> > > > > }
> > > > > .... // do the same with open position
> > > > >   mean_me = me/st.GetValue("AllQty");
> > > > > There are a number of variations depending on your perference
> > > > > 1. You can use trough and peak instead of LLV and HHV
> > > > > 2. instead of average ME, you can go for accumulated ME by
> > >
> > > dividing
> > >
> > > > > real profit / theoretical profit. Not sure the figure would
> > > > > be too small to make a lot of sense.
> > > > > 3. you can use geometric average instead of arithmetic
> > > > > average
> > > > >
> > > > > Now a few questions to both Thomas and Dennis
> > > > > What kind of insights can one obtain with this comparsion?
> > > > > and
> > >
> > > How do
> > >
> > > > > you intend to use it? And would you mind post some of your
> > >
> > > findings?
> > >
> > > > > Cheers
> > > > > Paul.
> > > > >
> > > > > --- In amibroker@xxxxxxxxxxxxxxx, Dennis Brown <see3d@> wrote:
> > > > >> Thomas,
> > > > >>
> > > > >> That is what I do.  Though I also add all the trading
>
> overhead
>
> > > > >> as
> > > > >
> > > > > if
> > > > >
> > > > >> it were real trades, then adjust the % change to the maximum
> > >
> > > total
> > >
> > > > >> profit which gives you a lot more insights.
> > > > >>
> > > > >> BR,
> > > > >> Dennis
> > > > >>
> > > > >> On May 16, 2008, at 1:35 PM, Thomas Ludwig wrote:
> > > > >>> Hi all,
> > > > >>>
> > > > >>> Rober Pardo suggests in his book "The Evaluation and
> > >
> > > Optimization
> > >
> > > > > of
> > > > >
> > > > >>> Trading Strategies" the calculation of "Perfect Profit"
> > > > >>> (PP)
> > > > >
> > > > > which "is
> > > > >
> > > > >>> the sum total of all of the potential profit that could be
> > > > >
> > > > > realized by
> > > > >
> > > > >>> buying every bottom and selling every top". By comparing
> > > > >>> Net
> > > > >
> > > > > Profit of
> > > > >
> > > > >>> your trading system with PP you can calculate the "Model
> > > > >
> > > > > Efficiency"
> > > > >
> > > > >>> (ME).
> > > > >>>
> > > > >>> I think PP can be easily calculated as a stand-alone code
> > > > >>> by applying a,
> > > > >>> say, 1% Zigzag. But how can it be done if I want to add ME
>
> as
>
> > > > >>> an additional metric in the Custom Backtester? The Equity()
> > >
> > > function
> > >
> > > > > is
> > > > >
> > > > >>> used for your trading system and cannot be used for the
>
> Zigzag
>
> > > > > system
> > > > >
> > > > >>> at the same time in order to compare both, IMHO. So the
> > > > >>> only solution I
> > > > >>> can think of is to loop through all Zigzag signals and
> > > > >>> calculate
> > > > >
> > > > > the
> > > > >
> > > > >>> profit programmatically. Or am I overlooking something?
> > > > >>>
> > > > >>> Pardo also suggests to calculate the Remaining Percentage
> > > > >>> of
> > > > >
> > > > > Degrees
> > > > >
> > > > >>> of
> > > > >>> Freedom (through Used Dgrees of Freedom and Original
>
> Degrees of
>
> > > > >>> Freedom). Any idea if and how they can be counted in AFL?
> > > > >>>
> > > > >>> Regards,
> > > > >>>
> > > > >>> Thomas
> > > > >>>
> > > > >>> ------------------------------------
> > > > >>>
> > > > >>> 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
> > > > >
> > > > > ------------------------------------
> > > > >
> > > > > 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
> > >
> > > ------------------------------------
> > >
> > > 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
>
> ------------------------------------
>
> 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
>
>
>


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

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/