Gesundheit

Trend-following Microprofit w/ Smart DCA + Profit Plot + Alerts

Gesundheit Updated   
This alert script is oriented towards automated trading with Gunbot.

I call it "Options Galore" because of all the user-configurable settings it offers for up-trending and down-trending markets. (See: "Market Tone" study).

A strategy script for quantitative backtesting, smarter buy/sell indicator such as TSI or Stoch RSI, and stop loss/trailing stop are all in the pipeline. Please share any other suggestions in the comments!

Features:
  • Set backtesting range, or start forward testing from the current time. Historical Renko charts can lead to repainting, which is avoided by keeping the chart open in your browser and running with real time data.
  • Average protection: only buy if price drops by a certain % below your average price -- can be automatically toggled by market trender if we want to continue buying during an uptrend. This reduces net profit but increases gross profit.
  • Gain protection: only sell if price is a certain % above your average price -- can be automatically toggled by market trender. Wait for larger profits in an uptrend, but sell earlier in a down trend.
  • Minimum percent gain can also be set to a negative value to allow selling at a loss. This is not true stop loss behavior, we still need a sell signal from the indicator. This means we will try to get the best price above your price floor, but in some rare situations we may not sell before the price drops below your price floor.
  • Position plotter: plots average long position price relative to current price.
  • Plot loss level: plots average price - loss %. With pyramiding turned off, this can be used to find out where to set your stop loss.

This script is free to use, just comment or PM for access. It is mainly meant to showcase some new features, and is only safe to use in carefully selected markets such as USDT-BTC.

Stay posted for upcoming scripts with smarter signaling and additional features! If you would like to add these features to your own preferred strategy, please PM me.
Release Notes:
Added the ability to completely turn off buys during a downtrend. If using this you will want to make sure market trender is tuned well (e.g. by increasing smoothing length and lookback length).

This will allow us to buy buy buy during uptrends, but trigger stop loss (to be added) during downtrends and exit the market. When market looks good again, we re-enter. Especially helpful for BTC markets, I would use DCA for USDT-BTC.
Release Notes:
Updated chart preview
Release Notes:
Fixed ability to create alerts.

Set up buy alert like this.

Set up sell alert like this.
Release Notes:
Added true stop loss -- works with and without pyramiding. You can enable alerts to sell if price closes by "Loss Level" % below your average buy price. TV PROTECTION needs to be off to use this feature! We already have TV protection built into the script so it is OK.

When you add the study to the chart, the scale will now be messed up. To fix this, go to Format -> Style -> and uncheck "BUY ALERT," "SELL ALERT," and "STOPLOSS ALERT"

Also, the screenshots in the last update worked but sometimes gave incorrect alerts. Here is a better way to set up the alerts:

Buys imgur.com/Dwd3gRv
Sells imgur.com/u7nDrJk
Stop loss imgur.com/lZ1QNRv
Release Notes:
Added option to disable stop-loss when market is trending up. Thanks for the suggestion @Calvinz!
Release Notes:
Added much-needed RSI filtering for buys!
Protected script
This script is published closed-source but you may use it freely. You can favorite it to use it on a chart. You cannot view or modify its source code.
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?