This script provides an example of a TradingView Signal for use with ProfitTrailer's
new SIGNALS functionality and it's new TradingView integration capability.
This signals script implements a Cross strategy
that works on any chart timeframe.
It allows you to pick the Price source i.e. Open, Close (default), etc.
You are able to choose between (default) or moving average
You can define the fast and slow period lengths for use within the
moving average calculations.
If you get some value out of this indicator please consider making
a small donation to my favourite charity the Save the Childrens Fund.
Every donation will make a difference to the lives of children.
All donations over $2 are tax deductable. You can donate here:
Copyright (c) 2019, Grant Cause aka CryptoCoyns
All donations over $2 are tax deductible. You can donate here:
s2=security(tickerid, "D", close, barmerge.gaps_off, barmerge.lookahead_on)
These flags are already set as the defaults when you use the //@version3 at the top of your script. So you have their latest fixes for this. You can stop the repaint from happening by adding the close but then you wont be getting the latest version of the data but the previous candles (or timeframe you pick) close value which kind of the defeats the purpose of using this as a signal on realtime data. As far as I know it is a chart repainting issue and not an alert issue so the alerts should still fire correctly. if you want to try using the previous candles close value (rather than the price source you pick) in the script I wrote here is the line you need to change:
securitySource = security(ticker, period, close)
But this will disable the ability to change the source of the price to use. i.e. Open, Close, etc.