Simple Trading plan (by david zak)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Swiss_Traders

//@version=5
indicator("Simple trading plan notes", overlay=true, max_boxes_count=500, max_labels_count=500, max_lines_count=500, max_bars_back=1000)

//Visitiblity Section
visibility_group = "Visibility"
inside_bar_show = input.bool(true, "Show Inside Bar", group = visibility_group)
show_rules = input.bool(true, "Show Rules", group=visibility_group)


//Rules Section

table_color_groups = "Table Colors"
bg_table_color  = input.color(#ffffff, "Table Color", group = table_color_groups, inline = "02")
bg_border_color  = input.color(color.new(color.green, 70), "Table Border", group = table_color_groups, inline = "02")
title_text_color = input.color(color.blue, "Table Title", group = table_color_groups, inline = "02")

table_text_size = input.string("Normal", "Text Size", options = ["Small", "Normal", "Large"], group = "Table Text Size")
h1_size = size.huge //big title
h2_size = size.large //titles
h3_size = size.normal //text
h4_size = size.small //footer
switch table_text_size
    "Large" => 
        h1_size := size.huge
        h2_size := size.large
        h3_size := size.normal
		h4_size := size.small
    "Normal" => 
        h1_size := size.large
        h2_size := size.normal
        h3_size := size.small
		h4_size := size.tiny
    "Small" => 
        h1_size := size.normal
        h2_size := size.small
        h3_size := size.tiny
		h4_size := size.tiny

trend_settings_group = "Trend Settings"
general_group = "General"
table_footers = "Footers"

table_title = "Notes"

headerColor = color.new(color.blue, 80)
infoColor = color.new(color.red, 80)

Trend_Title = input.string("Trend Settings", "General Title", group = trend_settings_group)
swing_structure_4h = input.string("Bearish", "4h Swing Structure", options = ["Bearish", "Bullish"], group = trend_settings_group)
swing_structure_15m = input.string("Bearish", "15m Swing Structure", options = ["Bearish", "Bullish"], group = trend_settings_group)
swing_structure_color_bull = input.color(#abe69b, "Bull", group = "Colors", inline = "01")
swing_structure_color_bear = input.color(#ffdbd2, "Bear", group = "Colors", inline = "01")
swing_structure_4h_color = color.green
swing_structure_15m_color = color.green
if swing_structure_4h == "Bearish"
	swing_structure_4h_color := swing_structure_color_bear
else
	swing_structure_4h_color := swing_structure_color_bull
if swing_structure_15m == "Bearish"
	swing_structure_15m_color := swing_structure_color_bear
else
	swing_structure_15m_color := swing_structure_color_bull

General_Title = input.string("General Infos", "General Title", group = general_group)
General_Infos = input.text_area("Type text...", "General Infos", group = general_group, tooltip = "use '\\n' for new line")


var maTable = table.new(
     position=position.top_right, columns=2, rows=21, bgcolor=bg_table_color, 
     frame_color=color.gray, frame_width=1, border_width=3)
     
if barstate.islast and show_rules
	Cell = 0

	// Header
	table.cell(maTable, 0, 0, text = table_title, text_size = h1_size)
	table.merge_cells(maTable, 0, Cell, 1, Cell)
	
	//Trend Settings
	Cell += 1
	table.cell(maTable, 0, Cell, text = Trend_Title, text_color = title_text_color, text_size = h2_size)
	table.merge_cells(maTable, 0, Cell, 1, Cell)
	Cell += 1
	table.cell(maTable, 0, Cell, text = "4h Swing Structure")
	table.cell(maTable, 1, Cell, text = swing_structure_4h, bgcolor = swing_structure_4h_color, text_size = h2_size)
	Cell += 1
	table.cell(maTable, 0, Cell, text = "15m Swing Structure")
	table.cell(maTable, 1, Cell, text = swing_structure_15m, bgcolor = swing_structure_15m_color, text_size = h2_size)
	//table.merge_cells(maTable, 0, Cell, 1, Cell)	
	
	//General Infos
	Cell += 1
	table.cell(maTable, 0, Cell, text = General_Title, text_color = title_text_color, text_size = h2_size)
	table.merge_cells(maTable, 0, Cell, 1, Cell)
	Cell += 1
	table.cell(maTable, 0, Cell, text = General_Infos, text_size = h2_size)
	table.merge_cells(maTable, 0, Cell, 1, Cell)
	