Basic Position Calculator (BPC)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © peacefulLizard50262

//@version=5
indicator("Basic Position Calculator", "BPC", true)
account     = input.float(25000, "Account Size")
risk_amount = input.float(10, "Risk Amount %")
stop_loss  = input.float(0.25, "Stop Loss", 0, 100, 0.25)
reward      = input.float(2, "Reward")
style = input.string("Top Right", "Position", 
 ["Bottom Left","Bottom Middle","Bottom Right","Middle Left","Middle Center","Middle Right",
 "Top Left","Top Middle","Top Right"])
txt_col = input.color(color.new(#c8d7ff, 0), "Title Color", inline = "bull", group = "Settings")
box_col = input.color(color.new(#202236, 10), "", inline = "bull", group = "Settings")
location() => 
    switch style
        "Bottom Left" => position.bottom_left
        "Bottom Middle" => position.bottom_center
        "Bottom Right" => position.bottom_right
        "Middle Left" => position.middle_left
        "Middle Center" => position.middle_center
        "Middle Right" => position.middle_right
        "Top Left" => position.top_left
        "Top Middle" => position.top_center
        "Top Right" => position.top_right

risk_amount_percent = (risk_amount/100)*account

position_size = (risk_amount_percent/stop_loss)

take_profit = (stop_loss/100)*open * reward
stop = (stop_loss/100)*open

exit_price = open + take_profit
stop_price = open - stop

var tbl = table.new(location(), 2, 8)
if barstate.islast
    table.cell(tbl, 0, 0, "Account Size", text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 0, 1, "Position Size", text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 0, 2, "Account Risk %", text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 0, 3, "Stop Loss", text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 0, 4, "Stop Loss %", text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 0, 5, "Take Profit", text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 0, 6, "Take Profit %", text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 0, 7, "Risk Reward Ratio", text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 1, 0, str.tostring(account), text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 1, 1, str.tostring((position_size >= risk_amount_percent ? risk_amount_percent : position_size)), text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 1, 2, str.tostring(risk_amount)+"%", text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 1, 3, str.tostring(stop_price), text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 1, 4, str.tostring(stop_loss), text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 1, 5, str.tostring(exit_price), text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 1, 6, str.tostring(risk_amount*reward), text_color = txt_col, bgcolor = box_col)
    table.cell(tbl, 1, 7, str.tostring(reward), text_color = txt_col, bgcolor = box_col)

plot(exit_price)
plot(stop_price)

