Backtest and deploy algorithmic strategies with AI.
This app is currently in Alpha and we are actively squashing bugs, thanks for your patience!
Register for free to access more AI models.
ideas remaining
# Setup logging configuration
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
# Define your strategy
class ExampleStrategy(bt.Strategy): # You must leave this name ExampleStrategy the same or the strategy will not run
# implement new params based on user specification
params = (
('period', 5), # RSI period
('upperband', 70.0), # Upper band for RSI
)
def __init__(self):
# Compute the RSI with a 5-day period
self.rsi = bt.indicators.RSI(self.datas[0], period=self.p.period)
logging.info('RSI(5) Indicator initialized.')
def next(self):
rsi_value = self.rsi[0]
close_price = self.datas[0].close[0]
# Check for buy signal
if rsi_value > self.p.upperband and not self.position:
size = int(self.broker.get_cash() / close_price)
self.buy(size=size) # Execute buy order with size
logging.info(f'BUY Signal: RSI(5) > {self.p.upperband} | Date: {self.datas[0].datetime.date(0)} | Size: {size} | Close Price: {close_price}')
# Check for sell signal
elif rsi_value < self.p.upperband and self.position:
self.sell(size=self.position.size) # Execute sell order
logging.info(f'SELL Signal: RSI(5) < {self.p.upperband} | Date: {self.datas[0].datetime.date(0)} | Size: {self.position.size} | Close Price: {close_price}')
# Define the lookback period based on the longest indicator params, this must be done to provide a warmup period for indicators
lookback_period = 5 # RSI period
# Fetch and add data to Cerebro, ensuring correct ticker for Bitcoin
btc_data = bt.feeds.PandasData(dataname=yf.download('BTC-USD', start_date, end_date), name='BTC')
cerebro.adddata(btc_data)
globals()['lookback_period'] = lookback_period # Update global variable for lookback period usage
Test Pass | Quant Pass | Trade Pass | Enterprise | |
---|---|---|---|---|
Test trading strategies without code | ✓ | ✓ | ✓ | ✓ |
Test stocks/futures/cryptocurrency/forex strategies | ✓ | ✓ | ✓ | ✓ |
GPT-3.5 Turbo | ✓ | ✓ | ✓ | ✓ |
GPT-4o Turbo/Proprietary Models | ✓ | ✓ | ✓ | |
Dedicated API keys | ✓ | |||
Fine tuned models for your organization's tech stack | ✓ | |||
Ideas per Month | 3 | ?? | ??? | Unlimited |
Basic analytics | ✓ | ✓ | ✓ | ✓ |
Detailed analytics | ✓ | ✓ | ✓ | |
Test options strategies* | ✓ | ✓ | ✓ | |
Minute resolution data* | ✓ | ✓ | ✓ | |
Save strategies* | ✓ | ✓ | ✓ | |
Iterative strategy updates with AI assistant* | ✓ | ✓ | ||
Deploy strategy with exchange* | ✓ | ✓ | ||
View code structure | ✓ | ✓ | ||
Fees | Free | $TBA | $TBA | $TBA |
* = Features on roadmap |
Operation | Path | Description | Examples |
---|---|---|---|
Basics | N/A | Append the requested path based on the operation needed followed by the ticker symbol. Replace query parameters like <start> , <end> , <interval> , and <period> as needed. |
Example |
Get Stock Data | /data/{ticker} | Retrieve historical data for a specific stock ticker. Specify the start date, end date, interval, and period as query parameters. | Example |
Get Indicator Data | /indicator/{indicator}/{ticker} | Retrieve historical indicator data for a specific stock ticker. Specify the start date, end date, interval, and period as query parameters. | Example |
Calculate Moving Average | /moving_average/{ticker} | Calculate the moving average for a specific stock ticker. Specify the number of days, start date, end date, interval, and period as query parameters. | Example |
Get Volume Data | /volume/{ticker} | Retrieve the trading volume for a specific stock ticker. Specify the start date, end date, interval, and period as query parameters. | Example |
Calculate Volatility | /volatility/{ticker} | Calculate the volatility for a specific stock ticker. Specify the start date, end date, interval, and period as query parameters. | Example |
Calculate Price Change | /price_change/{ticker} | Calculate the price change for a specific stock ticker. Specify the start date, end date, interval, and period as query parameters. | Example |
Calculate Bollinger Bands | /bollinger_bands/{ticker} | Calculate the Bollinger Bands for a specific stock ticker. Specify the window, start date, end date, and interval as query parameters. | Example |
By using this app, you agree to: https://www.statisfund.com/legal - This app is built and managed by Statis Fund LLC - for questions and support email shawn@statisfund.com