Index futures automation

Discussion in 'Journals' started by hilmy83, Jul 3, 2022.

Can a fully automated trading strategy work in the long run?

  1. YES!

    56 vote(s)
    66.7%
  2. Hell naw.

    15 vote(s)
    17.9%
  3. I don't know, I got my own trading to worry about.

    13 vote(s)
    15.5%
  1. hilmy83

    hilmy83

    Good thing coming out of this is now I can trade at 6 micros. Still got a few more to go before switching to emini. But i'm getting there.

    PnL looked fucked lol

    upload_2023-8-29_18-24-23.png
     
    #541     Aug 29, 2023
  2. Mo06

    Mo06

    Not sure I understand what went wrong.
    Are you saying that the algo encountered trading conditions that hadn't occurred in the period since it's been running ?
    Or had you made a change and this produced the error ?

    My background is in software development in the financial sector.
    First question you'd normally ask is - what changed ?

    EDIT - OK just read your previous post, basically the algo wasn't written to take into account the possibility of a partial fill, and therefore bought twice the size to close a short position, leaving it net long ?

    If so, seems surprising that this hadn't happened in the previous 6 months.
     
    Last edited: Aug 30, 2023
    #542     Aug 30, 2023
  3. hilmy83

    hilmy83

    Last edited: Aug 30, 2023
    #543     Aug 30, 2023
    Overnight likes this.
  4. hilmy83

    hilmy83

    To your question, yes techcnically what changed was that the market executed the target for the first initial lot (around 100ms) after entry, that it didn't have time to execute the target for the remainder of the lots properly.

    MOst of the time, the the algo enters the position (full or partial), but the algo has time to initiate a target on the whole position once it's cleared. Yesterday, market moved so fast that it didn't have time to properly calculate the right target on the remainder position. The algo actually mistaken the session to be over after the initial target is filled.

    WHen the algo finally executed the target for the remainder , it actually used the whole position resulting in a net long (naked).

    Some dev could probably just look at the code and decide what the error is in the position counter. But I just did a crude fix by putting a flatten logic right after the session ends alert. This way, even if there was an error, it will force closure of everything, including pending orders.

    I don't mind having crude solution since it is a rare occurrence. I'm hoping I dont see any more surprises with this algo. This the biggest challenge with trading algo, is that you can code your algo but you can only really test it in LIVE environment with real money. There's no way demo/market replay can pick up execution issues like this. Everyting is filed all at once in demo. So you have to edit as you encounter the issues as you trade moving forward.
     
    #544     Aug 30, 2023
  5. Overnight

    Overnight

    Kudos for keeping it real, a rare thing these days 'round these parts.
     
    #545     Aug 30, 2023
    hilmy83 likes this.
  6. Mo06

    Mo06

    Obviously the algo needs a 'clearing up' procedure, checks that there are no positions still open.
    But you learn this stuff via real world running, again surprised it's never arisen in 6 months of real time running.
     
    #546     Aug 30, 2023
    hilmy83 likes this.
  7. #547     Aug 31, 2023
  8. virtusa

    virtusa


    DD should always be calculated trade by trade, not day by day.
     
    #548     Aug 31, 2023
  9. hilmy83

    hilmy83

    I have, but his test period of 6 months on just one market are way too short to draw any significant conclusions. But I think his testing cases were pretty robust.

    When I back tested my strategy it was from 2020-2022 . I tested it on ES,NQ,YM,RTY. I had many iterations to my rules/settings cause I would find it broke down in one year and not the other.
    upload_2023-8-31_9-8-32.png

    upload_2023-8-31_9-8-40.png
     
    #549     Aug 31, 2023
    Laissez Faire likes this.
  10. hilmy83

    hilmy83


    upload_2023-9-1_7-30-15.png

    upload_2023-9-1_7-30-26.png
     
    #550     Sep 1, 2023