millerrh

ADX Trigger

millerrh ที่อัปเดต:   
This script fires off a buy alert when the ADX is rising and above a user-defined value (default 25). It fires off a sell signal when ADX starts sloping downward. The lookback period to determine if it is sloping up/down (in bars) is also configurable by the user. The plot highlights green when there is a "go" signal. Thanks to @9e52f12edd034d28bdd5544e7ff92e for the idea.
เอกสารเผยแพร่:
Changed the line at which the slope is ignored (below 25) to a shaded area. Not sure I like it though because of the dashed lines and the fact that there is space below 0. Let me know your thoughts and might change it back to being a single line.
เอกสารเผยแพร่:
Completely swapped out the code calculating the ADX and replaced it with code for DMI so you can look at the Directional Movement in addition to ADX.
เอกสารเผยแพร่:
Added long/short conditions based on DMI values.
เอกสารเผยแพร่:
Added all the filtering from the ADX | DMI Trend Strategy. This way the visual on the bottom pane will match up with the entries/exits in the strategy.
เอกสารเผยแพร่:
Removed the filtering that I added - this was causing the green/red shading to prematurely exit when all the filtering conditions weren't true anymore which was not what I wanted.

So now this just looks for a rising ADX above a certain level and the D+ and D- lines to indicate bull/bear. You can leverage the ADX | DMI Trend Strategy to include the filters for buying/shorting.
เอกสารเผยแพร่:
Re-enabled the volume and moving average filters because I figured out a way that the study knows if you are in a position or not. So it will keep the shading active even if volume dries up and you're in a position and only stop the shading (i.e. exit the position) when the ADX starts sloping downwards. This should match up to the ADX | DMI Strategy very well. The only difference is the optional ATR trailing stop that exists in the strategy.
เอกสารเผยแพร่:
Reconfigured the alerts based on the new "in a position" logic. These should now fire off according with the plan.
เอกสารเผยแพร่:
Added the ATR-based stops that are in the Strategy to this study. Now the strategy and study should be essentially mirror images of each other. One used for backtesting, and one used for trading/alerts and visualization.
เอกสารเผยแพร่:
Republishing without the ADX Strategy on the chart per request from TradingView.
เอกสารเผยแพร่:
Added separate ADX lookback periods for entry and exit for more fine tuning.

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

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

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

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

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