Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

18
Sharing my manual backtester I coded up in CodePen "Backtester 9000"
Post Flair (click to view more posts with a particular flair)
Post Body

This manual backtester lets you study price action and develop strategies where you'd enter/exit. You click which candle you'd enter on and the rest is handled automatically based on the stop loss type you choose. Hypothetically you can develop your strategy well into the thousands of trades by using this tool as backtesting research.

Hopefully this will help make it easier learn to trade for everyone.

https://codepen.io/iCodeForBananas/full/YzRMxrE

  1. Data source is a google sheets that has data imported to it and then shared as a CSV to this codepen script.
  2. Exit is automated and if you want a different kind of exit you'll have to add in a recursive function to search for your exit.
  3. If you need different indicators you'll have to program them in.
  4. You can hide volume by commenting out the code for it.
  5. New data has to be manually added in atm.

Example of manual backtesting with this tool.

----

Getting Started

  1. Choose your data source
  2. Stop loss type
  3. Disable MA's by setting to 0, enable by using any positive integer

Sometimes you'll need to clear trades to get it to start right.

----

Green arrow - long entry

Red arrow - short entry

Black box - exit

----

Stop Types

  1. Auto - trade stays on as long as the candle colors are the same. (i.e. Long ends on first red candle encountered).
  2. Fast SMA - ends trade when price closes on the other side of the Fast SMA.
  3. Follow Highs/Lows - as long as the low is higher than the last low you'll stay in the trade.

----

To download additional data you can use this script:

# Import package
import yfinance as yf

period = "720d"
interval = "60m"
ticker = "AAPL"

# Get the data
data = yf.download(tickers=ticker, period=period, interval=interval)

save_location = "./stock_data"

try:
    TEMP = data.copy(deep=True)
    TEMP = TEMP.dropna()
    TEMP.to_csv(save_location "/" ticker "-"  
                period   "-"   interval   ".csv")
except:
    print("Unaable to load data for".format())

To add your own data publish a spreadsheet to the web.

Data must be formatted like this.

Uses this charting library: https://www.tradingview.com/lightweight-charts/

Don't judge my code! I wrote it quickly and the moment it "worked enough" I stopped coding :P

License is WTFPL

Comments

Coming back

Author
User Disabled
Account Strength
0%
Disabled 9 months ago
Account Age
2 years
Verified Email
Yes
Verified Flair
No
Total Karma
3,123
Link Karma
280
Comment Karma
2,736
Profile updated: 1 day ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
11 months ago