ProfitTrailer Example TradingView Signals [v2019-01-31]

ProfitTrailer Example TradingView Signal

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 simple Moving Average 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 EMA (default) or SMA 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
Remove from Favorite Scripts Add to Favorite Scripts
If you get some value out of my work please consider making a small donation to my favourite charity the Save the Children Fund.
All donations over $2 are tax deductible. You can donate here:
So does this repaint?
Had a report of a possible repainting issue. We cant fix it as such as it is a problem with TradingView itself see here: They attempted to fix it in 2017 but it didn't work (my opinion, I believe they did a workaround rather than a fix, others would disagree) see here: Look for where they talk about Version 3 you will notice the use of version3 at the top of the script I wrote as an example signals script. The reason it happens occasionally in that script is that it makes use of the Security function to allow the selection of timeframes. They added a couple of extra flags in Version 3: // To avoid difference in calculation on history/realtime you can request not latest values and use merge strategy flags as follows:
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.
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Help Center Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing TradingView Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out