no comfortable
# indie:lang_version = 5from indie import indicator, color, line_style, plot, param, sec_context, source, MainContextfrom indie.algorithms import Sma, StdDev@sec_contextdef High(self):return self.high[0]@indicator('My Indie 1', overlay_main_pane=True)@plot.line('upper_line', title='Upper', color=color.AQUA,line_style=line_style.DOTTED, line_width=7,continuous=True, display_options=plot.LineDisplayOptions(pane=True, status_line=False, price_label=False))@plot.line('lower_line', title='Lower', color=color.FUCHSIA(0.7),line_style=line_style.DASHED, line_width=1,continuous=True, display_options=plot.LineDisplayOptions(pane=False, status_line=True, price_label=True))@plot.fill('upper_line', 'lower_line', title='Fill', color=color.SILVER(0.3))@plot.columns('columns', title='Columns', color=color.MAROON, base_value=150.618,rel_width=0.7, display_options=plot.ColumnsDisplayOptions(pane=True, status_line=False, price_label=True))@plot.histogram('histogram', line_width=3, base_value=100.321,display_options=plot.HistogramDisplayOptions(pane=True, status_line=True, price_label=True))@plot.steps('steps', line_width=4,display_options=plot.StepsDisplayOptions(pane=True, status_line=True, price_label=True))@plot.line('another_tf')# @plot.marker(# title='MyMarker',# color=color.BLUE,# text='abc',# style=plot.marker_style.LABEL,# position=plot.marker_position.ABOVE,# size=4,# display_options=plot.MarkerDisplayOptions(# pane=True, status_line=True, price_label=True,# ),# )@param.int('int_param', default=2)@param.float('float_param', default=1.0)@param.source('source_param', default=source.CLOSE)@param.bool('bool_param', default=True)@param.str('string_param', default='123')@param.time_frame('time_frame_param', default="1M")@param.color('color_named_param', default=color.NAVY)@param.color('color_rgba_param', default=color.rgba(255, 1, 1, 0.5))class Main(MainContext):def __init__(self, time_frame_param):self.another_high = self.calc_on(High, time_frame=time_frame_param)def calc(self, int_param, float_param, source_param, bool_param, string_param, time_frame_param, color_named_param, color_rgba_param):middle = Sma.new(source_param, 7 * int_param)std = StdDev.new(self.open, 5)upper = middle[0] + std[0] * float_paramlower = middle[0] - std[0] * float_paramcolors_upper_line = [color.BLUE, color.RED(0.7), color.LIME]color_choice = colors_upper_line[(self.bar_index % 30) // 10]upper_line = plot.Line(value=upper, color=color_choice, offset=6)lower_line = plot.Line(value=lower)fill = plot.Fill(color_named_param(0.4))columns = plot.Columns(150 + self.bar_index % 10)histogram = plot.Histogram(100 + (self.bar_index % 20) // 3)steps = plot.Steps(value=((middle[0] // 10) * 10), color=color_rgba_param)# marker = plot.Marker(self.high[0], color=color.RED, text=string_param, offset=0)return upper_line, lower_line, fill, columns, histogram, steps, self.another_high[0]
like
all
only gym pool^^


Be the first to comment
Publish your first comment to unleash the wisdom of crowd.