My current Tradingview Indicator currently gives long and short signals. I would also like for the indicator to place an alert to close longs when a short is opened and to close shorts when a long is opened. Please see the alert messages I would like added below.
alertcondition(EnterLong, title='Long', message='long')
alertcondition(EnterShort, title='Short', message='short')
alertcondition(ExitLong, title='CloseLong', message='closelong')
alertcondition(ExitShort, title='CloseShort', message='closeshort')