# indie:lang_version = 5
from indie import indicator, param, plot, color from indie.algorithms import Ema
@indicator('Six EMA', overlay_main_pane=True)
# EMA 1 @param.int('ema1_length', default=30, min=1, title='EMA 1 Length')
# EMA 2 @param.int('ema2_length', default=60, min=1, title='EMA 2 Length')
# EMA 3 @param.int('ema3_length', default=120, min=1, title='EMA 3 Length')
# EMA 4 @param.int('ema4_length', default=20, min=1, title='EMA 4 Length')
# EMA 5 @param.int('ema5_length', default=144, min=1, title='EMA 5 Length')
# EMA 6 @param.int('ema6_length', default=169, min=1, title='EMA 6 Length')
# Six independent plot styles @plot.line( color=color.hex('#f9f871'), line_width=1, title='EMA 1', display_options=plot.LineDisplayOptions( pane=True, status_line=False, price_label=False ) ) @plot.line( color=color.hex('#ffc75f'), line_width=1, title='EMA 2', display_options=plot.LineDisplayOptions( pane=True, status_line=False, price_label=False ) ) @plot.line( color=color.hex('#ff9671'), line_width=1, title='EMA 3', display_options=plot.LineDisplayOptions( pane=True, status_line=False, price_label=False ) ) @plot.line( color=color.hex('#ff6f91'), line_width=1, title='EMA 4', display_options=plot.LineDisplayOptions( pane=True, status_line=False, price_label=False ) ) @plot.line( color=color.hex('#d65db1'), line_width=1, title='EMA 5', display_options=plot.LineDisplayOptions( pane=True, status_line=False, price_label=False ) ) @plot.line( color=color.hex('#845ec2'), line_width=1, title='EMA 6', display_options=plot.LineDisplayOptions( pane=True, status_line=False, price_label=False ) )
def Main(self, ema1_length, ema2_length, ema3_length, ema4_length, ema5_length, ema6_length):
ema1 = Ema.new(self.close, ema1_length) ema2 = Ema.new(self.close, ema2_length) ema3 = Ema.new(self.close, ema3_length) ema4 = Ema.new(self.close, ema4_length) ema5 = Ema.new(self.close, ema5_length) ema6 = Ema.new(self.close, ema6_length)
return ( ema1[0], ema2[0], ema3[0], ema4[0], ema5[0], ema6[0] )
Comments