Joint Conditions Strategy Suite + TradingConnector alerts bot

Peter_O Premium Обновлено   
"Please give us combined alerts with the possibility of having several conditions in place to trigger the alert." - was the top voted request from users under one of the recent blogposts by TradingView.

Ask and you shall receive ;)

TradingView is a great platform, with unmatched set of functionalities, yet this particular combo of features indeed seems not to be in place. Fortunately, TradingView is also very open platform, thanks to PineScript coding language, which enables developing combos like the requried one and plenty of other magic.

I have already published numerous "educational" scripts, showing how to code indicators and alerts with PineScript, but... this is not one of them. This one is for real. READY FOR USE on real markets, also by the non-coding traders. Just take my script, set parameters with dropdowns, backtest the strategy, fire the alerts and execute them.

In "Settings" popup I tried to mimic the CreateAlert popup dropdowns for selecting logic. Let's say you want to enter Long position at Stochastic KxD crossover. In first line of Long Entry conditions set "StochK" + "Crossing Up" + "StochD". Last field doesn't matter because in 3rd dropdown something else than "value" was selected. In second line you could set "maB" + "Greater Than" + "maC" to filter out those entries which are in direction of the uptrend. And yeah, add ADX>25 to make sure the market is actually moving: "ADX" + "Greater Than" + "value" + "25". All condition lines must be TRUE (or skipped) for the entry to be triggered. Toghether with an alert.

The same for Short entries. Combinations are limitless.

In those dropdowns you can select candle values like open/close/high/low/ohlc4, but also some most popular indicators, which I have pre-built into this script: RSI , various Moving Averages, ADX-DMI, Stochastic and Bollinger Bands for start. You can configure parameters of those indicators also in "Settings" popup, in "Indicator Definitions" section. What's important, you can use any of these indicators from higher timeframe, setting MTF multiplier. So if you applied this indicator to 1h chart, but want to use rsi (close,14) from 4h chart, set MTF to 4. If you want to use current timeframe indicators, keep MTF at 1, which is a default setting here.

Note for coders: to keep focus of this script on joining conditions, entire logic for those indicators has been moved to external library, also open source. I encourage you to dig into the code and see how it's done. I love the addition of libraries concept in PineScript.

Following the "openness" spirit of my master - which is TradingView itself - my work is also open, in 2 ways:
1. This script is open source. So you can grab it, modify or add any functionalities you want. I cannot and don't want to stop you from doing that. I'm asking for only one favor - please mention this source script in your credits.
2. You can import the plot (series) from any other indicator on TradingView. In Settings popup of my script, scroll down to "Indicator Definitions" section, and select the series of your choice in the first dropdown. Now it is ready to use in conditions dropdowns on top of the Settings popup.

Let me give you an example of that last scenario. Take another script of mine, "Pivot Points on SR lines DEMO". You can find it in "Indicators & Strategies" library or here: ( Attach it to your chart. Now come back to THIS script, open Settings popup and in "Custom Indicator aka Imported Source" select "Pivot Points on SR lines: ...". The way it works - it detects if a pivot point happened on Support/Resistance line from the past and returns 1 for PivotLow and -1 for Pivot High. Now in first Long Entry condition set: "custom indicator" + "Greater Than" + "value" + "0" and long entries will be marked on every pivot low noticed on Support/Resistance line.

Last but not least - the alerts. This script produces alerts on the entries calculated by strategy logic, as marked on the chart by the backtester. Moreover, syntax of those alerts is already prepared and fully compatible with TradingConnector - alerts executing tool (bot), if you want to auto-execute those trades. Apart from installing the tool, you need to set
up the alerts in TradingView, here is how:
  • open CreateAlert popup
  • in first dropdown select "Joint Conditions Strategy Template"
  • in second dropdown select "alert() function calls only"
And that's all. You only need to set one alert for the whole script, not one for Longs and one for Shorts as it was in the past. Also, you don't need to setup closing alerts, because stop-loss/take-profit/trailing-stop information is embedded in the entry alert so your broker receives it as early as possible. Alerts sent will look like this: "long sl=40 tp=80", which is exactly what TradingConnector expects.

Phew, that's all folks. If you think I should add something to this template (maybe other indicators?) please let me know in comments or via DM . Happy trading!

P.S. Pyramiding is not supported in this script.

Disclaimer: I'm not saying above combination of conditions will make you money. Actually none of this can be considered financial advice. It is only a software tool. Use it wisely, be aware of the risk and do your own research!
Информация о релизе: Code refactoring for better readability.

I auto-execute TradingView Alerts into MT4/MT5 using this: 1-second delivery. Ping me if you need support with installation.
Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?