TheTradingParrot

TTP Absolutno

TheTradingParrot Mis à jour   
Absolutno is a pine script strategy for backtesting DCA bots with a different approach for placing both safety orders and take profit levels.

Motivation
Using DCA bots with safety orders most of the time is great during bull markets but in bear markets and strong downtrends it can be really challenging to close your deals only relying on safety orders placed based on percentages: price scale and volume scale.
In the past we introduced a script called "add funds simulator" that people used for sending alerts to bots to add funds and help closing deals in red.
We want to cross the use of TA with the safety orders with the intention of getting better results than statically placed safety orders.

What does Absolutno do?
Absolutno uses TA for safety orders, both for opening new safety orders and also to define how low they should be placed based on the volatility of the asset.


Main features
- ATR SO mode: Safety orders can be placed dynamically based on the general volatility of the asset plus the current volatility.
- TA based SO entries: Safety orders are only placed when the deal start condition is true not only when the price pulls back below the next safety order price level. This acts like a hybrid between "add funds simulator" and a traditional DCA bot. Once a safety order is filled, the next SO level gets active waiting for a DSC to trigger below the new entry level.
- Take profit scale: Traditional DCA bots offer a percentage or TA based exit conditions. Absolutno offers a new mode when you can decide to increase or decrease the TP level with each SO getting filled. For example a value of 1.1 TP scale will cause that each SO getting filled makes the TP% grow 10%. A value of 0.9% will reduce each SO by 10%. The lower the price goes you can "lower your expectation", or if you are filling bullish you can actually increase it.

External signal
It comes with a built-in deal start condition that uses RSI cross over 30 which is used only for illustration purposes since Absolutno is designed to be used with external signals.
Use any external signal to enter a new deal and for adding new safety orders.
You can also activate external take profit signal.
When external TP is enabled, all TP features from the bot are disabled to only react to what the external signal instructs the bot.

Bot integration and alerts
Three type of alerts will be sent to the bot: open deal, add funds and close deal.
You will need to enter your bot id and email token in the settings.
Since this strategy uses add funds: you must be aware that the alerts sent from this strategy will contain the amount of funds to add and therefore the bot receiving these alerts will respect them EVEN if the bot was defined with different SO sizes.
Please make sure you fully understand this before using this signal.
The base order alerts don't contain funds information so the bot will always use the base order size as defined in its own settings.



Notes de version:
- Added option to allow the external deal close signal to close at a loss for an "earlier exit"
- Added stop loss function
- Added emoticons to the on-chart deal comments for improved visualisation
- SO mode now supports 3 options: percentage, ATR or percentage+ATR

percentage mode = behaves as a traditional 3commas percentage-based safety order placement. Fancy doing an AB test?
ATR = Safety orders dynamically move with volatility. Use multiplier to increase or decrease the effect
percentage+ATR= combine both previous modes in one, we add the % plus the result of ATR and set the next SO at that distance
Notes de version:
chart update
Notes de version:
Section dynamic SO placement now includes
- ATR distancing - spread away the next SO based on volatility
- IFTRSI distancing - spread away the next SO based on trend
- Divergence distancing - spread away the next SO based on chances of market reversing to the downside due to an oscillator/price divergence

All this methods can not be used in conjunction and multipliers can be used to increase the effect of each individually.
A "span" method is provided to adjust for how long the divergence should take effect in the SO placement after triggered.

A table with stats and timeout is coming soon 🦜
Notes de version:
- Support for timeout added
- Fix for unwanted leading space in the symbol causing alerts not to work

In order to get these fixes and new features you must:
1) remove absolutno from the chart and add it again and confirm that you now are running v0.3.1
2) delete old alerts and deploy them again using v0.3.1
Notes de version:
IMPORTANT UPDATE!

This update fixes an issue affecting add funds alerts. You will need to:
1) Make sure you remove the script from the chart, add it again and confirm it's the version 0.3.2 or higher
2) Re create any alerts previously deployed

This update also brings a table with basic stats including:
- Pair
- Init Cap: this amount MUST be used in the initial capital in the strategy settings to prevent miscalculations of PNL
- Profit %
- Profit
- Daily %
- Trades
- Avg length (in candles)
- Used SO
- Max DD (drawdown)
- Period

Date filter added. Restrict the backtesting period using 2 dates+times
Notes de version:
External settings have been upgraded with new features.
- 2 external deal start conditions (DSC) and 2 external take profit conditions (TPC)
- Each external signal can be mapped to an independent value
- Option to force both DSC to be true at the same time
- Option to force both TPC to be true at the same time
- Option to only close the deal when the TPC signal fires above the specified TP%

Improved UI.
- Know which signal is firing: BI= internal, B1= external signal 1, B2= external signal 2
- Gray color for signals that are not below the area for SO, green for signals that are supposed to get filled
- Softer looking feel
Notes de version:
Fixed problem with ext sell signal 1 not closing deals
Notes de version:
New "Test alert mode" allows you to test alerts in only 5 minutes.
Notes de version:
Base order size bug fix. If you are running bots with absolutno it's very important that you read the below information.

Bug issue: the base order size was calculated wrong in some cases.

Impact:
- The bug was causing backtesting inaccuracy.
- The bug does not affect sizes in the real DCA bot since bots do not take size from the BO alert bot from the bot settings.

Action recommend:
1) remove the indicator from the chart if you are using any version below v0.3.6
2) add it again
3) configure absolutno with your settings
4) your backtest results are expected to change, so confirm that you are still happy with them
5) if still happy then delete the old absolutno TV alerts and deploy them again ( read below)

Redeploying alerts
- if your absolutno-managed DCA bot has currently no deals open, great you can delete the old alerts and create new ones now using v0.3.6
- if there's still a deal open maybe wait for the old absolutno alerts to finish those deals, or manually close them if happy to do so then leave the bot switched off so no new deals are opening and once fully stop, then deploy fresh alerts using 0.3.6

This error affects all versions below v0.3.6
Notes de version:
Have you ever dreamed with entering a BO using certain indicator,
fill safety orders using another one,
and filling that last safety order using an even more special indicator? 🦜

Absolutno 0.4.0 now allows you to specify precisely how you want to use each external source signal.

Here are some examples assuming you have access to the external indicators/signals below.

Example 1:
- Enter the base order when QFL 1H and RSI 15min crossing above 30 - yes, you can stack external sources and assign them as "confluence entry" to your base order trigger.
- Enter safety orders with a MarketCipher divergence
- Enter the Last Safety Order when Teddy triggers

Example 2:
- Enter often: when RSI is below 30 in the 15 min
- SOs more conservative: when QFL 2H triggers 5% below the base

There's literally no limits for experimenting !
Notes de version:
@everyone

You asked for it, now say goodbye to your weekend guys 🤣 : Absolutno supports shorts.

Important: I recommend testing the shorts intensively with paper or small amounts.

I have **NOT ** done an end-to-end testing with any real bot. Add funds are sent in QUOTE and I think the current implementation should work with futures, I'm NOT so sure if it will work with spot shorts. We might need to add a toggle to switch between spot/futures shorts as it's a bit tricky. 3commas accepts add funds with QUOTE or with BASE...

Let's test this week both and most likely it will require a few amendments before is fully ready. In the meantime you can start backtesting.

Please report any glitches in our Discord server, I'll create a thread to discuss Absolutno v0.5: shorts.
Notes de version:
Support for the bot platform WickHunter
Notes de version:
In rare cases the SL was triggering in the same candle as the entry one.

This patch hopefully should fix it! 🦜

Make sure you are running 0.5.2, test it properly before using these changes with real money! Use paper trading first, always.

And remember that you will have to recreate all alerts once the chart is upgraded to 0.5.2
Notes de version:
Fixes stop loss issue.
Added toggle displaying labels for each external signal: less busy chart and it you needed to troubleshoot your external sources you can always enable "show signals" to have them back in the chart.

If you are using 0.5.2 with real funds and stop loss, you must upgrade to this version and remember:
- test with paper trading extensively before using real funds.
- to upgrade, remove the indicator, add it back to the chart, re create all alerts
Notes de version:
For those of you that are using or planning to use Absolutno with leverage we're adding a few items to the stats table in 0.5.4 to help adjusting collateral and risk management.

Each deal in a DCA bot consists of a BA and multiple SOs.

But TradingView still refers to them as individual "trades".

0.5.4 now can show the worst trade among ALL base and safety orders.

The worst trade consists in the one that had the largest drawdown in in quote (dollar) value.

These new fields were added
- Trade max DD: the worst move in quote among all BO+SOs shown in percentage.
- Trade max DD no: in the TV strategy panel you can scroll through the trades and find the worst deal
- Trade max DD size: the size that was used for that worst deal (contracts * entry price), notice that this is subject to rounding issues since some prices don't have enough significance digits.

Examples: If a BO moves 50% but the size was $100 and later a SO moves 10% but with a size of $10,000 obviously the worst Trade DD will be the second one.
Notes de version:
- Solves issue with wick hunter
- Solves issue with testing mode
- Added on chart instructions for "testing mode" which is the easiest way to test your alerts for BO, SO and TP/SL are working properly in just 5 mins
Notes de version:
Introducing two new modes of placing your safety orders:

1) Safety order step scale. Use this parameter to control how you want your price deviation to increase or decrease with each new SO getting filled. As opposed to traditional DCA bots this price scale is not from the entry price but from the previous order filled. Example: let's say your bot uses 1% deviation, a price step scale of 2, and 3 SOs. This would mean that each SO would be placed sequentially at 1%, 2% and 4%. But the difference is that here if the first SO was in practice filled 1.2% below the BO, because the initial signal was triggered 0.2% lower, then the second SO can be filled at prices below 1.2% + 2% = 3.2%, depending on when the next signal fires to fill a new SO.

2) Custom price deviations. Do you want ultimate control on where to place each SO? you got it! use this new mode to provide a string with each deviation in order separated by a "/". Example, if your bot uses 3 SO and you want them placed, in order, at 2% then one at 5% and the last one at 1.75% then you can do just that by entering the following value 2/5/1.75 in the field "Custom price deviations". Input enough values for each SO using positive float numbers. If you make a mistake you will see the "red dot error" :)
Notes de version:
Fixes a bug that was causing that when TP was reached in the same candle as the signal the TP was still waiting for the candle to close.
Now it can open a deal and close a deal in the same candle when the TP% has already been reached.

This version may cause (hopefully not) other side issues so I recommend waiting one week or more before upgrading to 0.6.1
Notes de version:
Fixed trade count issue: calculation of total number of trades was wrong when some deals were opening and closing in the same candle.
Notes de version:
Introducing external SL.

Use ATR bands or any band-based indicator in the price, select it as source to dynamically pick where to place the SL. The SL will be placed at the level the source was at the time the signal trigger the deal.
Notes de version:
This is a big update! 😏

- Hedge mode - this has never been seen in DCA bots. Run a pair trading setup by controlling simultaneously two bots, a long and a short. Support for both WickHunter and 3Commas.
- Average daily range % SO positioning - Instead of spreading your orders using a fixed percentage, activate the ADR% and use the % deviation as a multiplier (leave at 1 to directly use the ADR % value or a number below 1 to use a fraction of it).
- Max TP % - When using external signals to exit you might find sometimes you are in good profit and no exit signal comes. Set a max TP% from external TPC to guarantee an exit even if the exit signal didn't come. Deals closing with this method will display as "Max TP%" in the chart and the deal history.

NOTE: Hedge mode is an experimental feature and we strongly encourage you to test it with an account with small amounts that you can afford to lose 100%. You MUST activate TEST and DEBUG modes to confirm that you have configured properly the integration with your bot platform. Hedge mode is very powerful but designed for advanced users.

I'll make a video to explain more in detail the new features asap.
Notes de version:
- Fixes issue of stop loss not working while using external TPC
- WickHunter alerts, hedge UUID bot removed. In WickHunter you can use the same bot to run long and shorts and the full idea is to "hedge the pair in the same account" so let's remove it. Alerts for the long and the short will be sent to the provided single UUID using BUY and SELL correspondingly.
- Debug and test mode for alerts options moved out from 3commas section into the alerts section since they are available and apply to WickHunter too.
Notes de version:
Max length in candles added
Notes de version:
Bug fixed: hedge positions were not opening on WickHunter.
Notes de version:
- Added support for controlling OKX signal bots.
- Fixed: debug mode label was showing the wrong volume while only the BO was filled
- Fixed: Profit was wrongly calculated from initial capital instead of total volume from orders (BO + all SO volume)
Notes de version:
Data window now also shows all the stats from the table.
Notes de version:
Absolutno can now send messages to WickHunter including not only the order sizes for safety but also for base orders.

This allows you to control WH 100% from TradingView without even needing to create a configuration in the the chosen WH account.

Alerts from Absolutno can send all the needed information including leverage, leverage type, and order type.

For the first time now you will also be able to send percentage sizes allowing you to instruct WH to use compounding. Notice that backtesting of compounding is not available yet.

All these features are also enabled for hedge mode pairs trading.

We also introduce a multiplier for order sizes so you can backtest using any sizes and then use the multiplier to both adjust DOLLAR and PERCENT sizes sent in the alerts. Remember to use debug mode always to confirm what you are sending.

Pine script logs are now enabled so you can also debug alerts from there.

Enjoy 🦜
Notes de version:
Updated chart
Notes de version:
Script performance improvements

In order to keep Absolutno compiling and executing fast we decided to remove some options

1- One less deal start condition, you can always use the logic op or events plugins to have extra later
2- Dynamic SO placement using ATR, IFTRSI and divergences. Daily range seems to outperform the previous ones in most cases.

Having all those features built-in seem to have been slowing down the performance. We need a good balance of great tools and also a good UX.

If you have any feedback please use our discord server.
Notes de version:
Daily range % now offers to enable/disable repainting.

Most users would want to keep repainting off to prevent issues with alerts sent and then disappearing in the backtest.

Advance users now can opt-in for repainting when they don't mind some false signals sent. This is expected to happen since the repainting version uses the ongoing daily candle to calculate the daily range % which can change many times during the day causing the repainting. In some setups this can represent a great opportunity while on many other ones a big headache.
Notes de version:
External source for dynamic placement of safety orders.

You can pick any external source like ADX, RSI and then use a multiplier value to adjust it.
We also offer an option to invert the source 1/X so it has a inverse effect in DCA placement.

Example: if you are using ADX and its fluctuating between values around 600 then use a multiplier of 0.02 so that you get a sensible next SO % deviation of 12.

ADR % now has its own multiplier parameter next to it (we are no longer using the one from the bot settings for consistency).
Notes de version:
chart
Notes de version:
Absolutno 0.9 brings new improved risk management features and consolidates TP and SL options in a single menu group TP &SL.

Introducing TP and SL types. Percentage, ATR and external.

Percentage works as usual whereas ATR allows the user to define a risk reward ratio by selecting ATR for both TP and SL. Setting values of TP 3 and SL 2 would give 3 times ATR for TP and 2 times for SL resulting in a RR ratio of 1:1.5

TP scale is still available to scale up the TP but only available while using % based TP.

External indicators can be used to place the TP or/and SL at a precise time at the moment a deal opens. For example you can use free indicators that allow finding swing high and swing low location to fully control where to place TP and SL.
Notes de version:
Solved bug: NaN appearing randomly in stats table
Notes de version:
Absolutno 0.9.1

Now you can set the stop loss relative to the current position average price. This means that the stop loss will move down as each safety order is filled on the way down.

(So far the stop loss was only available relative to the entry price)
Notes de version:
The max TP % was a parameter used in conjunction with external signals for exits.
It helps locking in profits when the exit signal hasn't trigger yet.
This new version of ABS introduces ATR for the max TP. In this way instead of relying on a fixed % you can use the volatility of the asset in your favour to adapt those expectations dynamically.

Instructions:
- when using external signals to close deals, set a above 0 for the max TP and select ATR instead of %

This can be used both for longs and shorts.

Enjoy! 🦜
Notes de version:
Option to suppress close deal messages.

If you enable this option you are in charge of closing your deals.

Assume this option will cause backtests and real-money performance to get out-of-sync.

This option is useful if you want the entries but rather taking care using other tools to decide when to close them.

Join our membership to gain access to the private scripts.
www.thetradingparrot.com
Script sur invitation seulement

L'accès à ce script est limité aux utilisateurs autorisés par l'auteur et nécessite généralement un paiement. Vous pouvez l'ajouter à vos favoris, mais vous ne pourrez l'utiliser qu'après avoir demandé et obtenu l'autorisation de son auteur. Contactez TheTradingParrot pour plus d'informations, ou suivez les instructions de l'auteur ci-dessous.

TradingView ne suggère pas de payer pour un script et de l'utiliser avant d'avoir 100% confiance en son auteur et de comprendre son fonctionnement. Dans de nombreux cas, vous pouvez trouver gratuitement une bonne alternative open-source dans nos Scripts communautaires.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Instructions de l'auteur

You can get access to this script by becoming a member of TTP. You will require an Observer subscription. thetradingparrot.com/join

Vous voulez utiliser ce script sur un graphique ?

Avertissement : Veuillez lire avant de demander l'accès.