Tabel

 avatar
s7s
plain_text
a month ago
12 kB
4
Indexable
Never
------
//  [ ALL table : --- {
// Get Input for values / Size and position : --- {
gr_Tabel            = "Table Settings"
show_dashboard      = input.bool    (true, "Dashboard"         , group=gr_Tabel, inline='dashboard')
show_dashboard2     = input.bool    (true, "Info Price"        , group=gr_Tabel, inline='Info Price')
show_Dash_board     = show_dashboard2
in_dashboardtab_size= input.string  ('Normal','Dashboard Size ', group=gr_Tabel, inline= "size",
 options=["Auto","Huge","Large","Normal","Small","Tiny"])
//
table_size(s) => 
    switch s
        "Auto"   => size.auto   
        "Huge"   => size.huge   
        "Large"  => size.large  
        "Normal" => size.normal 
        "Small"  => size.small
        => size.tiny
// }
//---------------------------------------------------------------------------
// rowcount {
rowcount = int(na)
if array.size(confirmation_counter) == 0
    rowcount := 5
else
    rowcount := array.size(confirmation_counter)+4
// }
//---------------------------------------------------------------------------
// Settings 3 Table {
var table ranging        = table.new(position.top_right    ,4, 12, color.rgb(42, 46, 57), color.rgb(204, 204, 204), 0, color.rgb(192, 232, 255, 77), 1)
var table Pric_TimeFrame = table.new(position.middle_right ,2, 7 , color.rgb(42, 46, 57), color.rgb(204, 204, 204), 0, color.rgb(120, 153, 219, 56), 1)
var table Dash_board     = table.new(position.bottom_right ,3, rowcount, color.rgb(42, 46, 57), color.rgb(204, 204, 204), 0, color.rgb(77, 71, 71), 1)
//
for i = 0 to 11 by 1
    table.merge_cells(ranging,2,i,3,i)
//
if show_Dash_board
    table.cell(ranging, 0, 0, 'Info'                                        , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#b3700a, 57), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0, 1, 'Initial Capital'                             , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0, 2, 'Equity'                                      , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0, 3, 'Net Profit'                                  , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0, 4, 'Open Profit'                                 , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0, 5, 'Gross Profit'                                , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0, 6, 'Gross Loss'                                  , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0, 7, 'Open Trades'                                 , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0, 8, 'Closed Trades'                               , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0, 9, 'Winning Trades'                              , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0,10, 'Losing Trades'                               , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 0,11, 'Break Even Trades'                           , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(ranging, 2, 0, 'Value'                                       , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#b3700a, 57), text_halign=text.align_center, text_size=size.small)

    table.cell(ranging, 2, 1, str.tostring(strategy.initial_capital ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2, 2, str.tostring(strategy.equity          ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2, 3, str.tostring(strategy.netprofit       ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2, 4, str.tostring(strategy.openprofit      ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2, 5, str.tostring(strategy.grossprofit     ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2, 6, str.tostring(strategy.grossloss       ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2, 7, str.tostring(strategy.opentrades      ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2, 8, str.tostring(strategy.closedtrades    ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2, 9, str.tostring(strategy.wintrades       ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2,10, str.tostring(strategy.losstrades      ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(ranging, 2,11, str.tostring(strategy.eventrades      ,'#.##'), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
//
if show_dashboard2
    table.cell(Pric_TimeFrame,0,0, '☼☾ S7SS_Trading ♛ ☽☼ '+'TimeFrame : ' + timeframe.period, text_color=color.red  , bgcolor=color.new(color.red  , 80), text_halign=text.align_center, text_size=size.normal)
    table.merge_cells(Pric_TimeFrame, 0,0,1,0)
    table.cell(Pric_TimeFrame, 0, 1, 'up   '    , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(Pric_TimeFrame, 0, 2, 'down '    , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(Pric_TimeFrame, 0, 3, 'rsi'    , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(Pric_TimeFrame, 0, 4, 'rsi2'    , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(Pric_TimeFrame, 0, 5, "-TP-" , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(Pric_TimeFrame, 0, 6, "-SL-" , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    // 
    table.cell(Pric_TimeFrame, 1, 1,str.tostring(up    ), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(Pric_TimeFrame, 1, 2,str.tostring(down  ), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(Pric_TimeFrame, 1, 3,str.tostring(rsi    ) , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(Pric_TimeFrame, 1, 4,str.tostring(rsi2 ) , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(Pric_TimeFrame, 1, 5,str.tostring(rsiMA), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
    table.cell(Pric_TimeFrame, 1, 6,str.tostring(Entry_pric), text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.tiny)
// 
if show_dashboard
    table.cell(Dash_board, 1, 0,"Long"                          , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#1e83b5, 40), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 2, 0,"Short"                         , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#1e83b5, 40), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 0, 1, "Leading Indicator"            , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#1e83b5, 40), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 1, 1,""                              , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 2, 1,""                              , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 0, 2, leadingindicator               , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#1e83b5, 40), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 1, 2, leadingstatus                  , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#1e83b5, 40), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 2, 2, leadingstatus_short            , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#1e83b5, 40), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 0, 3, "Confirmation Indicators"      , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#1e83b5, 40), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 1, 3, ""                             , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)
    table.cell(Dash_board, 2, 3, ""                             , text_color=color.rgb(237, 240, 237), bgcolor=color.new(#7fc2e4, 82), text_halign=text.align_center, text_size=size.small)

    if array.size(confirmation_counter) > 0
        for i=0 to array.size(confirmation_counter)-1
            table.cell(Dash_board, 0, 4+i , array.get(confirmation_counter,i), text_halign=text.align_left, text_size=table_size(in_dashboardtab_size), text_color=color.white)
    else
        table.cell(Dash_board, 0, 4, "None Selected", text_halign=text.align_left, text_size=table_size(in_dashboardtab_size), text_color=color.white)
    if array.size(confirmation_val_long) > 0
        for j=0 to array.size(confirmation_val_long)-1
            table.cell(Dash_board, 1, 4+j, array.get(confirmation_val_long,j), text_halign=text.align_left, text_size=table_size(in_dashboardtab_size), text_color=color.white)
            table.cell(Dash_board, 2, 4+j, array.get(confirmation_val_short,j), text_halign=text.align_left, text_size=table_size(in_dashboardtab_size), text_color=color.white)
// }
//