balik zmen uff

This commit is contained in:
David Brazda
2023-11-03 20:49:24 +01:00
parent de5382d04a
commit 0db88b194c
53 changed files with 1693 additions and 514 deletions

23
testy/vectorbt/test.py Normal file
View File

@ -0,0 +1,23 @@
import vectorbt as vb
class ShortOnCloseBreakoutStrategy:
def init(self):
self.last_close = self.data.close[-1]
def next(self):
# Enter a short position when the price is below the last day's close
if self.data.close < self.last_close:
self.sell()
# Exit the short position after 10 ticks
elif self.data.close > self.last_close + 10:
self.buy()
# Create a backtest object
#backtest = vb.Backtest(ShortOnCloseBreakoutStrategy())
# Load the closing prices for the assets in the portfolio
close = vb.YFData.download('AAPL', start='2023-01-01').get('Close')
print(close)
# Backtest the strategy