New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add possibility to add new layouts (markers and lines) in RenderBokeh()
method
#17
Comments
RenderBokeh()
methodRenderBokeh()
method
…t will be used dark theme, `False` mean light theme.
…nt, then will be used dark theme. Default: light theme.
…Jupyter Notebook cell. `False` by default.
…otebook inline support was implemented.
You can manipulate with chart and adding lines or markers to the main chart now. Use
Example: from pricegenerator.PriceGenerator import PriceGenerator, uLogger
from datetime import datetime, timedelta
import pandas as pd
uLogger.setLevel(0) # Disable logging messages.
# Initialize PriceGenerator:
priceModel = PriceGenerator()
priceModel.ticker = "TEST_PRICES"
priceModel.precision = 0
priceModel.timeframe = timedelta(days=1)
priceModel.timeStart = datetime.today()
priceModel.horizon = 75
priceModel.maxClose = 140
priceModel.minClose = 40
priceModel.initClose = 50
priceModel.maxOutlier = 35
priceModel.maxCandleBody = 15
priceModel.maxVolume = 400000
priceModel.upCandlesProb = 0.51
priceModel.outliersProb = 0.1
priceModel.trendDeviation = 0.005
priceModel.trendSplit = "/\/"
priceModel.splitCount = [40, 10, 25]
priceModel.Generate() # Generate main candles series.
# Let's draw new average line on the main chart and set markers on the top, center and bottom of candles:
priceModel.prices["avg"] = priceModel.prices.low + (priceModel.prices.high - priceModel.prices.low) / 2
priceModel.prices["markersUpper"] = pd.Series(["↓"] * len(priceModel.prices.high))
priceModel.prices["markersCenter"] = pd.Series(["×"] * len(priceModel.prices.avg))
priceModel.prices["markersLower"] = pd.Series(["↑"] * len(priceModel.prices.low))
priceModel.RenderBokeh(
fileName="index1.html",
viewInBrowser=True,
darkTheme=True, # Set `False` for light theme.
markers=priceModel.prices[["datetime", "markersUpper", "markersCenter", "markersLower"]],
lines=[priceModel.prices[["datetime", "avg"]]],
showStatOnChart=True,
showControlsOnChart=True,
inline=False, # Set `True` if script runs in Jupyter Notebook.
) Output: |
Implemented since v1.2.dev77 Debug build: https://app.travis-ci.com/github/Tim55667757/PriceGenerator/builds/259302083 |
…lies was added to markers legend label.
Parameter |
Render will be faster now if you set |
New test code for checking this issue:
Dark style example: Light style example: |
Also, #19 bug fixed. Example: |
Implement since build v1.3.dev78 Debug build: https://app.travis-ci.com/github/Tim55667757/PriceGenerator/builds/259412521 |
No description provided.
The text was updated successfully, but these errors were encountered: