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.
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
- Data source is a google sheets that has data imported to it and then shared as a CSV to this codepen script.
- 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.
- If you need different indicators you'll have to program them in.
- You can hide volume by commenting out the code for it.
- New data has to be manually added in atm.
Example of manual backtesting with this tool.
----
Getting Started
- Choose your data source
- Stop loss type
- 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
- Auto - trade stays on as long as the candle colors are the same. (i.e. Long ends on first red candle encountered).
- Fast SMA - ends trade when price closes on the other side of the Fast SMA.
- 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
Coming back
Subreddit
Post Details
- Posted
- 11 months ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Daytrading/...