Loading...

[PLUS] Implementing Turtle Soup Plus One Trading Strategy with Bitcoin and Python



Strategy Description
The "Turtle Soup Plus One" trading strategy is a concept detailed in the book "Street Smarts: High Probability Short-Term Trading Strategies" by Laurence A. Connors and Linda Bradford Raschke. This strategy is a reversal play and attempts to capitalize on the market's tendency to reverse after making new 20 period highs (or lows). The original "Turtle Soup" strategy was initially a intraday strategy that tries to identify and exploit false breakouts or failed moves. One variation of that strategy is the Turtle Soup Plus One, which triggers on the following day and aims to capitalize on situations where traders who followed the original breakout get trapped when the market reverses, creating a swift counter-move. We will implement the Turtle Soup Plus One trading strategy using our own CryptoDataDownload historical OHLCV data for Bitcoin and Binance data.

Strategy Rules and Conditions
  • The market makes a new 20day high or low and the previous high/low marker must have been at least 3 trading sessions prior. The close of the new high/low must be greater than (beyond) the previous high/low price marker.
  • Buy entry is placed on the next day at the previous 20 day high/low watermark
  • Stop entries for failed trades are placed below the latest high/low that triggered the signal
  • Profits/exits should be taken within 2-6 candlestick intervals


  • The Code
    We will implement this strategy in Python and using our own OHLCV historical data for Bitcoin (BTC) from Binance exchange. We will use functional programming (script will be composed of multiple function calls vs an "object oriented" approach). The main function will load the data, which is flexible enough to load data for any exchange CSV and pair we host on the site. We include two helper functions called "get_idx_of_max" and "get_idx_of_min" in the file that allow us to determine where in the Pandas Dataframe (which index position) a certain value occurs as we use a rolling window function to determine the high or low over a 20 period rolling window. In addition to the OHLC columns, we will have a 20_day_high & 20_day_low column, these represent the rolling high and lows over each 20 day window. Then the 20_day_high_idx and low_idx; these are the indexed positions of where the high/low occurs in the dataframe. The last 2 numeric columns are index_diff_high and index_diff_lows which represent the number of days since the previous 20 day high or low in the window. The remaining columns are all Boolean (True/False) and act as the triggers for the final buy or sell signal: new_20_day_high or new_20_day_low represent whether or not a new high or low occurred. Index_high_condition and index_low_condition represent whether or not the new high or low occurred at least 3 days after the previous high or low set. Buy_close_condition and sell_close_condition are the final prerequisite which define whether or not the close of the price was less than the previous day low (for buys) or greater than the previous 20 period high (for sells). The strategy generates a "Buy" or "Sell" signal in the Buy_signal or Sell_signal columns using the previous booleans and conditions outlined in the strategy. It is important to remember that this strategy does not trigger on the closing price of the next day, but whether or not the next days' range breaks outside of/through the previously calculated 20 day high or low (in the opposite direction). All columns and data are ultimately saved in a CSV called "turtle_soup_plus_one_results.csv" The resulting file will have signals in it for entries & exits, but full back testing is not performed in this code. As always, every line of code is commented for your understanding. Feel free to modify to fit your purposes!

    This is a premium post. Create Plus+ Account to view the live, working codebase for this article.




    Notice: Information contained herein is not and should not be construed as an offer, solicitation, or recommendation to buy or sell securities. The information has been obtained from sources we believe to be reliable; however no guarantee is made or implied with respect to its accuracy, timeliness, or completeness. Author does not own the any crypto currency discussed. The information and content are subject to change without notice. CryptoDataDownload and its affiliates do not provide investment, tax, legal or accounting advice.

    This material has been prepared for informational purposes only and is the opinion of the author, and is not intended to provide, and should not be relied on for, investment, tax, legal, accounting advice. You should consult your own investment, tax, legal and accounting advisors before engaging in any transaction. All content published by CryptoDataDownload is not an endorsement whatsoever. CryptoDataDownload was not compensated to submit this article. Please also visit our Privacy policy; disclaimer; and terms and conditions page for further information.

    THE PERFORMANCE OF TRADING SYSTEMS IS BASED ON THE USE OF COMPUTERIZED SYSTEM LOGIC. IT IS HYPOTHETICAL. PLEASE NOTE THE FOLLOWING DISCLAIMER. CFTC RULE 4.41: HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN. U.S. GOVERNMENT REQUIRED DISCLAIMER: COMMODITY FUTURES TRADING COMMISSION. FUTURES AND OPTIONS TRADING HAS LARGE POTENTIAL REWARDS, BUT ALSO LARGE POTENTIAL RISK. YOU MUST BE AWARE OF THE RISKS AND BE WILLING TO ACCEPT THEM IN ORDER TO INVEST IN THE FUTURES AND OPTIONS MARKETS. DON’T TRADE WITH MONEY YOU CAN’T AFFORD TO LOSE. THIS IS NEITHER A SOLICITATION NOR AN OFFER TO BUY/SELL FUTURES OR OPTIONS. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE DISCUSSED ON THIS WEBSITE. THE PAST PERFORMANCE OF ANY TRADING SYSTEM OR METHODOLOGY IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS.

    Latest Posts
    Follow Us
    Notify me of new content