Untitled
unknown
plain_text
2 years ago
2.8 kB
6
Indexable
// table section var groupPanel = 'minervini_criteria' string table_vertical_pos = input.string('bottom', 'Panel position', inline='11', options=['top', 'middle', 'bottom'], group=groupPanel) string table_horizontal_pos = input.string('left', '', inline='11', options=['left', 'center', 'right'], group=groupPanel) text_color = color.black fn_fill_header(_id, _row) => table.cell(table_id=_id, column=0, row=_row, text='Criteria', width=0, height=0, text_color=text_color, text_size=size.small, bgcolor=color.aqua) table.cell(table_id=_id, column=1, row=_row, text='', width=0, height=0, text_color=text_color, text_size=size.small, bgcolor=color.aqua) fn_fill_value(_id, _row, criteria, value, _color_value) => table.cell(table_id=_id, column=0, row=_row, text=criteria, width=0, height=0, text_color=text_color, text_size=size.small, bgcolor=color.white) table.cell(table_id=_id, column=1, row=_row, text=value, width=0, height=0, text_color=text_color, text_size=size.small, bgcolor=_color_value) var T = table.new( position= table_vertical_pos + "_" + table_horizontal_pos, columns=2, rows=10, bgcolor=color.white, frame_color=color.gray, frame_width=2, border_color=color.gray, border_width=1) if barstate.islastconfirmedhistory fn_fill_header(T, 0) fn_fill_value(T, 1, 'Stock price is above MA 150 and 200', is_price_above_sma_150_and_200 ? 'yes' : 'no', is_price_above_sma_150_and_200 ? color.aqua: color.red) fn_fill_value(T, 2, 'MA 150 is above MA 200', is_sma_150_above_sma_200 ? 'yes' : 'no', is_sma_150_above_sma_200 ? color.aqua: color.red) fn_fill_value(T, 3, 'MA 200 is trending at least 1 month(22 days)', is_trending_at_least_1_month ? 'yes' : 'no', is_trending_at_least_1_month ? color.aqua: color.red) fn_fill_value(T, 4, 'MA 50 is above both MA 150 and MA 200', is_sma_50_above_sma_150_and_200 ? 'yes' : 'no', is_sma_50_above_sma_150_and_200 ? color.aqua: color.red) fn_fill_value(T, 5, 'The current stock price is trading above MA 50', is_current_price_above_ma_50 ? 'yes' : 'no', is_current_price_above_ma_50 ? color.aqua: color.red) fn_fill_value(T, 6, 'Current stock price is 25% above 52 weeks low', is_price_25_percent_above_52_weeks_low ? 'yes' : 'no', is_price_25_percent_above_52_weeks_low ? color.aqua: color.red) fn_fill_value(T, 7, 'Current Price is within 25% of 52 week high', is_price_within_52_high ? 'yes' : 'no', is_price_within_52_high ? color.aqua: color.red) fn_fill_value(T, 8, 'RS rating more than 70',is_rs_rating_more_than_seventy ? "yes (" + rs_rating_str + ")" : "no (" + rs_rating_str + ")", is_rs_rating_more_than_seventy? color.aqua: color.red) fn_fill_value(T, 9, 'Meet minervini criteria', " (" + str.tostring(count, "0") + " of 8)", color.white) // End of the combined script
Editor is loading...
Leave a Comment