OPEN-SOURCE SCRIPT

Fibonacci Zone DCA Strategy - R3c0nTrader

ที่อัปเดต:
Credits:
Thank you "eykpunter" for granting me permission to use "Fibonacci Zones" to create this strategy
Thank you "junyou0424" for granting me permission to use "DCA Bot with SuperTrend Emulator" which I used for adding bot inputs, calculations, and strategy

Pre-requisites:
You can use this script without a 3Commas account and see how 3Commas DCA Bot would perform. However, I highly recommend signing up for their free account, going through their training, and testing this strategy with a paper bot. This would give you a base understanding of the settings you will see in this strategy and why you will need to know them.

What can this do?
First off, this is a Long only strategy as I wrote it with DCA in mind. It cannot be used for shorting. Shorting defeats the purpose of a DCA bot which has a goal that is Long a position not Short a position. If you want to short, there are plenty of free scripts out there that do this.

I created this script out of curiosity and I wanted to see how a strategy based on “Fibonacci” levels would work with a 3Commas DCA bot. I came across "eykpunter’s" "Fibonacci Zones" study and in TradingView and I found it to be a very interesting concept. The "Fib Zones" in his study are basically a "Donchian Channel" of 4 Fibonacci lines. These are the High @ 0.236, Center High @ 0.382, Center Low @ 0.618, and Low @ 0.764.

The Fib Zones in this strategy can be used as conditions to open a trade as well as closing a trade. There is also the option to close a trade based on a Target Take Profit (%).

Advanced Fibonacci trading is also supported by specifying additional parameters for Trade Entry and Exit.

For example, for order entry, you can increase the minimum trend strength to open an order via the "minimum ADX value" option. You can also further limit order entry by selecting the option to "Only open trades on bullish +DI" (Positive Directional Index).

Or you can play the contrarian. For example, I would look for "buying the dip" opportunities by doing the following under "Trade Entry Settings":
Set the "Min ADX value to open trade" to zero
Set the option "Open a trade when the price moves" to "1-To the bottom of Downtrend Fib zone" or "2-Higher than the top of the Downtrend Fib zone"
Uncheck option "Only open trades on bullish +DI"
Set the 'Min ADX value to open trade' to Zero
Set the 'Max +DI value to open trade' to a value between 10-20.

For Trade Exit settings, I can use a "Target Take Profit (%)" or one of the High Fib levels to close the trade.

Here's an example result when using a Contrarian-Fibonacci-Zone-DCA strategy:

สแนปชอต

Explanation of Chart lines and colors on chart

สแนปชอต

สแนปชอต

Six Options for Entering a Fibonacci Trade
Open a trade when the price moves:
1-To the bottom of Downtrend Fib zone
2-Higher than the top of the Downtrend Fib zone
3-Higher than the bottom of Ranging Fib Zone
4-Higher than the top of Ranging Fib Zone
5-Higher than the bottom of Uptrend Fib Zone
6-To the top of Uptrend Fib Zone

สแนปชอต

Three Options for Exiting a Fibonacci Trade
Take profit using:
"Target Take Profit (%)"
"High Fibonacci Border-1"
"High Fibonacci Border-2"

สแนปชอต
เอกสารเผยแพร่
Updated line colors for Fib zones to make it more discernable from the Take Profit line; updated thickness of TP, Avg Price, and SO line.
เอกสารเผยแพร่
Added Fib-Based Stop Loss option. Use this to exit the trade when the "High Fibonacci Border-1" (the highest fib line) falls below the average price. Works with all 3 trade exit options.
สแนปชอต
เอกสารเผยแพร่
Updated and reorganized the menu, the strategy and study scripts both have similar menus and are less confusing.
On the strategy menu, added more options and control for when to enter a trade (144 variations!)
Interesting statistic, lines code grew from 218 to 237
สแนปชอต
เอกสารเผยแพร่
Updates:

Reduced extraneous signals:
Buy/Sell Signals now only appear for unique trades which match the strategy.

สแนปชอต

Menu touchups and updated with more options
สแนปชอต

Fib Borders now listed with the highest border at the top and the lowest at the bottom
สแนปชอต

More options to exit trade
สแนปชอต


เอกสารเผยแพร่
Just updating chart
เอกสารเผยแพร่
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.
สแนปชอต

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.

สแนปชอต

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.

These updates have also been applied to the corresponding study script and can be used with this strategy script to generate buy/sell signals.
Chart patternseducational

สคริปต์โอเพนซอร์ซ

ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถเข้าใจและตรวจสอบได้ ต้องขอบคุณผู้เขียน! ที่ให้คุณใช้ได้ฟรี แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?

คำจำกัดสิทธิ์ความรับผิดชอบ