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

Re: [amibroker] Why portfolio backtester does not consider all buy signals?



PureBytes Links

Trading Reference Links

Hello,
 
" it "matches" it with a future Sell signal and remove all (future) Buy signals in the between"
 
In fact it does not do that. There is no need to know when/ if any any sell will be generated.
Electronic engineers are familar with flip-flop device which after initial input signals goes into "set" state
and remains in that state until "reset" signal arrives. It does not need to know the future.
It is the most simple state machine realizable without any lookahead. All it requires is one bit of memory to hold current state.
This is the way how it is implemented: buy signals "flips" the state to "on" position and
then it remains in "on" position until "sell" signal arrive (you don't need to know when it will arrive
- you are just going day by day).
While the state of "flip-flop" device is "on" it ignores any further "set" signals.
 
For more information
 

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: Mark H
Sent: Tuesday, April 25, 2006 6:24 PM
Subject: Re: [amibroker] Why portfolio backtester does not consider all buy signals?

TJ:
It was not my intention to "push" you to do anything. I apologize if I made you feel that way.
I am learning the low level backtesting and just wanted to express some of my thoughts.
I agree that "looking into the future" was not the right way to describe it. What I meant was that when the backtester sees a Buy signal, it "matches" it with a future Sell signal and remove all (future) Buy signals in the between. The problem was that the first Buy signal may not be taken at all in real trading due the lower position score.
OK, I think I should shut up now :-)
Thanks,
- Mark H.
 
----- Original Message -----
Sent: Tuesday, April 25, 2006 11:27 AM
Subject: Re: [amibroker] Why portfolio backtester does not consider all buy signals?

"To a certain extent, it is like looking into the future AFTER the trades have been taken, not just the signals at this moment of NOW."
 
This is completely FALSE statement.  It is in fact opposite - it works as simple as it is only possible and no future is referenced
- when you get initial signal - you just check if you have available funds
to open position - once you find that you don't have enough funds you simply forget about this trade at all.
 
Please don't push me by sending all the time the same request. I have answered many times and provided you with sample codes how to do what you
want with custom backtester (so you can use it now). I also said that I will consider adding a switch in some future version.
This is more than enough.
 
Some think that if they repeat the same over and over again it will speed up implementation - while it is exactly the opposite
- the more you push, the more time is spent on discussion instead of real work (programming).

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: Mark H
Sent: Tuesday, April 25, 2006 3:35 PM
Subject: Re: [amibroker] Why portfolio backtester does not consider all buy signals?

TJ:
 
In the low level backtest, which function removes all the "redundant" signals? I assume it is PreProcess()?
PreProcess()/EnterTrade()/ExitTrade()/ScaleTrade()/UpdateStats()/HandleStops()/PostProcess()
 
 
Regarding redundant signals, the more I think about it, the more I am convinced that the portfolio backtester should process all signals, not signal pairs based on trades.
My argument is that in real trading what you see first is a list of signals (sorted by positionscore), and make the top ones into trades, not ALL of them. Trades are after the fact. The portfolio backtester only considers signal pairs (trades) and removes "redundant" signals. To a certain extent, it is like looking into the future AFTER the trades have been taken, not just the signals at this moment of NOW.
 
I am sure by messing with the low level functions, this can be done. But a high level easy switch would be life saver :-)
 
Thanks,
- Mark
----- Original Message -----
Sent: Monday, April 24, 2006 11:40 AM
Subject: Re: [amibroker] Why portfolio backtester does not consider all buy signals?

Hello,
 
You need to REPLACE Buy/Sell rules with your OWN (where you can see // YOUR TRADING SYSTEM HERE)

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: Mark H
Sent: Monday, April 24, 2006 5:19 PM
Subject: Re: [amibroker] Why portfolio backtester does not consider all buy signals?

Ed:
Have you had any luck using TJ's sample code?
I plugged it in and ran a backtest. Then I got like close to $1billion loss!
The last trade was with 1e+010 shares. I thought it was a NULL value and padded my data, but still the same results.
I will look more into it and report back,
 
Thanks,
Mark H.
 
----- Original Message -----
From: emp62
Sent: Monday, April 24, 2006 8:27 AM
Subject: Re: [amibroker] Why portfolio backtester does not consider all buy signals?

thanks a lot it looks great at the first glance. So little code necessary to do it.  I am trying to build it into my current system at this moment,
 
rgds, Ed
 
 
----- Original Message -----
Sent: Monday, April 24, 2006 12:53 PM
Subject: Re: [amibroker] Why portfolio backtester does not consider all buy signals?

"Who has studied this?"
 
I have studied this and these are results of hundreds of my own tests of various systems I have done in the past.
 
But I can agree that you may have different opinions/experiences and you may want to test redunant signals.
And this is perfectly doable as I have shown using either rotational trading (for some cases) and/or
custom backtest procedure (for all remaining cases). I even wrote sample formula for you.
See this post:
 
(I have reposted this sample to the knowledge base know for your convenience):
 
Also as suggested, I may consider adding an "easy" switch in some future releases.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: emp62
Sent: Monday, April 24, 2006 8:11 AM
Subject: Re: [amibroker] Why portfolio backtester does not consider all buy signals?

> There are other reasons such as the fact that practice shows that delayed signals are very often very poor performer so it is better to skip trade instead of entering it too late.
> This may be true to many systems. But certainly not all of them. My most profitable system happens to do better with later signals. It buys dips and later signals are
> more likely to > bounce back. IMO, a backtest software should be neutral to trading systems (i.e. not to prefer a particular  kind of practice)
 
Who says delayed signals are poor performers.  Who has studied this?  I am certain that redundant signals can be used succesfully in portfolio type systems.  So my request is again to get a simple example of how to do this on a portfolio level. There are examples on a single symbol level but on a portfolio level is what is interesting.
 
rgds, Ed


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 other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS