Can you help me to calculate poisition size for open order?

i need indicator help me calculate poisition size for open order.
i pot horizontal line, it is SL price, and i want to input % of account balance, and it help me to calculate how many lot size with current price and click ‘ok’ for open oder

for example,

poisition size=

[account balance * (input %) ] /
[(current price and SL price distance ) * MINIMUM PRICE FLUCTUATION]

i need input % and pot SL price,
when i click ‘ok’, then calculate correct lot size and open order immediately.

can you help me?

thanks very much!