//@version=4 study("Straight Razor", overlay=true) // Calculate conditions for alerts closeEqualsHigh = close == high closeEqualsLow = close == low // Confirm that the bar has closed closeConfirmed = barstate.isconfirmed // Plotting the conditions for visualization, only when the bar has closed plotshape(closeConfirmed and closeEqualsHigh, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small) plotshape(closeConfirmed and closeEqualsLow, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small) // Alert conditions, only when the bar has closed alertcondition(closeConfirmed and closeEqualsHigh, title="Close Equals High Alert", message="Close is equal to High of the candle") alertcondition(closeConfirmed and closeEqualsLow, title="Close Equals Low Alert", message="Close is equal to Low of the candle")