Tenler's Algo Trading Journal

Discussion in 'Trade Journals' started by Tenler, Feb 16, 2022.

Tags:
  1. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Most gains for $SPY happen overnight: a quantitative study

    There is an article back from 2018 that says that most gains for $SPY happen overnight stating that you could have done overnight hold since 1993 and be more profitable than running the same by marker hours.

    I thought why not to review this thesis in a bit more detailed way. I set a simple backtest that is not going back to 1993 but rather just to Jan 1, 2010, holds overnight and sells in the morning.

    The Setup
    • $10,000 to trade daily (nightly actually)
    • Trading only $SPY
    • Buy at 3:59 using a market order
    • Sell at 9:30, 9:31, 9:32, 9:33, 9:34, 9:35 (let's see which one does better) using a market order
    • Do not trade on early close days
    [​IMG]
    Strategy setup
    The Results
    [​IMG]
    Cumulative gain since Jan 1, 2010
    [​IMG]
    Gain by year
    PS: This post is for fun and educational purposes only with no attempt to beat buy and hold. Do not use this as trading/investment advice. All calculation are made with Breaking Equity.
     
    #1 Tenler, Feb 16, 2022
    Last edited: Feb 18, 2022
  2. anotherdevilsadvocate

    anotherdevilsadvocate Well-Known Member

    Joined:
    Apr 3, 2016
    Messages:
    4,319
    Likes Received:
    3,375
    What % of the time does SPY gap up?
     
  3. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Have not calculated that actually, may be a good idea for the next study
     
  4. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    The simplest trading strategy: a quick study

    What is the simplest trading strategy? I thought the following has a pretty good chance to be the one: "buy and open and sell at the end of the day". Below is the study for this strategy since 2010.

    The Setup
    • $25,000 to trade daily (assuming you would have 25K in margin at least)
    • Trading only $SPY
    • Buy at open using a market order
    • Sell at close using a market order
    • Do not trade on early close days
    [​IMG]
    Simplest trading strategy setup
    Since I'm testing the simplest strategy, I decided to test a couple of stop loss variations
    • Stop loss 1%
    • Trailing Stop Loss 1%
    • Trailing Stop Loss 2%
    ...and conditions for entry. Only trade when stock is:

    • Above SMA 100 on daily chart
    • Above SMA 200 on daily chart
    The Results
    [​IMG]
    Cumulative gain since Jan 1, 2010

    [​IMG]
    Gain by year (no stop loss)
    PS: This post is for fun and educational purposes. NOT investment advice.
     
  5. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Most traders underperform to a coin flip day trading bot

    It's said that 90% of traders fail to make money when trading the stock market. Still trading attracts millions of people in the attempt to beat the market and make money.

    The other day I was talking to skeptics who mentioned: “No matter what you do in trading in the end it’s no better than a coin flip”. To see how a coin flip would actually perform, I wrote a coin flip trading bot and backtested the results since 2016. Since the bot cannot flip a coin, I use random(0,1)

    Conditions:

    • Trading $QQQ
    • Random enter and exit on 10min intervals
    • No stop loss
    • Always exit EOD (no hold over night)
    • 100 simulations per year to smooth it out
    [​IMG]
    Coin Flip Bot Setup

    Year over year performance:

    [​IMG]

    I expected it to perform worse than that ;)
     
    Value543 and T0rm3nted like this.
  6. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Can just one trade a day be any good?

    Everyone wants a trading strategy that allows you to make 1 trade per day but still beat the market. Here is an example of how that could be made.

    The Strategy: Gap & Go for Biotech Stocks

    I decided not to reinvent the wheel and just took the highly popularized Gap & Go strategy. The “Gap & Go” is looking for stocks gap up from the previous day's close price with the goal to follow an uptrend. I’m using biotech stocks as they tend to have higher volatility compared to other industries.
    [​IMG]

    An example of the ideal strategy setup
    Screening Criteria
    • Biotech Equities (I’m using iShares Biotechnology ETF $IBB as a list)
    • Up in the morning 3% or more
    • Are above pre-market high and yesterday’s high
    Enter Criteria (when to open a position)
    • Stock price is above EMA 9
    • Stock is going up and EMA 9 is going
    Exit Criteria(when to close a position)
    • Price crosses below EMA 9 and stays there for 3 bars
    • End of the same day
    • Trailing stop loss of 1.0%
    Conditions
    • $10,000 trading capital
    • Do not trade early close days
    • Only one trade per day
    • If no equities meet the screening or entry criteria, do not trade
    The Results: +58% gain over one year
    Profit $5,801.4 | Wins 48 | Losses 49

    Looks pretty decent but I think that’s just the beginning as I’m going to improve it even further by maybe looking at overall market conditions like $SPY behavior or news.

    [​IMG]

    Disclaimer: Not trading/investing advice, for fun and educational purposes.
     
    IchiFutures and Value543 like this.
  7. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Most of the times $QQQ rises overnight after a green day
    I have been experimenting quite a bit with major ETF recently and came across overnight behavior that has been somewhat consistent since 2016. It came from backtests for 3 ETFs that represent major indexes: $SPY, $QQQ, $DIA agains the following setups:

    Up Yesterday → Long in the Morning, Sell EOD

    Up Intraday → Long Overnight, Sell at 9:30 Next Day
    Down Yesterday → Short in the Morning, Sell EOD
    Down Intraday → Short Overnight, Sell at 9:30 Next Day


    [​IMG]
    Other Conditions
    • $10,000 to trade daily
    • Buy at intraday if condition is met
    • Do not trade on early close days
    • Market orders
    • No Stop Loss in this study
    The Results

    $QQQ has best over night continuation rate; $SPY - the next day
    [​IMG]
    [​IMG]
    [​IMG]
     
    IchiFutures and Value543 like this.
  8. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Can pre-market tell you anything: a quantitative study

    Pre-market is an exiting time when you start looking at your screens to check what's going on. There is a lot of information to consume: news, reports, charts... you can continue the list. In this study I explore if price movement in pre-market can provide any indications of how the day is going to look like.

    There are 3 setups I tested from 2015 to 2022
    • Up 1%+ in pre-market
    • Down 1%+ in pre-market
    • Flat in pre-market (open and close are within 0.1%)
    [​IMG]
    Trading Conditions
    • $10,000 to trade daily
    • Trading only $SPY
    • Buy at 9:30 if condition is met
    • Do not trade on early close days
    The Results

    [​IMG]
    Cumulative gain by year for each setup
    PS: This post is for fun and educational purposes only with no attempt to beat buy and hold. Do not use this as trading/investment advice.
     
  9. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Winners keep winning

    There is a famous saying "Winners keep winning" which means that stocks that do well tend to keep doing well...

    I have backtested the idea using the setup below for 2021.

    • Each day I'm looking for stocks which
      • belong to NASDAQ 100
      • have been up 3% or more on a prior day
      • are up in the morning (price above yesterday's close)
    • Enter (criteria to open a position)
      • Wait for 9:40 (market is open for 10min)
      • Stock price keeps going up
      • Buy only one stock for the day
      • If there are multiple candidates buy the one with highest relative volume comparing to the average market volume so far (10min average volume)
    • Initial capital $10,000
      • Gain is reinvested the next day
      • Loss reducing the buying power the next day
    • Exit (criteria to close a position)
      • End of the same day or by loss at 0.5% from fill price
    Results: Cumulative GAIN 75.29% | Max Draw Down -5.36%

    [​IMG]

    Return vs buy and hold benchmark
    [​IMG]
    Top tickers traded
    Disclaimer: Not financial/investment advice. All calculations made using BreakingEquity.com
     
    Value543 likes this.
  10. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Buying the Dip - Fool.com

    There is a popular stock recommendations service Montley Fool. You may have seen their articles in the news, they are all over the place. One of the lists they offer is called "Rule Breakers". Described as:

    Discover market-beating growth stocks, learn which businesses are poised to be tomorrow's stock market leaders, and see which companies are the best stocks to invest in today.

    I have backtested the following thesis: these stocks are popular growth stocks with a strong market interest behind them which should result in a lot of participants buying the dip.
    -------------------------------------------------------------------------------------

    Stocks Selection

    • All "Rule Breakers" buy recommendations made in H1 2021 (from 2021-01-14 to 2021-06-24)
      • 12 tickers total: NET, DDOG, SNOW, TTD, CPNG, PLNT, GDRX, TDOC, SNBR, AXON, MRNA, W
      • I'm trading from 2021-07-01 to 2021-11-30 (to avoid look ahead bias)
    • Enter Criteria (condition to open a position)
      • Only enter in the first half of the day
      • Wait for 9:40 (market is open for 10min)
      • Stock price dropped more than 1% from the open price of the day
      • There is a sign of recovery (EMA 8 is going up on a 3min chart)
      • If there are multiple candidates - buy the one with highest relative volume within 10min
    • Exit Criteria (condition to close a position
      • 1% profit or a trailing stop loss 0.25%
      • alway exit EOD
    • Initial capital $10,000
      • Gain is reinvested the next day
      • Loss reducing the buying power the next day
    Results: Cumulative GAIN 35.34% | Max Draw Down -4.07% | Alpha 24.89 (vs. SPY buy&hold). Not that bad for 5 month.

    "Rule Breakers" buy&hold performance for the same period: 6.39% (buying each stock worth of $833. 10K / 12 ~ 833)
    [​IMG]

    Returns vs. buy and hold benchmark - $SPY

    [​IMG]

    Tickers traded
    Disclaimer: Not financial/investment advice
     
  11. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Trading $SPY based on astrology. That's what 23% of Americans do...

    ~ 23% of Americans rely on astrology for buying or selling stocks - that's the title of the article posted by LendingTree some time ago.


    I backtested that for $SPY since 2015. I'm pretty sure there are unlimited variations of how you may read astrology when buying and selling stocks but for this study, I used Moon Phases.

    People tend to think that on full moon stocks go up...

    The Setup

    • Buy on the full moon
    • Sell on the new moon
    • $10,000 for each trade
    • No stop loss
    • Testing both LONG and SHORT sides
    [​IMG]
    Moon Phase Strategy Setup
    The Results
    Going long in a bull market is profitable as expected. At least that's better than most of the traders according to CNBC, which says 90% lose money.
    [​IMG]
    LONG side results for $SPY

    [​IMG]
    SHORT side results for $SPY
    PS: do not trade like this. Do your research and due diligence before trading or investing.
     
    Value543 likes this.
  12. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Are Cramer's recommendations worth anything: a study of 13k Mad Money stock pics

    Jim Cramer is a controversial person. Nearly every day he's recommending a dozen of stocks with unshakable confidence like if he knows the future. Many of those recommendations if followed directly do not end up very well to say the least.

    I wanted to do a performance study for his recommendations to see how bad/good they are. I figured that holding for just one day may be as much as you can afford.

    I took all the data from MAD MONEY STOCK SCREENER - a website that tracks all the recommendations made since 2016-04-18. Every day after the show they update it with a new set of stocks mentioned in the show.

    The Setup

    There were 13,314 buy recommendations made by Cramer since 2016-04-18. Every day I'm taking $10,000 and putting them into all the buy recommendations distributing the amount equally among all the stocks recommend. Buying at 9:30am next day after the show and selling by EOD.

    To make it a more complete assessment I ran a couple of different variations

    • No Stop Loss
    • 10% Trailing Stop Loss
    • 5% Trailing Stop Loss
    • 4% Trailing Stop Loss
    • 3% Trailing Stop Loss
    • 2% Trailing Stop Loss
    [​IMG]
    Example Setup of a Backtest
    Up in a good year and down in a bad year - looks pretty average... Note that 2016 only has data starting from the end of Apr so it's not complete, similar for 2022 it's up to March.
    [​IMG]

    2016 - 2022 Results
    Beyond the Results

    Since the results were not impressive, I decided to do one more test and hold a bit longer - until the next day open. Buying and 9:30am next day after the show and selling at 9:30am on the next trading day. A much better play this time.
    [​IMG]

    Holding 1 day + overnight (until the next day open)
    I'm not affiliated with CNBC or Jim Cramer in any way and this study is just a quantitative analysis of the recommendations.
     
    Value543 likes this.
  13. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Dollar Cost Averaging vs. Buying Every 5% Dip in $SPY

    It's reasonable to save some money every month and put that into stocks, you may be doing that in the retirement account already. Would it be more reasonable to wait until there is a dip and only buy then? Here I compare the 2 strategies:

    • Dollar cost averaging: every month buying $1,000 worth of $SPY
    • Every month saving $1,000 and then buying every 5%+ dip in $SPY with ALL money saved
    [​IMG]

    Results of doing than consistently since 2012 are below
     
    Value543 likes this.
  14. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Is it better to buy before stock split or after the split: a quick study

    A stock split is a corporate action that companies take to increase the number of outstanding shares and decrease the value of each share. In other words, as a company's stock price increases, investors are rewarded with higher returns.

    A stock split attracts a lot of attention, media writes about it, people talk about it. It may be a sign that a company is doing well because its share price has increased, and it also could bring in new investors who are attracted to the more affordable share price. On the other hand, it also could cause some volatility in the stock, so you may want to be prepared for changes in the price. In this quick study I'm trying to quantify if it's better to buy the stock before the split of after the split.

    The Setup

    • Buying and holding $10K worth of shares 1 month before the split and 1 month after the split
    • No stop loss (holding for 1month no matter what)
    • Only buying if the split was 2 for 1 or more
    [​IMG]
    Example Strategy Setup
    Notes: There was about 200 splits since 2016. There were some very low trading volume stocks which register like 1 trade per day or even 0 trades - I'm ignoring these in the calculations. Also here I'm assuming that you know about the split 1month in advance which may not always be the case.

    The Results: Seems like it's way better to buy before the split. At least it has been like that since 2016.
    [​IMG]
    Disclaimer: all the calculations made in https://www.breakingequity.com/ Not financial or investment advice.
     
    Value543 likes this.
  15. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Shorting Into the Rate Hikes, $SPY and $QQQ Historical Study
    We live in the world of anticipated rate hikes. The stock market does not seem to like that at all. Although there are many other factors such as war, unprecedented inflation, maybe even echos of pandemic I wanted to see how $SPY and $QQQ performed historically in the short term after the rate hikes.

    To do so I have backtested Rate Hikes back from 2015-2018. Overall there were 9 hikes (I took data from bankrate website)

    • 1 x 0.25 in 2015
    • 1 x 0.25 in 2016
    • 3 x 0.25 in 2017
    • 4 x 0.25 in 2018
    In this study I have backtested 2 strategies. Each strategy trades/invests $10K every rate hike.
    • Strategy 1: SHORT on the announcement date and hold 1 week
    • Strategy 2: SHORT on the announcement date, exit EOD, repeat for 1 week
    [​IMG]
    The Results

    Shorting every day and closing the position EOD came out a bit better overall. It also protects you from sudden spikes overnight.
    • SPY: $1,658.7 total gain vs. $1,626.9 for 2015-2018
    • QQQ: $1,634.0 total gain vs. $1,353.3 for 2015-2018
    Below is a breakdown by each year

    [​IMG]
    [​IMG]
    Disclaimer: Do your research and due diligence before trading or investing, especially shorting.
     
    #15 Tenler, Apr 27, 2022
    Last edited: Apr 27, 2022
  16. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    What happened to $SPY and $QQQ on the days after 2% intraday drop, a historical view

    The days when the indexes drop 2% or more during the day are painful.

    Here is a quick study on $SPY and $QQQ since 2017. Long at open the day after 2%+ drop from intraday high to close. So we buy at open and sell at close the next day after 2%+ red day.

    [​IMG]
    The Result

    Up most of the times during the trading hours on the next day... $QQQ seems to be more rebound ready. This week feels like the red can continue forever.
    [​IMG]
     
  17. anotherdevilsadvocate

    anotherdevilsadvocate Well-Known Member

    Joined:
    Apr 3, 2016
    Messages:
    4,319
    Likes Received:
    3,375
    Why only hold for 1 day?
    Why only buy QQQ/SPY -- what is your money in the rest of the time?

    I've seen studies (a couple years ago) to buy TQQQ at open the day after only a -1% dip, then sell at close 2 days later. Other times stay in SPY/QQQ. (backtesters seem to use SPY instead of VOO).
     
    #17 anotherdevilsadvocate, Apr 28, 2022
    Last edited: Apr 28, 2022
  18. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    What if stock market was a game?

    Inspired by Mortal Kombat. Turning Wallstreetbets, Cathie Wood, Jim Cramer and Warren Buffet's trades into fights.
    The game is playable at https://game.breakingequity.com/

    Please share your feedback and suggestions for improvements.

    [​IMG]
     

    Attached Files:

    IchiFutures likes this.
  19. Tenler

    Tenler New Member

    Joined:
    Feb 16, 2022
    Messages:
    18
    Likes Received:
    13
    Strategy of the Day: Anything Too Hot Has to Cool Off

    The setup:
    - 3min chart
    - Small cap biotech stocks from FINVIZ.com
    - Up 30%+ on a prior day
    - Short below EMA 9 in the morning
    - Exit EOD or above EMA 9

    The Results:
    Bear Market 2022 results are kinda expected with ~78% gain but 2021 are just out of this world.
    --- Not a financial advice. Trading involves risk, especially when shorting small cap stocks. Always do your research and due diligence.

    [​IMG] [​IMG] [​IMG]
     
    Value543 likes this.

Share This Page