pmk07

Trend SR based strategy

pmk07 Cập nhật   
It is a logical continuation of my Trend SR based indicator

Algo of strategy is next
1)Detect SR levels
2)Calculate separate channels for SR made by highs and lows
3)it takes position if the current SR is breaking and close price is not in opposite channel zone
4)It closes position if prise leave current channel zone or as an option (stoploss) if SR is breaking in an opposite direction

-uses //@version=4
-no volume needed for detecting SR breaking and entering a long position
-volume confirmation of SR breaking may be used in the option section
-volume has an option to use smoothing with MA: SMA, AHMA, VIDYA
-volume has option to use volume pump as confirmation of SR breaking (simple dev function)
-stoploss as option
-uses barstate.isconfirmed (returns true if the script is calculating the last (closing) update of the current bar) for entering position on current bar close
-as an option, all or only current SR levels detected by algo can be plotted
-option to plot SR as a channel - as FILTERED whole SR history, in a long or short position it plots only stoploss level and entering opposite position level, in no position it plots long and short entering levels

It works well on 1D
For using on 4h or lower timeframes - Volume confirmation with VIDYA or AHMA may give better results
For better work especially on LTF algo needs better detection of highs and lows, now it uses fractal filter of last bars
Phát hành các Ghi chú:
fixed: plotting SR channel did not take into account stoploss option
Phát hành các Ghi chú:
Changed channel plotting option. Now it plots differences in channels made on highs and lows separately. And additionally, in long/short position closing_position_level and opening_opposite_position level plots by circles, in no position opening_long/short position level plots by circles.
Phát hành các Ghi chú:
added: calc_on_order_fills=true, calc_on_every_tick=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100
changed: channel option visual
fixed: wrong open/close long/short order execution
Mã được bảo vệ
Tập lệnh này được xuất bản mã nguồn đóng và bạn có thể sử dụng một cách tự do. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ. Bạn không thể xem hoặc sửa đổi mã nguồn.
Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?