OPEN-SOURCE SCRIPT

Fibonacci Zone Study w/Candles - R3c0nTrader

Atualizado
Credits:
Thank you "eykpunter" for granting me permission to use "Fibonacci Zones" to create this study

What does this do? How is it different?
This study was created so it can be used with the strategy 'Fibonacci Zone DCA Strategy - R3c0nTrader' in order to generate buy/sell signals for a 3Commas bot.
I was not able to use "eykpunter's" "Fibonacci Zones" to create these signals as it was missing the code for this. To create the buy or sell signal you need to be able to create an alert for when the price moves through the Fib levels. Unfortunately, the "price" is not available to be selected when creating an alert with the original study. Hence the need to create this new study and to resolve the issue.

This study has overlay turned off by default so it will appear in a separate pane below your active chart. I did this so I can clearly view and separate the strategy from the study.

Steps Overview:
Add the study to your chart
Configure the study to match the Fib length you used in the strategy.
Create Alerts from the study to generate the buy or sell signals to 3Commas

The below steps for creating signals are just examples! Since there are numerous ways you can open or close a trade from a signal, please do your own testing. This cannot be understated.

Example of how to generate buy signals:
After adding the study, select the three dots for this study and click on "Add an alert on Fibonacci Zone Study /w Candles…"
Setup the condition to trigger the alert. If you want to initiate a buy when the price crosses over the top of the lower Fib zone (downtrend zone), then use the following:
Condition>Fibonacci Zone Study>Price High>Crossing Up>Fibonacci Zone Study>Top-Low Fib Border
Options>Once per bar
Expiration>Open-ended
Alert actions>Webhook URL (use the 3Commas webhook URL)
Alert name>Enter a name, "BUY Paper-Fib-Bot"
Message>Use the 3Commas message from the paper bot to open the trade

Example of how to generate sell signals:
After adding the study, select the three dots for this study and click on "Add an alert on Fibonacci Zone Study /w Candles…"
Setup the condition to trigger the alert. If you want to initiate a sell when the price reaches the top of the High Fib zone (uptrend zone), then try the following:
Condition>Fibonacci Zone Study>Price High>Crossing Up>Fibonacci Zone Study>Top-High Fib Border
(Note: I used "Crossing Up" but "Crossing" is another option; I just haven't tested it yet with a paper bot)
Options>Once per bar
Expiration>Open-ended
Alert actions>Webhook URL (use the 3Commas webhook URL)
Alert name>Enter a name, "SELL Paper-Fib-Bot"
Message>Use the 3Commas message from the paper bot to close the trade
Notas de Lançamento
Updated comments to correct script name. No other changes.
Notas de Lançamento
Update: Renamed Fib borders as old names were incorrect and confusing.
Notas de Lançamento
Added buy arrows and all the logic behind them so they should work with the 144 different ways to open a trade
Added a ton of options, now mimics most of the settings found in the strategy
Interesting statistic, Lines of code increased from 22 to 137
snapshot
Notas de Lançamento
It is easier now to create Buy and Sell alerts. Just click to add alert and select Buy or Sell. Enjoy.
snapshot
Notas de Lançamento
Buy/Sell Signals now only appear for unique trades which match the strategy.
snapshot

Updated and revamped the menu.
Added new exit settings to match the new available options in the strategy.
snapshot

Notas de Lançamento
Just updating chart
Notas de Lançamento
Updates:
Fixed trades not closing according to specified trailing deviation % ; Found trades were closing far later than they should be. Researched new calculation to fix this.
snapshot

When "Trailing Deviation" is used, the following lines will now appear on the chart (these can be disabled in 'Style' Menu):
Original TTP value = White line showing the original target take profit value
Stop Value = Red line which follows the price based on the trailing value and is used to help calculate the trailing stop. If the price moves up, this pushes the yellow Trailing Stop Loss line up.
Trailing Stop Loss = Yellow line showing the trailing stop loss.

snapshot

Added option for highlighting background color for buy/sell arrows; Added TP Area and SO Area

Added option for specifying the "Max ADX value", the "Min -DI value to open trade", and the "Max -DI value to open trade".
Tip: Use a DMI indicator to locate possible Min and Max values to use for ADX, +DI, and -DI.
Notas de Lançamento
Updates:
-Added TTP % input option. If you were using this in the strategy, you can use it in the study script to generate sell signals.
-Fixed issue where the strategy and the study would sometimes appear not to line up their buy and sell symbols on the chart. Issue resolved by using the closing candle value during calculation of SO orders.
-Fixed issue where sometimes the study would show buy and sell arrows on the same candle. Setup a timer to prevent buy and sell on the same candle.
educational

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal