- Trading Bot - TopBot Anomaly LITE - - Ready to use and automate robot strategy -
1 - Introduction
This strategy is based on a search for abnormal market price movements relative to a time-shifted basic moving average. Different variations of the basic moving average are created and shifted proportionally rather than linearly, giving the strategy greater reactivity to serve as position entry points. What's more, this strategy stands out with a major innovation, allowing position exits to be set on moving average variations (and not on the moving average itself, like all strategies that close positions on return to the moving average), which greatly improves actual results.
2 - Detailed operation of the strategy
It defines a function that calculates various moving averages (depending on the type of moving average defined by the user) and the length chosen. The function takes into account different types of moving averages: SMA, PCMA, EMA, WMA, DEMA, ZLEMA and HMA, and is offset in time so that it can be an entry or exit condition in real time. To do this, it sets up LIMIT positions which it monitors to place an order the instant the price is crossed (otherwise it would have to wait for the next candle for the moving average to be calculated).
It calculates shifted variants (“semi” parallels) as a percentage of this basic moving average, high and low, to define position entry points (depending on user settings, up to 2 shifted levels for 2 Long position entries). Because the offset is calculated as a percentage rather than a fixed value, the resulting deviations are not parallel to the basic moving average, but enable the detection of a sudden price contraction. By adjusting these deviations proportionally, we can more clearly observe variations relative to the basic moving average, enabling us to detect dynamic support and resistance zones that adapt to market fluctuations. The fact that they are not strictly parallel avoids too rigid an interpretation and gives a more nuanced reading of trends, capturing small divergences that could indicate more subtle changes in market dynamics.
The most distinctive feature of this strategy concerns position exits: the script calculates a new moving average shifted proportionally to the base moving average (adjustable) to define the position exit price level. A classic moving-average exit can also be used, leaving the deviation value at 0.
The strategy enters the position when one of the deviations from the position entry moving average is crossed, and exits the position when the deviation from the position exit moving average is crossed.
3 - “Ready to use” anduser-adjustable parameters
The strategy interface has been optimized for easy creation of trading robots, with all settings underlying the calculations and numerous options for optimization.
Here are the contents of the strategy settings interface:
Visually show/hide entry zones on the chart
Define position output deviation level (0 - 0.4%)
Define position entry deviation levels (up to 2 levels)
Define type of capital management (% available balance, % total capital or fixed amount in $)
Define the amount of each position entry (in % or $)
Define the leverage used
Define source of data used (ohlc4, open, high, low, close, hl2, hlc3, ohlc4, hlcc4)
Define type of moving average used for calculations (SMA, PCMA, EMA, WMA, DEMA, ZLEMA, HMA)
Define moving average length (period)
Define a message to be sent to a bot via the webhook for a LONG entry
Define a message to be sent to a bot via the webhook for a LONG output
Define a stoploss (optional for this type of strategy)
In addition, important information about strategy settings and results is displayed directly on the chart. The percentage profit displayed may differ slightly from that of the backtest, as it includes potential profits from open trades (strategy.openprofit) in its calculation.
4 - Chart and backtest display conditions, options and settings
Here are the conditions and settings of the graph presented on the screen: Its result is obtained over 2 months. Position entry is in cash to balance the two entries, with 50% of capital per entry leveraged x2
Generally speaking, the strategy works well on a large proportion of cryptocurrencies. The recommended timeframes are: 5M - 15M - 30M - 45M - 1H - 2H - 3H - 4H and the most appropriate timeframe will vary according to the crypto-currency. It is also possible, with certain assets, to run the strategy on shorter timeframes such as 5M or 15M with success. Generally speaking, if set “wide”, the winrate is usually very high and most result curves are nice and progressive, with good stability over time.
The strategy can be used with a single position entry level, maximizing the use of capital on each trade and/or having several strategies active on a single account at the same time. It can also be used on a “safe” basis, using up to 2 successive entries to smooth out unforeseen market movements and minimize risk. Recommended leverage is x1 or x2 for controlled long-term trading, especially with 2 levels of entries used, although sometimes higher leverage could be considered with controlled risk.
Here's how to set up the strategy:
Start by finding a cryptocurrency displaying a nice curve with the default settings. The SMA Lenght setting is very important and can vary greatly from asset to asset (between SMA 2 and SMA 80).
Then try the default settings on all timesframes, and select the timeframe with the best curve or the best result.
Set the first triggerlevel to the value that gives the best result
(optional): Change the moving average type, period and data source to find the most optimized setting before proceeding to the next step.
Set the 2nd inputlevel to the last value modifying the result.
Then set the output level, which can greatly improve the results.
Enter your bot's Enter_Long and Exit_Long commands
Create an alarm linked via webhook to your bot or trading intermediary (info below)
6 - How to program robots for automated trading using this strategy
If you want to use this strategy for automated trading, it's very simple. All you need is an account with a cryptocurrency broker that allows APIs, and an intermediary between TradinView and your broker who will manage your orders. Here's how it works:
On your intermediary, create a bot that will manage the details of your orders (amount, single or multiple entries, exit conditions). This bot is linked to the broker via an API and will be able to place real orders. Each bot has four different signals that enable it to be activated via a webhook. When one of the signals is received, it executes the orders for you.
On TradingView, set the strategy to a suitable asset and timeframe. Once set, enter in the strategy parameters the signals specific to the bot you've created. Confirm and close the parameters.
Still on TradingView, create an alarm based on your set strategy (on the strategy tester). Give the alarm the name of your choice and in “Message” enter only{{strategy.order.comment}}.
In alarm notifications, activate the webhook and enter the webhook of your trading intermediary. Confirm the alarm.
As long as the alarm is activated in TradingView, the strategy will monitor the market and send an order to enter or exit a position as soon as the conditions are met. Your bot will receive the instruction and place orders with your broker. Subsequent changes to the strategy settings do not change those stored in the alarm. If you wish to change the settings for one of your bots, simply delete the old alarm and create a new one.
Note: In your bot settings, on your intermediary, make sure to allow: - Multiple entries - A single exit signal to close all positions - Stoploss disabled (if necessary, use the strategy one)
تم نشر هذا النص البرمجي بمصدر غير مفتوح ويمكنك استخدامه بحرية. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني. لا يمكنك مشاهدة أو تعديل كود المصدر الخاص به.
هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
Access to the strategy and free training on how to make the most of it and fully automate it on your broker on our website: trading-bot.fr
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.