Label_Trades  Enter your trade information to display on chart
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jryan3

//@version=5
indicator("Label_Trades", overlay=true)
t_bot = input.time(timestamp("1 Jan 2024 10:00"), "Date and Time Bought")
t_sold = input.time(timestamp("1 Jan 2024 10:00"), "Date and Time Sold")
lot_size = input.int(defval = 1, title = "Lot Size", minval = 1, step = 1 , tooltip = "Enter Lot Size Traded") 
long_short = input.string(defval = "long", title = "Long/Short", options = ["long", "short"])
bot_val = input.float(defval = 0.00, title = "Price Bought", minval = 0, tooltip = "Enter Price Value") 
sold_val = input.float(defval = 0.00, title = "Price Sold", minval = 0, tooltip = "Enter Price Value")

if long_short == "long"
    label.new(x=t_sold, y=na, xloc=xloc.bar_time, yloc=yloc.abovebar, style=label.style_triangledown, color=color.red, size=size.small, tooltip=str.tostring(lot_size) + " lots sold at $" + str.tostring(sold_val))
    label.new(x=t_bot, y=na, xloc=xloc.bar_time, yloc=yloc.belowbar, style=label.style_triangleup, color=color.green, size=size.small, tooltip=str.tostring(lot_size) + " lots bought at $" + str.tostring(bot_val))

if long_short == "short"
    label.new(x=t_bot, y=na, xloc=xloc.bar_time, yloc=yloc.abovebar, style=label.style_triangledown, color=color.green, size=size.small, tooltip=str.tostring(lot_size) + " lots bought at $" + str.tostring(bot_val))
    label.new(x=t_sold, y=na, xloc=xloc.bar_time, yloc=yloc.belowbar, style=label.style_triangleup, color=color.red, size=size.small, tooltip=str.tostring(lot_size) + " lots sold at $" + str.tostring(sold_val))
    





