Skip to content

Commit

Permalink
Merge pull request #2 from wyn-ying/update-klinechart-to-v9
Browse files Browse the repository at this point in the history
update klinechart to v9
  • Loading branch information
yiliuyan161 authored Jul 16, 2024
2 parents 480e4a8 + f9f28c5 commit 256c222
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chartspy/klinecharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ def kline_chart_segment(plot):
show: true, horizontal: {{ show: true, size: 2, color: '#CFCFCF', style: 'dash'}},
vertical: {{ show: true, size: 2, color: '#CFCFCF', style: 'dash'}},
'candle':{{'bar':{{'upColor':'#EF5350','downColor':'#26A69A'}} }},
'technicalIndicator':{{
'indicator':{{
'bar':{{'upColor':'#EF5350','downColor':'#26A69A'}}
}}
}}
}}
);""")
for bt in plot.bottom_indicators:
parts.append(f"""var btm_{bt}_{plot.plot_id} = chart_{plot.plot_id}.createTechnicalIndicator('{bt}', false)""")
parts.append(f"""var btm_{bt}_{plot.plot_id} = chart_{plot.plot_id}.createIndicator('{bt}', false)""")
for mi in plot.main_indicators:
parts.append(f"""chart_{plot.plot_id}.createTechnicalIndicator('{mi}', true,{{id:"candle_pane"}})""")
parts.append(f"""chart_{plot.plot_id}.createIndicator('{mi}', true,{{id:"candle_pane"}})""")
if len(plot.mas) > 0:
parts.append(
f"""chart_{plot.plot_id}.overrideTechnicalIndicator({{name: 'MA',calcParams: {str(plot.mas)} }},"candle_pane")""")
f"""chart_{plot.plot_id}.overrideIndicator({{name: 'MA',calcParams: {str(plot.mas)} }},"candle_pane")""")
if len(plot.segments) > 0:
for seg in plot.segments:
parts.append(f"""
Expand Down

0 comments on commit 256c222

Please sign in to comment.