• 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.

qldfrog weekly Skate inspired system

Discussion in 'Trading Diaries and Journals' started by qldfrog, Feb 25, 2019.

  1. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    Following both a change of circumstances and the trigger of the Dump it thread by Skate, I decided to plunge again into system trading.
    Based on code provided initially by Skate and after discussions with @Lone Wolf, @Newt, @jjbinks and @Habakkuk and @Wyatt, I heavily tweaked the initial code and ended up with a relatively stable system
    various backtests on various periods as well as some walk forward tended to reassure me a bit.
    I expect a market crash relatively soon and the earlier this happens the hardest I could be hit but I need to start one day;
    Weekly to allow ongoing even if traveling O/S
    100000$ initial amount, reinvested in full
    20 positions max
    10$ a trade
    both exit and enter baed on system
    XAO as universe
    Let's start
    Note that I am not fully happy with the exit and DD, and as time goes I might refine the systems with conditional stop loss etc
     
    CanOz, peter2, jjbinks and 5 others like this.
  2. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    while still bringing in funds to start the system, today was opening day:
    I purchased the following:

    BRG : 324 @15.41
    JIN 476 @ 10.53105
    MWY 1388 @ 3.61

    Is also added
    IFM 2608 @ 1.495
    to fill last week Buy signal.
    last week was up to 1.45 but I find it ok to populate today at this price
    As I see it, it is a race against time to have enough positive positions before the next crash
    Another last purchase triggered last week might be processed this week if the price is decent
     
    Habakkuk and Skate like this.
  3. Skate

    Skate

    Posts:
    1,192
    Likes Received:
    1,585
    Joined:
    Dec 28, 2013
    qldfrog, I'm sure there would be a great deal of differences between our CAM Strategy. I'll post my CAM strategy results & buy signals for comparison.

    Only 2 Charts
    Out of your 4 positions my Cam Strategy only held two of these so I've posted two charts (BRG) & (JIN)

    Settings
    Equity - $100,000
    20 Positions
    $5K positions
    Starting Date - 11th February 2019
    Commission rate used - $29.95 (actual rate for $5K positions = $19.95)

    Skate.

    CAM Backtest Report Capture.JPG


    CAM AA results Capture.JPG



    CAM Trade List Capture.JPG



    BRG Capture.JPG



    JIN Capture.JPG
     
    Darc Knight and peter2 like this.
  4. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    Thanks Skate, I will get back to the above soon;
    Today I completed my entries to "initiate the system":
    I purchase more shares to align the portfolio to a backtest started on the 8/02/2019

    AMI 5681 @0.88 $5,009.28
    CNU 990 @5.05 $5009.5
    NHC 1204 @ 4.15 $5006.6
    cost above reflecting $10 brokerage

    The start of the system highlighted an interesting problem

    When you start, and assuming you have an edge in your position score:
    you can either:
    1)just purchase the "new" buys only...discard last week ones just get new
    or
    2) fill your 20 positions allocation on day one including previous period buy recommendations.
    But then you will probably buy at less than optimum time based on your system concept:
    either buy too high, or buying codes which are already loosers
    or would be so low with their position score that they would never be actually considered on an ongoing system with only a few free postions at a time
    How to you solve this?
    Whatever the method, I feel you end up a looser and with a less than optimum results until the effect of the initial positioning lessen.
    I opted for a half baked solution:
    purchase the recommendation of the last 3 bars, at today's price..
    From the start, my real portfolio is already behind a backtest version by $1k..the extra profit ownership on the last 3 weeks would have gathered, but we have at least 34% of funds invested.And will only use new recommendation from now on
     
    Darc Knight, peter2 and Skate like this.
  5. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    Thanks for the feedback Skate: Is it the strategy you actually run ?..I know you have an hybrid approach and so leverage multiple systems but, is the code you backtest above something you actually run?
    Reason I ask is that your entry into BRG is quite "lucky": entry on a day where the share jump 21pc, want to make sure this is not some test code with maybe a future looking part or similar.
    Indeed I expect much difference between your code and my current version as I have changed the initial base code you provided a LOT to suit my style (aka less DD ideally, etc)
    I understand if you feel answering is providing too much information.
    Thanks again
     
    Skate likes this.
  6. Skate

    Skate

    Posts:
    1,192
    Likes Received:
    1,585
    Joined:
    Dec 28, 2013
    No problems explaining if it helps.

    qldfrog, let me explain how I would trade this strategy. I have coded the CAM Strategy to your stated requirements.

    Requirements
    Starting date - Week ending Friday 8th February 2019 (Explore for new signals)
    Purchase date - Monday 11th February 2019
    20 Positions
    $5K positions
    $100K Starting Equity

    1. Buy in the pre-auction (place orders before the Mondays open)
    2. I take every signal in order till the 20 positions are filled.
    3. Follow the strategy without question.

    QUESTIONS
    1. "Is it the strategy you actually run ?"

    This is my CAM modified Strategy - Do I trade it ? - Not yet, but I'm thinking about trading it as it's quite different to my Hybrid Breakout Strategy. Meaning its not correlated.

    2. "I know you have an hybrid approach and so leverage multiple systems but, is the code you backtest above something you actually run?"

    Yes, this will be the actual code I'll be trading, I'll start small $300K portfolio with 20 positions @ $15K.

    3. "Reason I ask is that your entry into BRG is quite "lucky": entry on a day where the share jump 21pc, want to make sure this is not some test code with maybe a future looking part or similar."

    Luck plays a big part of trading. That an honest signal from the CAM Strategy (no fudging involved)

    Luck (re-post)
    To a great degree, our success or failure in the market is a function of our luck. We like to think that our results are a direct consequence of our insight and efforts, but the reality is that luck plays a big part in how we do.

    Trading is all about price movement. (re-post)
    Nothing works perfect in trading so the next best thing is to accept 'that sometimes it works well and other times not so well. Those that can handle that tend to do well. I say just go with the flow. Trading success is all about just luck & you create your own luck by doing all the right things.

    4. "Indeed I expect much difference between your code and my current version as I have changed the initial base code you provided a LOT to suit my style (aka less DD ideally, etc)"

    There is a huge difference in our strategies, I didn't get many of your signals. The base code of my CAM Strategy is the exact same code I've supplied to you. I included additional code my CAM Strategy with added parameters.

    Important to understand
    The CAM strategy will pump out a large number of positions that's why the PositionScore is critical.

    Graphics
    Let me post a few graphics so you have a better understanding (correlated to the date you have given in your post 8th Feb 2019)

    Skate.


    CAM Strategy using the Backtest feature for AA Positions - this is what you see using Amibroker. (BRG) Long entry 11th Feb 2018
    1. CAM AA results Capture.JPG


    CAM Strategy using the Explore feature for AA Positions - this is what I see using Amibroker. (BRG) Long entry 11th Feb 2018 (includes my pre-auction calculations) - I have only listed the first position instead of a huge list. It aligns with the Backtest AA position signal for reference.

    Explore signal
    2. BRG EXPLORE Capture.JPG


    CAM Strategy 8th February Backtest report
    8th Feb Backtest report Capture.JPG



    CAM - (AMI) Chart as you listed a purchase (for signal comparison)
    3. AMI Capture.JPG
     
    Darc Knight likes this.
  7. DaveDaGr8

    DaveDaGr8

    Posts:
    104
    Likes Received:
    20
    Joined:
    Jun 29, 2007
    Not sure if anyone is using a derivative of the code from the amibroker forum

    https://forum.amibroker.com/t/s-c-magazine-jan-2018-traders-tips/3875/5

    But their version of the cam indicator is future looking.

    ***************************
    PositionScore = 100 * RSI(scoreLookBackPeriod);
    // PositionScore = (try your own formula here);
    buySignal = enterLongRule;
    sellSignal = exitLongRule;
    BuyPrice = Open;
    SellPrice = Open;
    // Buy/Sell on the next bar
    Buy = Ref( buySignal, -1);
    Sell = Ref( sellSignal, -1);
    Buy = ExRem(Buy, Sell);
    Sell = ExRem(Sell, Buy);
    **************************

    It uses todays open prices, but then uses positionscore RSI calculated using todays close.

    Having said that, when fixing it up, the indicator is one of the safest around.
     
  8. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    I will go back to my drawing board, after doing changes which I though were pure cosmetics on charting, I do not even see AMI appearing anymore and different explore results.....weird
    back to windiff, but I am trying to display similar info on my graph to ease comparison, and make it easier for me to analyse.. Thanks for your answer. Skate.
    I just sold the AMI, net loss of $30 or so, might have been a misreading,
    it last appeared in an Explore result more than 6 versions of the code ago.
    Apologies, not very professional
     
    Skate likes this.
  9. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    Well spotted, it took us a while to discover initially but we noticed this a while back and used the =Ref(xxx, -1) as a safe way ahead.

    I also believe the 100* is really not needed and when trying backtesting, i like using for buy/sell a
    Code:
    Sell = Sell  AND Status( "BarInRange" ) ;
    But actually ended up using a different scoring in the system discussed here , probably the major difference between Skate and I
     
  10. DaveDaGr8

    DaveDaGr8

    Posts:
    104
    Likes Received:
    20
    Joined:
    Jun 29, 2007
    Yeah the 100* is for human readability, most likely for explore's and should have no affect on the backtester.

    what does the status("barinrange") do for you ?

    I do like this indicator, it can have a very loose market filter and still maintain a reasonable car/mdd long after other systems have to go to bed.

    I don't trade it though as it conflicts with another system i have, but i'm interested to see what you can make out of it.
     
  11. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    I use "status(bar in range") to declutter my charts display,-> only show buy/sell on the range I do backtest (the range I specify) and so can zoom out and avoid having too many arrows displayed..more cosmetic and can also be a nuisance potentially: to each his own :)
     
  12. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    I moved the code to use settrade delay and so remove some of the complexity for the backtesting handling of offset vs explore mode.I believe I had a flaw in my explore before
    I now trust AB to work properly :) but code is simpler
    In the process, found a bug (in cased with conflicting buy/sell) which explained why AMI was set as a buy but disappeared as I was doing my improvement
    It should indeed have been purchased but no more JIN???
    This is what the explore on the 23/02 from early this month gives me:upload_2019-2-28_9-39-35.png
    I so sold my JIN today @10.43 for a loss of $68.1 and bought WEB 320@15.58 (for a much cheaper price than the open Monday of 15.95 so a "gain" of 0.37*320=$118.4 dollars
    My mistakes so far saved me:118.4-20-68.1 so 30 dollars
    Pure "luck" but just have to hope AMI was not the killing stock of the decade :)
    I have purchased all the stock highlighted in green above
     
    CanOz, Skate and Trav. like this.
  13. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    Current status after one week, still in ramping up process, my initial mistakes were not too costy even if I rushed too much to remove AMI
    upload_2019-3-2_11-3-39.png
    The system will require some buy on Monday open.I will announce them once executed
     
    kahuna1, Habakkuk and Skate like this.
  14. jjbinks

    jjbinks

    Posts:
    180
    Likes Received:
    60
    Joined:
    May 14, 2013
    hi qld frog,
    Thanks for sharing your results.
    If its okay with you do you think you could post your back test results here so we can gauge what to expect from your strategy.



    My question to you and others trading systems is:
    How do you know that your system is not working and when would you stop trading?
    --I think part of this comes back to system design. The more confident you are with your back testing process the more confident you can be with your system but trading real world may not produce same outcomes either because (1) there was some problem with back testing (2) Your edge has eroded
     
    qldfrog and Skate like this.
  15. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    Sure.give me some time but will post fy17/18 and august 2018 to current.
    1)Cover 1 recent phase of good time
    2)The dip of last year starting a system at a bad time..
    I could as well show the zillions i could have made since 2006 or similar but we all know this is meaningless
    If you have a specific period you would like me to use, just ask

    Question is good and of course behind my mind too.
    So currently i try to make sure code is foolproof and backtest can really be trusted as representative of what would have happen
    I plan to paper track the fy17/18 backtest vs explore as a comparison
    If the edge get eroded well i have no clue on how to determine it,a weekly system means we are only dealing with a limited amount of trade per year.hard to be statistically relevant so you might hit good or bad luck,
    Starr the same system on two different week and i can expect significant difference in the way mine will work.
    For example it is very specific, i do not fill 20 with an order of preference, i do take the chosen ones. Up to 20
    ..i will have only 8 entries for february by monday, the ramp up alone will take 2 or 3 months..i have to believe, but focused in my design in limiting somewhat the DD

    And have to be able to afford loosing the money invested
     
    jjbinks, willy1111 and Skate like this.
  16. Newt

    Newt

    Posts:
    300
    Likes Received:
    89
    Joined:
    Oct 17, 2012
    Great job qldfrog starting this thread and following through sharing your trades.
    Some very real challenges have come up already, and in real life people have to work through these, including:
    - which positions to start with? (dilemma - you don't want to "force" positions the code had previously entered, BUT its frustrating if those positions advance while you wait for new signals!)
    - How to judge your performance against the system, if you do take some "back-dated" positions?
    - How to balance real life experience versus theoretical paper trading?

    Re the last point, I'm concerned you seem to be sorting out some fairly major system consideration on the fly here as you're entering real positions. Having been there before over many years as my systems evolved, hope you don't mind me sharing some pros and cons:
    - there is nothing like real money in the market to make you pay attention to details and confront what you're doing (wrong)!
    - this can accelerate your learning curve
    - however, until you can answer (quickly!) questions about your system (such as posed by jjbinks) you are essentially still very much in a trial/learning period
    - if your intention is to trade a $100k portfolio then perhaps it would be wise to trade only a fraction of that amount until you have stabilised your system for at least 12 months - I'm plucking numbers out of thin air, but would suggest 1/4 planned size initially
    - Please remember how many years skate was backtesting before going live

    I suspect system trading and the coding/backtesting mindset encourages periods of (obsessive?) enthusiasm at times, and its hard to hold off going "all in" when you believe you're on to something.


    Please pardon my back seat driving suggestions, but for people stumbling across your thread it might be helpful to outline a little more about what your strategy involves? For people that haven't digested all of skate's thread it might be helpful to jot down a few bullet points about the CAM strategy (if that's what your trading?), weekly TF, entry after pullbacks (if those are the signals you're taking?).

    And congrats again for publicly sharing your progress :)
     
    jjbinks, qldfrog, Skate and 2 others like this.
  17. Newt

    Newt

    Posts:
    300
    Likes Received:
    89
    Joined:
    Oct 17, 2012
    Another thought, prompted by skate's post above and experiences tweaking my own code - it can be invaluable to code markers in your price pane, or ribbons under it, showing when your various entry or exit criteria are met.
    I've had to grudgingly admit in the backtesting/optimising phase that my system criteria were smarter than me many times. Sometimes its only much later with experience you realise the system may be picking up strong buying in stocks in ways you didn't originally anticipate or plan.

    That seems to have been a strength of skate's work in backtesting and real trading - minimal screen complexity, but still enough that you TRUST and follow the signals when they come up.
     
    qldfrog and Skate like this.
  18. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    Thanks for the hints Newt
    All very valid.much tganks

    A long time ago 5y or so i spent a fair amount of time building a system around the unholygrail plus some of my own tweaking.
    Ultimately trading it for a year or so,after a paper phase, got decent results vs my own poor decision making and did not experience any bigbig sc..
    Had to give up when i started travelling too much to follow it properly..was a daily system
    This relatively good experience might have made me cocky?
    I also know that until you jump with cash,delay and push and you postpone so much that you hit a crash or down period, or Greece is falling etc..and you end up static and paralysed by you own pessimistic for me mood.
    Every one is different. But i can only agree with your cautious message.also the fact that whatever beautiful compounded percent result you see in backtest, the ato will tap on your shoulder yearly to take half or so of your gains if any, so the miracle of compounded returns is very relative in Australia..
     
    Skate and Newt like this.
  19. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    Apologies for the previous posts typing mistakes, AI is overtaking me, and not yet up to scratch in the autocorrector...
    OK, got a few minutes ahead of a very busy week:
    Let's start:
    A) a bad scenario: start trading 01/08/2018, just before the mini crash at the end of last year:
    end date 3/03/2019 (today)
    Settings
    Equity - $100,000
    20 Positions
    $5K positions
    Starting Date - 1 August 2018
    Commission rate used - $10
    upload_2019-3-3_18-8-56.png
    upload_2019-3-3_18-12-33.png
    Not great but DD not a disaster, and it would have been difficult to start at a worse time in the very decent history.
    Starting every month of 2018, August is the worst so my choice, DD limited to 15 % or so based on different run around that period


    ====================================
    On a "good market"
    Same setting, date range:1/07/2017 to 30/06/2018
    upload_2019-3-3_18-21-31.png
    upload_2019-3-3_18-22-12.png

    Sounds very nice, too good to be true?
    Maybe so this is the period I am going to analyse weekly, comparing explore results vs backtests and see if it all makes sense.
    By doing random check, I could not see any issue but need to be 100% sure
    will keep you posted
     
    peter2, Lone Wolf, willy1111 and 2 others like this.
  20. qldfrog

    qldfrog

    Posts:
    2,335
    Likes Received:
    498
    Joined:
    Jun 8, 2008
    today's purchases:

    HTA 35820 @0.14 +10 =5024.80
    BBN 2080 @ 2.38 +10 = 4960.40
    As of tonight: profit $1078 after sales or error purchase last week
    Total invested $ 100,000.00
    Cash remaining $ 66,119.12
    Nb of active positions 8
    Nb max position 20
    Current portfolio value 101166.5398
    Return since 25/02 1.17%
    purchase value per position 5058.32699
    Invested percentage 35%
    Keep trucking, keep testing...
     
    willy1111 and Skate like this.
Loading...

Share This Page