1
votes

I am trying to learn about Pine Script. I'm using Tradingview for technical analysis and MT4 to place my orders. I am looking to make myself an in-chart indicator that plots 3 lines (my order filled, my take profit, and my stop loss) at a specific price. I want to be able to go to the settings, set a specific price level, and plot the lines with the corresponding labels (Order Filled, TP, SL) See Example

I know this is super basic but I want to start somewhere and this will help me keep track of my orders.

Thank you in advance and thank you for not laughing, lol.

1

1 Answers

0
votes

of course it is very simple (see script below). Perhaps you will be more satisfied with the tradingview's ability to draw long and short positions on the charts (see screen shot).

//@version=4
study("Help (lines)", overlay=true)

OP=input(0.0, title="Order filled")
TP=input(0.0, title="Take profit")
SL=input(0.0, title="Stop loss")

plot(OP!=0.0 ? OP : na, linewidth=2, color=color.yellow, title="Order filled")
plot(TP!=0.0 ? TP : na, linewidth=2, color=color.green,  title="Take profit")
plot(SL!=0.0 ? SL : na, linewidth=2, color=color.red,    title="Stop loss")

enter image description here