• Australian (ASX) Stock Market Forum

Hello and welcome to Aussie Stock Forums!

To gain full access you must register. Registration is free and takes only a few seconds to complete.

Already a member? Log in here.

Dump it Here

Discussion in 'Beginner's Lounge' started by Skate, Dec 17, 2018.

  1. Lone Wolf

    Lone Wolf

    Posts:
    436
    Likes Received:
    146
    Joined:
    Dec 4, 2008
    Out of interest Skate, would you mind showing us the backtest results for the system over the first week? You would expect it to match, it's good to check that it does.
     
  2. willoneau

    willoneau

    Posts:
    1,312
    Likes Received:
    608
    Joined:
    Aug 27, 2017
    You
    You already have it , 19 open positions.
     
  3. Skate

    Skate

    Posts:
    1,992
    Likes Received:
    8,883
    Joined:
    Dec 28, 2013
    @Lone Wolf a backtest over one week as you said "you would expect it to match" the actual trading results but you would be wrong. I've explained a few posts back that Aimbroker uses dumb maths (in hindsight) it's a very clever scientific calculator calculating the optimal numbers but it's not smart enough to understand how the pre-auction works let alone the (+/- 3% premium) used for calculating the number of shares to buy.
    Let's recap
    1. Buy positions - the maximum dollar cost is known if the (+3% premium) is fully exercised (usually, it isn't) but the number of shares purchased in Amibroker can differ.
    2. ASX uses dumb maths as well as it multiplies the number of shares (X) the opening price to work out the executed value.
    3. Let's say the last closing price is $1.00 but in the pre-auction, we offer a (+3% premium) which is $1.03
    4. The bet size is $1,000/1.03 = 970 shares to be purchased - let's reverse the calculation 970 shares at 1.03 = $999.10 but here's the rub we don't know the opening price yet.
    5. As we don't know the opening price we have no idea what the execution cost is going to be.
    6. Let's say for example the position opens at the closing price of $1.00 - we would be executed 970 shares at $1.00 = $970
    7. But Amibroker (in hindsight) uses dumb maths to work out the backtest results because "it knows the opening price" so it simply calculates the shares purchased being 1,000 instead of the actual 970
    8. One simple mathematical error multiplied many times the backtest results become inaccurate.

    Let me give you 3 examples
    Let's compare the Backtest results with actually executed positions as displayed in Share trade Tracker (boxed in red) It's also important to highlight that the portfolio manager displays to 2 decimal places in the report but is accurate up to 6 decimal places. (the P&L will reflect the true value when the position is sold)
    Capture open summary.JPG

    Backtest results
    Capture questions GRR 3.JPG ----> The Amibroker Backtest thinks we have purchased 4,234 shares instead we actually purchased 3,980 shares
    Capture questions REX 3.JPG ----> The Amibroker Backtest thinks we have purchased 1,099 shares instead we actually purchased 1,081 shares
    Capture questions WGX 3.JPG ----> The Amibroker Backtest thinks we have purchased 421 shares instead we actually purchased 454 shares

    Dumb maths
    Actual trading will differ from a backtest results for this & many more reasons. One recent example was an explanation by @Saqeeb about a position in a trading halt as posted below but Amibroker is not smart enough to know this "but take it from me" Amibroker has included that buy position in his backtest report. Amibroker doesn't even take into account that from time to time some companies are suspended from trading but Amibroker will consider the position taken skewing the backtest results.
    Summary
    Skate.
     
  4. Skate

    Skate

    Posts:
    1,992
    Likes Received:
    8,883
    Joined:
    Dec 28, 2013
    blue squiggle - RULES.jpg

    It's important to follow the rules
    The Action Strategy is a weekly trend following strategy that doesn’t have many rules to follow but some traders don't have enough resilience to do it consistently. Impatience is one of the biggest reasons traders like to override their system because many are not willing to wait patiently & “do nothing” while a trend moves in the right direction. This means we will have lots of small losses, waiting for the movers & shakers to come along.

    Skate.
     
    aus_trader and Saqeeb like this.
  5. willoneau

    willoneau

    Posts:
    1,312
    Likes Received:
    608
    Joined:
    Aug 27, 2017
    Hi Skate, did you say there was another buy order for Monday?
     
  6. Skate

    Skate

    Posts:
    1,992
    Likes Received:
    8,883
    Joined:
    Dec 28, 2013
    Yes, there is a buy order for this week & it has been placed. https://www.aussiestockforums.com/posts/1072758/

    As you have missed it I might upgrade the graphic so it more prominent - give me a second...

    Skate
     
  7. Skate

    Skate

    Posts:
    1,992
    Likes Received:
    8,883
    Joined:
    Dec 28, 2013
    Logo with Update.jpg
    blue squiggle - Placed in the pre-auction.jpg
    5.2 SATURDAY Order 3rd capture.JPG

    Skate.
     
  8. willoneau

    willoneau

    Posts:
    1,312
    Likes Received:
    608
    Joined:
    Aug 27, 2017
    Sorry I just assumed it was an example you were giving.
     
    qldfrog and Skate like this.
  9. willoneau

    willoneau

    Posts:
    1,312
    Likes Received:
    608
    Joined:
    Aug 27, 2017
    I decided to place order at $990 with limit of 0.87 which gives me a value of $999.19 if filled at 0.87.
    Just noticed that the number of shares is 1137 which equals $980. I think it is adjusted for the $20 commission, not $10 when less than $1000.
    So changed it to 1143 as per Skate's.
     
    aus_trader and Skate like this.
  10. qldfrog

    qldfrog

    Posts:
    5,020
    Likes Received:
    3,861
    Joined:
    Jun 8, 2008
    Skate likes this.
  11. Skate

    Skate

    Posts:
    1,992
    Likes Received:
    8,883
    Joined:
    Dec 28, 2013
    On each Saturday I'll post positions placed in the pre-auction as I've done here: https://www.aussiestockforums.com/posts/1072888/

    1. Friday's Update
    Friday will be for weekly portfolio performance updates

    2. Saturday's Update
    This is when I'll display the screen capture of orders placed in the pre-auction

    3. Monday's Update
    After the orders have been executed I'll post the "Open Summary" & "Dashboard" as confirmation they have been included in the portfolio.

    Let's alleviate confusion
    To alleviate confusion I've listed which days I'll be posting & why. Also, I'll update the Action Strategy reporting to reflect the summary of the portfolio to be inclusive of the "trading rules". So you don't have to read them over & over I'll have a separator to acknowledge the updated post follows on from here. The reason for this is when others join in down the track they don't have to search for the trading rules of the Action Strategy.

    Skate.
     
    aus_trader, qldfrog and Saqeeb like this.
  12. Lone Wolf

    Lone Wolf

    Posts:
    436
    Likes Received:
    146
    Joined:
    Dec 4, 2008
    Apologies if I'm overlooking it, but I've looked through all the recent posts and still don't see it.
    What I can see is Skate's list of open positions. This is not the same as an amibroker backtest. It's important to know that your explore list matches the backtest. If you get different stocks in the backtest compared to the explore then you have a problem.

    It's not clear to me whether the backtest will show Myer as an open position. Skate has said there will be no sell signal. But that doesn't confirm it's not in the backtest. That might just be because Skate will only look for sell signals in stocks he currently holds. Why is this important to me? Only because we might have different opinions on what it means to follow the system rules, and I'm interested to know if that's true.
     
  13. qldfrog

    qldfrog

    Posts:
    5,020
    Likes Received:
    3,861
    Joined:
    Jun 8, 2008
    Dear Mr Skate and followers,
    I did not like too much the known difference between execution with a predefined gap on Monday open (be it 2% or 3%) and the fact backtests took as a fact that buy sell order were executed at open.
    The myer business this week for example;
    just added some amibroker code in my thread to close that gap: get an ASX compliant pricing to use and use it in backtests
    I am in no way an amibroker guru: AB is a tool, not a passion so feel free to tell me if you detect a bug error
    @Skate, feel free to cut/paste add to the Bible if you see fit.Have all a great day
    Note the code does not really reflect yet the day only execution plan of Mr Skate and match more an open for the whole week execution but better than nothing.
     
  14. qldfrog

    qldfrog

    Posts:
    5,020
    Likes Received:
    3,861
    Joined:
    Jun 8, 2008
    I have answered your dilemma before reading it, yes it was bothering me too
     
    Lone Wolf likes this.
  15. Rsthree

    Rsthree

    Posts:
    51
    Likes Received:
    126
    Joined:
    Jan 19, 2020
    I've e done a copy and paste of the strategy into my notes. Sometimes, no matter how simple, you need to review it a few times before it really sinks in. Or maybe I'm just getting old and senile
     
    Skate likes this.
  16. Lone Wolf

    Lone Wolf

    Posts:
    436
    Likes Received:
    146
    Joined:
    Dec 4, 2008
    That was very poorly worded on my part. But probably for the best as you've put forward some good discussion, thanks for that. I was thinking only that the list of stocks to enter should match. I accept there will be position size differences. (I also hadn't considered trading halts) @qldfrog had a recent experience where he found an error in his code by running a test on past data to ensure it matches his original explore list. I feel the importance of checking this is something worth highlighting.

    You are correct about all the differences that make real trading deviate from backtests. But isn't that even more reason to compare the live vs backtest results over the same period? Wouldn't it be good to get a feel for exactly how much of your original expected edge has been lost in live trading? Even if only to be able to factor that in when designing future systems and considering if they're worth trading? It looks like there might be some reluctance to show the backtest and it's not like I'm trying to insist on anything so I'll leave it there.
     
    Skate and qldfrog like this.
  17. CNHTractor

    CNHTractor

    Posts:
    77
    Likes Received:
    47
    Joined:
    Oct 6, 2011
    Hi Guys, let's not get bogged down - Skate's new entry was clearly shown yesterday.

    I am following the Action Strategy with interest. Let's focus on the process of following a mechanical system and the psychological barriers to doing so.

    As I write this, it seems to me the amount of questions around placing orders at what price and how many illustrate the "challenges" that one "overthinks" rather than, firstly accepting a strategy has a positive expectancy and therefore following it without exception.

    If you do not have a positive expectancy, there is no point in pursuing the strategy.
     
    Bazzi, Saqeeb and Skate like this.
  18. Lone Wolf

    Lone Wolf

    Posts:
    436
    Likes Received:
    146
    Joined:
    Dec 4, 2008
    I thought I might be missing something, I'm often missing something. But I still don't get the statement that Amibroker uses dumb maths. Amibroker will use what we tell it to use. Why can't we do that?

    Position size will need some work depending on how many positions you intend to max out at and what happens then. But for now Position size = Equity / 1000.
    Entry price for the purpose of determining the Qty of shares to buy = Close rounded up to 2 decimal places + 3%.
    Qty shares to buy = The rounded down value of $995 / Entry price as calculated above.
    This is what we use to determine the number of shares to buy, so why not tell Amibroker to do the same?
    Amibroker will now buy the next open with the same position size as us. The only thing left is to ensure the backtester doesn't enter trades if the open is higher than "Close rounded up to 2 decimal places + 3%", as that the rule we are following.

    Am I missing something?
     
    Skate likes this.
  19. Skate

    Skate

    Posts:
    1,992
    Likes Received:
    8,883
    Joined:
    Dec 28, 2013
    @Lone Wolf said:
    (a) "Skate has said there will be no sell signal. But that doesn't confirm it's not in the backtest" &
    (b) "It's not clear to me whether the backtest will show Myer as an open position"

    In a nutshell yes, Myer is included in the Amiboker backtest as an open position & as Myer is included in the backtest it excludes the next position (IGL on Monday)

    Cut from the backtest
    MYR Capture.JPG

    Backtesting means JACK
    I've stated before, backtest results mean "Jack" - but they do give an indication between test results using different parameters for evaluation. The next backtest report, won't include the buy in the pre-auction for Monday as the portfolio is already full.

    My Question
    Going forward, how will this backtest refect accuracy?

    "Skate has said there will be no sell signal"
    Ok, let me clear this up. I made it clear that the Action Strategy is not a signal service even though I posted the signals for the first week "as there was nothing to post about" in the hope of keeping the interest alive. With the weekly updates, only positions executed will be displayed so others can follow along without confusion. This means if I don't buy a position there will never be a sell displayed in the weekly updates & this is not to be confused with Amibroker Backtesting or Exploration Analysis signals.
    "It's important to know that your explore list matches the backtest"
    No, not really. Amibroker isn't smart enough to know when a stock is suspended or placed in a temporary trading halt. Also another issue, Amibroker takes the positions in order of "PositionScore" ranking without knowing the finer details of the stock or why there was a run-up in price. Just because a buy signal is generated doesn't automatically mean it's a buy without first passing our trading plan. The run-up in price due to "volume & volatility" needs to be understood in finer detail as there are somethings that can't be coded in. Amibroker is merely following a set of "coded rules" & it has no understanding of "market sentiment" that's where a trading strategy crosses swords with a trading plan. (there is a distinction)

    "Why is this important to me? Only because we might have different opinions on what it means to follow the system rules, and I'm interested to know if that's true"
    The market is completely chaotic & unpredictable due to the infinite amount of information pouring into the markets second-by-second & without the confidence in your trading plan, you won’t keep pulling the trigger. A trading plan is the heart & soul of trading & it shouldn't be confused with a trading strategy as they are totally different beast.

    Let me break trading into 3 parts
    Being a systematic trend trader there are 3 parts to the equation.
    Part (1) Your trading plan has the final say whether you trade the signals as given.
    Part (2) Your trading strategy is a signal service with no understanding of "market sentiment"
    Part (3) You need to have the necessary funds to action your trading plan/trading strategy.

    Skate.
     
    aus_trader, Bazzi, Saqeeb and 2 others like this.
  20. Lone Wolf

    Lone Wolf

    Posts:
    436
    Likes Received:
    146
    Joined:
    Dec 4, 2008
    "Just because a buy signal is generated doesn't automatically mean it's a buy"
    This is an important point that I was not aware of in this discussion. (I probably missed it) I was under the impression this was a purely code based trading system in which you trust the system and take the signals without hesitation. But if there's a discretionary element to stock selection that can't be coded then I understand why the backtest won't match.
     
    aus_trader, qldfrog and Skate like this.
Loading...

Share This Page