Breakout Target
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © shockgotfunded

//@version=5
indicator("Pending Orders", overlay=true)



float pr = high - low

float atr = ta.atr(14)

float rsi = ta.rsi(close,14)

a = 1.3

float b = atr*a

float c = 1.0

float ca = 1.00

float cb = 1.000

d = 0.5

float e = atr*d

f = 0.35

greenCandle = close > open

redCandle = close < open

buysignal = if pr>b and greenCandle
    ca:= (pr-b)*f
    
sellsignal = if pr>b and redCandle
    cb:= (pr-b)*f

buyprice = if buysignal
    (close) - (atr*f)

sellprice = if sellsignal
    (close) + (atr*f)

// create function to check for buy/sell signal


//Signal that buystop setup may play out
plotshape(buysignal,"Buystop Signal", color=color.new(color.green, 0), style=shape.diamond)
//recommended price to set buystop after price drops below
plot(buyprice, "Buystop Price",  color=color.blue)
// recommended stoploss in pips 
plot(atr+ca, " Buy Stoploss", color=color.new(color.white, 100))

plotshape(sellsignal, "Sellstop Signal", color=color.new(color.red, 0), style=shape.diamond, location=location.belowbar)
plot(sellprice, "Sellstop Price", color= color.fuchsia)
plot(atr+cb, "Sell Stoploss", color=color.new(color.white, 100))

plot(rsi, "RSI", color=color.new(color.yellow, 100))

