Replies: 2 comments
-
Hey you should be able to use |
Beta Was this translation helpful? Give feedback.
-
When I change the add_bar_event(which backtests correctly) to the following(below). I get this error: ##changed to arbitrage event ERROR: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to find out how to use the "add_arbitrage_event" function to backtest multiple symbols in one event call. Currently, I use the bar event and add each symbol in a loop. My test_strategy utilizes the StrategyState.
import blankly
from blankly.data import PriceReader
from blankly import StrategyState
def init(symbol: str, state: StrategyState):
"""Fetch the OHLCV list and initialize our variables"""
def test_strategy(bar, symbol: str, state: StrategyState):
"""Daily LONG and SHORT test strategy """
if name == "main":
# Create a list to store the symbols
symbols = ["AAPL", "GOOG", "MSFT"]
Add a price event for each symbol in the list using the bar event function
Beta Was this translation helpful? Give feedback.
All reactions