I wrote a bot and gave it 25k to trade

Discussion in 'Automated Trading' started by _terminus_, Feb 23, 2020.

  1. _terminus_

    _terminus_

    Thank you. Go to YouTube and search for "groove dub techno". The first results, a dozen or so, are all good. You may also want to look for "deep house", especially those by Johnny M. But the real secret is a good audio system and crank up the volume (no headphone allowed).

    3 contracts because I'm using 2:1 leverage. If and when the equity will get to 38/40k I'll probably add one more.

    My system can be set up to use fixed percentage, fixed risk, fixed contracts and fixed $ position sizing. I choose to use fixed contracts and then change it so as to maintain the leverage roughly constant.
     
    Last edited: Feb 25, 2020
    #31     Feb 25, 2020
    easymon1 likes this.
  2. IAS_LLC

    IAS_LLC

    How did you monte-carlo your own backtest? What was randomized? ...Or, did you just fit a distribution to your returns and sample from it?
     
    #32     Feb 25, 2020
  3. _terminus_

    _terminus_

    For the 1.400 trades produced by the backtest, the Montecarlo test was done by scrambling their order at random, repeated 1.000 times. So the percentile rank refers to 1.000 data points.

    For the random entry test, I first wrote a routine that generated 35.000 trades with the same distribution of duration as the backtested trades. Meaning that if for example 65% of backtested trades lasted 15 min, the test routine also created 65% of trades with the same duration. The difference was that the opening time was chosen at random. Out of those 35.000 trades, an equal number as the backtested trades (1.400) was chosen at random, then executed in random order. This process was also repeated 1.000 times.

    I did the same two tests for the three months since when I went live and the results were as follows.

    Actual trades (N=104), same processing as the backtested ones, that is, their order was re-arranged at random:

    live_actual.jpg

    Random entry trades, also N=104:

    live_random.jpg

    Percentile rank of the above plots, red = actual trades executed, green = random entry:

    live_distrib.jpg

    To me, this test is even more telling than that on the backtest, because one recurrent comment that I'm receiving - not only here on ET - is: "Yes, but the last months have been very directional and trending". Which is true, but as this test shows, the probability of opening a bunch of short duration intraday trades at random, and produce a profit, are very low even when the market is in a strong trend.

    Unless, of course, you buy and hold by knowing (or betting) in advance that there will be such a strong trend, but that doesn't fit my style.

    Please note that these tests prove nothing. The market conditions could change at any time and the system break and start losing money. In fact, I expect that to happen.
     
    Last edited: Feb 25, 2020
    #33     Feb 25, 2020
    redbaron1981, Turveyd and d08 like this.
  4. IamaMars

    IamaMars

    Despite the fact that I am quite skeptical about trading with robots or any other passive systems, it seems to me that you have managed to find an approach that can provide you with income, I would like to clarify with you how you managed to set up the algorithm and did you have situations when your system failed or caused a drawdown because the robot failed to catch a certain price movement? I'm just saying that people are experimenting and looking for new ways to make money, but in fact, I still believe that everyone has to personally control their money so that capital is always safe and you can act confidently in the world of trading.
     
    #34     Feb 25, 2020
  5. Zithiel89

    Zithiel89

    It seems to me that trading with a passive system is both a good and a bad solution. On the one hand, if you don't have enough time or knowledge and you realize that you can't do it yourself, you should definitely look for something like that, but don't allow blind work, everything should be tested in practice, with small amounts and charts, where you can always see the potential of the movement. On the other hand, I wouldn't abuse this approach, because it can relax you and you will basically stop trying to find something that will help you to get into the market yourself. Or you can potentially combine active and passive trading to significantly increase your chances of winning.
     
    #35     Feb 25, 2020
  6. _terminus_

    _terminus_

    I guess it's too early to state that, even with the benefit of the doubt. Let's see what happens in a couple years and then talk again about it. In the meantime I will cross fingers and everything I have.

    What do you mean exactly?

    No. First, because I tested it for several months using the IB paper trading account, which is an invaluable tool for developers. I wrote test algos that bought and sold like crazy, for debugging. Second, because the system went live only in November, so there is still time for discovering other bugs.

    No software is immune from errors, but on this side I'm quite confident there will be no major disaster due to the trading framework. I guess it's more likely that the trading algos will stop producing profit before any such disaster occurs.

    And you are right. I think exactly the same. What differs is the confidence in the tools and skills that one has to achieve it. As I said I don't consider myself a good trader, if by "trader" you mean trading by hand, following an instinctive/discretionary method. But I can code.

    It's similar to driving a car. Driving is one of the most dangerous and risky activity that a person can do, yet pretty much everyone feels confident when they are the driver. People hate to delegate to other entities what they deem important. Self-driving cars are another glaring example. But the feeling of safety can be deceptive...

    I do control my money, the program sends me a message every time it opens/closes a trade and I monitor its operation via web. Should any anomaly occur, I can connect to the trading computer and take the necessary actions. And in case the computer crashes I can still use the IB app from my phone and connect directly to my account.
     
    Last edited: Feb 25, 2020
    #36     Feb 25, 2020
  7. _terminus_

    _terminus_

    Yes, I monitor the charts and started with smaller positions.

    There are more options, for example to let the algo work and in the meantime keep developing and testing more algos.
     
    #37     Feb 25, 2020
  8. d08

    d08

    Incremental improvement. You eliminate problems until things run without issues and regarding missed fills, those are part of the model. It's not like it's any better putting the trade on manually. If a fill was missed, you don't chase the price.
     
    #38     Feb 25, 2020
    _terminus_ likes this.
  9. How did you implement the concurrency with IB API libraries ?

    For example did you use callbacks, state machine or co-routines ?
     
    #39     Feb 29, 2020
  10. TommyR

    TommyR

    did it do okay in the 11pcter? remeber the next 11 percenter is much less in dollars so things are getting brighter
     
    #40     Feb 29, 2020