- Joined
- 28 December 2013
- Posts
- 6,392
- Reactions
- 24,319
At the Platinum level, this is not required as your backtesting code accesses a "Current & Past" watchlist where the security will remain, and you'd use the NorgateIndexConstituentTimeSeries function in your trading rules.
S&P relies on Market Cap..... Does it not?I'm disgusted that speculative stocks like AVZ and BRN get into the ASX200 in the first place.
Note: BRN is finally being removed from the ASX200 soon (Sept 18th).
But another speculative company WBT is getting into the ASX200. Come on, S&P get serious.
That actually explains some of the weird behaviour I experienced on a couple of packets years agoView attachment 161951
@Richard Dale, I appreciate your assistance in providing the "S&P/ASX Australian Indices Methodology PDF." It has shed light on an important aspect that I would like to further clarify.
Currently, I am subscribed to the "Silver" subscription level and have learned from the PDF that the rebalancing of the S&P/ASX Australian index series takes place regularly. The trading data is referenced to the second-to-last Friday of the month prior to the rebalancing.
Specifically, the All Ordinaries index, which is the index I exclusively trade, undergoes annual rebalancing, occurring after the market closes on the third Friday of March. Consequently, the entire S&P/ASX index series is rebalanced after the market closes on the third Friday of March.
Now, here is my question
Consider a scenario where my strategy, implemented through Amibroker with the "Filter" Watchlist and the selection of the "All Ordinaries," generates a buy signal before the market closes on the third Friday of the month of March. In this case, after the All Ordinaries is rebalanced, the buy signal gets downgraded and removed from the "All Ordinaries Index." This poses a significant dilemma, as it implies that I would never receive a "SELL" signal, which could have disastrous consequences for a trader who relies on following strategy signals.
# Am I correct in assuming this, and if so, do you have any suggestions on how I can overcome this issue?
Thank you for your attention to this matter, and I eagerly await your guidance on addressing this challenge effectively.
Skate.
S&P relies on Market Cap..... Does it not?
If you want to enter at next day open, then do that with an appropriate order type (with reduced order quantity to allow your system a bit of leeway with respect to capital).
Well I'm glad you've decided to stopped being alarmist about normal market behaviour (open next day versus close previous day). I find it weird you portrayed this as a severe limitation of backtesting.
I fail to understand the issue there .View attachment 161966
# Backtest Portfolio Report - as of the close on Friday 1st of September
If you have the patience to follow along I will show you the changes the portfolio Backtest report makes from the end-of-trade Friday to the opening of the markets (today) - Monday 4th September 2023. The report is like chalk and cheese and not to be trusted trading from this report
The Amibroker Backtest Portfolio report drastically changes between the end-of-week close prices on Friday and the actual market open prices on Monday, illustrating the severe limitations of relying solely on backtested simulations without supplemental validation when committing real capital.
# Portfolio Backtest Report - Friday 1st of September 2023
View attachment 161969
# Portfolio Backtest Report - After the markets open on Monday 4th of September 2023
View attachment 161970
Full evaluation
Here is an improved in-depth comparison and evaluation of trading using the Amibroker Backtest Portfolio feature based on the two provided reports:
Summary - 1
(1) Trading strategies based solely on Amibroker backtests can lead to misleading expectations of performance. Backtests use historical data and cannot account for future price movements.
(2) The two reports illustrate the risks of relying on backtest simulations. The share prices after the market opened were higher than the historical data used in the initial backtest.
(3) This led to lower share quantities being purchased and less remaining cash than initially projected. The portfolio value was ultimately higher due to the increased prices, but this outcome could not have been predicted.
(4) Backtests can provide useful insights into strategy logic and mechanics but have limitations for estimating actual future performance. Real-time paper trading and rigorous manual testing should supplement backtesting.
(5) Key factors like execution slippage, spread costs, and trading commissions can significantly impact performance but are not captured in backtests. Amibroker assumes perfect no-slippage entry and exit.
(6) Overall, backtesting provides an optimistic estimate of returns. Strategies should not rely solely on backtest simulations and require supplemental validation through other means before committing real capital.
Individual Stock Comparison:
IVZ.au
- Backtest Limitation:
- Failed to predict +15.6% price increase after open
QOR.au
- Backtest Limitation:
- Failed to predict +19.1% price increase after open
LRS.au
- Backtest Limitation:
- Failed to predict +8.8% price increase after open
DLI.au
- Backtest Limitation:
- Failed to predict +6.5% price increase after open
PDN.au
- Backtest Limitation:
- Failed to predict +6.5% price increase after open
SSM.au
- Backtest Limitation:
- Failed to predict +2.8% price increase after open
EML.au
- Major Backtest Limitation:
- Failed to predict +54.4% price increase after open
NXL.au
- Backtest Limitation:
- Failed to predict a +2.9% price increase after open
Summary - 2
Backtests have limitations that require supplemental validation before committing real capital. The reports illustrate the risks of over-reliance on simulated historical performance data. Here is an in-depth comparison of each security between the two Amibroker Backtest Portfolio reports:
IVZ.au
# Before Open:
- Buy signal, score 99.82
- Price: 0.16
- Shares: 67,117
- Commission: 15.99
- Equity contribution: $99,968.02
# After Open:
- Buy signal, score 99.82
- Price: 0.185 (+15.6% higher than before open)
- Shares: 58,047 (-13.5% lower than before open)
- Commission: 15.99
- Equity contribution: $99,968.02 (same)
QOR.au
# Before Open:
- Buy signal, score 99.72
- Price: 0.235
- Shares: 45,697
- Commission: 15.99
- Equity contribution: $99,936.04
# After Open:
- Buy signal, score 99.72
- Price: 0.28 (+19.1% higher than before the open)
- Shares: 38,352 (-16.1% lower than before the open)
- Commission: 15.99
- Equity contribution: $99,936.04 (same)
LRS.au
# Before Open:
- Buy signal, score 99.62
- Price: 0.34
- Shares: 31,584
- Commission: 15.99
- Equity contribution: $99,904.06
# After Open:
- Buy signal, score 99.62
- Price: 0.37 (+8.8% higher than before the open)
- Shares: 29,023 (-8.1% lower than before the open)
- Commission: 15.99
- Equity contribution: $99,904.06 (same)
DLI.au
# Before Open:
- Buy signal, score 99.2
- Price: 0.775
- Shares: 13,856
- Commission: 15.99
- Equity contribution: $99,872.08
# After Open:
- Buy signal, score 99.2
- Price: 0.825 (+6.5% higher than before open)
- Shares: 13,016 (-6.0% lower than before open)
- Commission: 15.99
- Equity contribution: $99,872.08 (same)
PDN.au
# Before Open:
- Buy signal, score 99.125
- Price: 0.845
- Shares: 12,708
- Commission: 15.99
- Equity contribution: $99,840.10
# After Open:
- Buy signal, score 99.125
- Price: 0.9 (+6.5% higher than before open)
- Shares: 11,932 (-6.1% lower than before open)
- Commission: 15.99
- Equity contribution: $99,840.10 (same)
SSM.au
# Before Open:
- Buy signal, score 99.095
- Price: 0.89
- Shares: 12,066
- Commission: 15.99
- Equity contribution: $99,808.12
# After Open:
- Buy signal, score 99.095
- Price: 0.915 (+2.8% higher than before open)
- Shares: 11,736 (-2.7% lower than before open)
- Commission: 15.99
- Equity contribution: $99,808.12 (same)
DYL.au
* No difference in share price, quantity, commission, or equity contribution before and after the open
EML.au
# Before Open:
- Buy signal, score 98.89
- Price: 0.745
- Shares: 14,414
- Commission: 15.99
- Equity contribution: $99,744.16
# After Open:
- Buy signal, score 98.89
- Price: 1.15 (+54.4% higher than before open)
- Shares: 9,338 (-35.2% lower than before open)
- Commission: 15.99
- Equity contribution: $99,744.16 (same)
NGI.au
* No difference in share price, quantity, commission or equity contribution between before and after open
NXL.au
# Before Open:
- Buy signal, score 98.44
- Price: 1.54
- Shares: 6,863
- Commission: 15.99
- Equity contribution: $99,680.20
# After Open:
- Buy signal, score 98.44
- Price: 1.585 (+2.9% higher than before open)
- Shares: 6,668 (-2.8% lower than before open)
- Commission: 15.99
- Equity contribution: $99,680.20 (same)
Summary - 3
(a) All stocks except DYL and NGI had higher prices after the opening than before the opening.
(b) The increased stock prices resulted in lower share quantities purchased to stay within the available equity.
(c) Total equity contribution remained the same for each position between the two reports.
(d) Higher stock prices led to higher total portfolio value after opening ($100,424.86) compared to before opening ($109,999.25).
(e) Remaining unused cash was lower after opening ($0.96) than before the opening ($0.73).
Skate.
I should have read David and Skate responses..all in agreement ultimately.so my post of limited valueI fail to understand the issue there .
The backrest results are not modified only the execution of the orders.
You need to ensure your code enforce your limit in price if any or you run with whatever price is at open.
When trading, I give a margin to my purchase price so that potentially prevent it from being executed if a gap up occurs.
Likewise the packet $ value will be different from backtests planned one as my orders are for a fixed number of shares, not a dollar value..that is a broker limitation
You either acknowledge that or try to code it so that backtests of past purchases include these limitations when possible.
There is nothing wrong looking forward in your code to ensure the amount purchase in backtest is based on the next open price.
That assumes that you can buy at open price..not a given but usually right as your real broker order can have a margin..but only within a limited range
Anyway, not surprised and yes it is near impossible to code gap up in AB..I noticed "backrest" a lot..self corrected.i tried to fix this but might not be failproof
I should have read David and Skate responses..all in agreement ultimately.so my post of limited value
@Captain_Chaza, let me answer your question the sequence from previous posts on the subject.What I cannot comprehend is how you can use the 3% rule on the OPEN in all classes of sail
My goal is to get filled at the opening price
To accomplish this, the strategy bids 3% above the previous closing price. Using this technique, I'm able to get filled 99.99% of the time. The strategy makes trading simple by automating these complex decisions. But there's some sophisticated logic running under the hood!
That is the same as saying BUY Property Property Proppetry
as if Toorak in Melbourne is the same as Footscray or Bendigo in Victoria
I asked you earlier to put a Market Capitalization on your selections It fell on deaf ears
What a tried to tell you is that Heavy, Middle and Light weighted sails need to be handled differently on the OPEN
Your 3% Rule won't work on all!
I trade weekly systems where the buy and sell signals are generated after the close on Fridays. I then place those orders in the pre-auction at a 3% premium to the prior close's price, if my "Percentage Up" buy filter is true. If the price gaps up above my 3% premium level, my order won't get filled. I don't chase the price - using this pre-auction strategy with the premium takes the guesswork out of trying to time entries. Even with this approach, there's still a risk my order fails to execute due to a "gap up". Whether the 3% premium secures the open price or not, a buy order not filling has minimal impact on my strategy's overall profitability. I hold 10 positions in the portfolio, so one missed trade won't make or break the performance. The gaps tend to average out over many trades anyway.
IMHO The Best Ones will alway get away without you!
THIS makes a mockery of ALL Backtesting
What about doing a few hard yards ?
Ocean exercises on all types of Sails
Eg :How many of your Top ten got satisfied on MONDAY on the OPEN
BTW I am a strong Believer and Lover of GREEN CANDLESTICKS
and trade the OPEN 95% of the time
The other 5% unfortunately all usually tend to be bad mistakes
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?