Ff

 avatar
s7s
plain_text
a month ago
3.5 kB
4
Indexable
Never

// =============================================================================
var int pivX_1  = array.from(input(TIME_DEF_STR       ,"TIME 1"   ,inline = "1"),
 input (TIME_DEF_1         ,"TIME 2"   ,inline = "2"),
 input (TIME_DEF_END       ,"TIME 3"   ,inline = "3"))
table[] arr_table = array.new_table()
fun_table_top() =>
    table.new(position=position.top_right, rows=10, columns=7, bgcolor=na)
//________________________________________ 

array.push(arr_table, fun_table_top())
fun_cell_pro(_id0, _id1) =>
    table.cell(array.get(arr_table, 1), 0, _id0 + 1, height=4, bgcolor=color.blue, text_color=color.black, text=array.get(arr_type, _id1))
    table.cell(array.get(arr_table, 1), 1, _id0 + 1, height=4, bgcolor=color.blue, text_color=color.black, text=str.tostring(array.get(arr_float_pro, _id0), '0.000'))
    table.cell(array.get(arr_table, 1), 2, _id0 + 1, height=4, bgcolor=color.blue, text_color=color.black, text=array.get(arr_calc_pro, _id0))
// ===========================================================================

// Custom function to create line AB
fun_line_ab() =>
    var line id = na
    line.delete(id)
    id := line.new(x1=bar_index[array.get(arr_int_abc, 2)], y1=dir_B_0 * array.get(arr_float_ab, 0), x2=bar_index[array.get(arr_int_abc, 1)], y2=dir_B_0 * array.get(arr_float_ab, 1), style=line.style_solid, color=col)
    id
//______________________________________________________   
// Custom function to create line BC Retracement
fun_line_bc_ret(_y) => 
    var line id = na
    line.delete(id)
    id := line.new(x1=bar_index[array.get(arr_int_abc, 1)], y1=dir_B_0 * array.get(arr_float_ab, 1), x2=bar_index[array.get(arr_int_abc, 0)], y2=dir_C_0 * array.get(arr_float_ret, _y), style=line.style_solid, color=array.get(arr_color, 1))
    id
//______________________________________________________   
// Custom function to create line AC Retracement
fun_line_ac_ret(_y) =>
    var line id = na
    line.delete(id)
    id := line.new(x1=bar_index[array.get(arr_int_abc, 2)], y1=dir_B_0 * array.get(arr_float_ab, 0), x2=bar_index[array.get(arr_int_abc, 0)], y2=dir_C_0 * array.get(arr_float_ret, _y), style=line.style_dashed, color=array.get(arr_color, 1))
    id
//______________________________________________________   
// Custom function to create line BC Line - 
fun_line_bc_pro(_y) =>
    var line id = na
    line.delete(id)
    id := line.new(x1=bar_index[array.get(arr_int_abc, 1)], y1=dir_B_0 * array.get(arr_float_ab, 1), x2=bar_index[array.get(arr_int_abc, 0)], y2=dir_C_1 * array.get(arr_float_pro, _y), style=line.style_solid, color=array.get(arr_color, 2))
    id
//______________________________________________________   
// Custom function to create line BC Line - 
fun_line_dc_pro(_y) =>
    var line id = na
    line.delete(id)
    id := line.new(x1=bar_index[array.get(arr_int_abc, 1)], y1=dir_B_0 * array.get(arr_float_ab, 1), x2=bar_index[array.get(arr_int_abc, 0)], y2=dir_C_1 * array.get(arr_float_pro, _y), style=line.style_solid, color=array.get(arr_color, 2))
    id
//______________________________________________________   
// Custom function to create line AC Line - 
fun_line_ac_pro(_y) =>
    var line id = na
    line.delete(id)
    id := line.new(x1=bar_index[array.get(arr_int_abc, 2)], y1=dir_B_1 * array.get(arr_float_ab, 0), x2=bar_index[array.get(arr_int_abc, 0)], y2=dir_C_1 * array.get(arr_float_pro, _y), style=line.style_dashed, color=array.get(arr_color, 2))
    id
//______________________________________________________