1. Select a script in the source selection window.
2. Choose 2nd shape from the end of the list of triggers, for "buy" signals. Option buy in the sub settings list.
3. Select the last shape for the "sell" signals, the option sell in the sub settings list.
4. You can see the alert description is already written the optimal input and output code for AV, just correct a=Profile under your AV settings, or you can change it all as you wish.
5. You need to place alerts "Once per bar, after bar close" - all another variants makes another results.