TWENTYTRADER

PRICE CHANNEL MEAN REVERSION

TWENTYTRADER 업데이트됨   
This script is a Fully Automated trading script meant to be used with "Oanda" broker and the plug-ins for algorithmic trading automation.( FOREX ONLY)
This script is meant to capture "MEAN REVERSION " for intraday charts (1hour) preferably and will hold for days / weeks .trading on forex markets.

(The combination of indicators includes a high and low price channel along with a fast moving average)

This script is original in the description of Alan Hulls moving average combined with the high and low closing of price action.

The concept of this mean reversion strategy is to try and capture price exhaustive moves . The moving average is fast and most times remains in the channel. when the moving average overshoots the channel the average price of the instrument is thought to be rising or falling faster then average, indicating a possibility that the instrument may revert (pull back) this strategy aims to capture that pull back.

This strategy uses a higher risk than reward profile to jump in front of market moves (4 risk to 1 reward)
in the likelihood the instrument will revert back (example) 25 pips before it continues 100 pips in the current direction.

This strategy should only be used in markets that you believe are mean reverting at the time of trading otherwise you will be jumping Infront of a possible trend and the price can continue in the trending direction for an unknown specified amount of time.

This script uses a (user defined period) fast moving average ( green/red color) and (user defined period) price channel (White/Blue) chosen in the indicator settings menu.
The default parameters are 55 with a (minimum of 1 and maximum of 10000) for the moving average and 50 with a (minimum of 1 and maximum of 10000) for the price channel , the default parameters = roughly 2 days of price action on the (1 hour) chart.
"The default parameters should be kept unless you fully understand the complete strategy"
the upper band (white line) is the highest close of the specified period and the lower band (blue line) is the lowest close of the same period.
When the fast moving average over shoots the price channel (exits) then crosses back into the price channel (enters) it will trigger a long or short trade.
The long signal is given when the the moving average crosses below the low band then crosses back above the low band . The trade long trade will be entered and the trade will exit if the stop loss or profit targets are hit or if the short signal is given the trade will close then reverse.
The short trade will be entered if the fast moving average crosses above the upper band (white line) then crosses back down through the upper band (white line) The trade short trade will be entered and the trade will exit if the stop loss or profit targets are hit or if the long signal is given the trade will close then reverse.

When the trade is entered a red , a blue and green horizontal dotted line will appear on the chart.
the blue line is the strategy entry price , the red line is the stop loss price , and the green line is the take profit price . the colors will invert if the trade is long or short.

(Setting alerts should be done in the indicator settings menu, and the parameters you chose will determine the stop loss/target and the amount of "units = (position size)" you wish to trade for the (forex only) markets. using "alert() function calls only" is the only alert that should be used with this strategy.
(note : when "alert() function calls only" is set two messages will be sent, one closing any open position in the opposite direction and one placing the new order regardless if you are currently in a trade or not)

Trade targets , stoploss and trade position size are a user defined variables entered in the indicator settings menu. (target pips minimum 0 and a maximum of 1000)(stop pips minimum of 0 and maximum of 1000)


Back test date range is included in the script for back testing different data periods.
the back ground will be colored a transparent navy blue if the period you are looking trading is with in the date range( note: to place live trades the end date will need to be in the future)
this is also adjustable in the settings menu

The avoid spread filter is a user defined time in which the spread is typically higher than average, applying this filter avoids trades in the specified time. When this filter is applied there will be a transparent red back ground color in the specified time.

Back test default setting are equivocal to NZDUSD
at the time of this publication placing trades with the "Oanda" broker are as follows , NZD units = 3250 equal 2000 USD position size . "Oanda" current leverage is 33.3 to 1 for this particular pair and commission is paid in spread (1.7) pips = 0.55 USD per trade , Margin required for the trade is 60.50 USD , Position sizing = 6.5% of a 1000 USD account. NZDUSD
릴리즈 노트:
#1 Margin requirement fixed 5% NZDUSD ,#2 Strategy update removed redundant calculation causing random back tester errors( late entry) ,#3 updated basic risk to reward being 1 risk to .5 reward
릴리즈 노트:
added default setting recalculate on order fills = true to improve back testing accuracy , also added buy stop and sell orders to correct random order fill errors
릴리즈 노트:
fixed short position bar color. fixed back test order fill to more accurately reflect actual market entry.
릴리즈 노트:
Added strategy close function to have back tester more accurately reflect real-time strategy alerts
릴리즈 노트:
Added the ability in the indicator settings menu to trade "long only" ,"Short Only" or both "Trades Long and Short" , (note: this ability allows traders to do a more thorough back test by separating long and short trades. It also will effect real time alerts!! be certain your trading setting are correct before setting alerts, as the alerts will trade "long Only" "Short Only" or both "Trades long and Short".
릴리즈 노트:
Added an information table : table includes a Kelly criterion calculator (P * E) - (1 - P) / (W/L) . this calculation is is controlled by fully by user inputs , in the "Kelly criterion (table only)". not the strategy tester , you will need to enter this information manually. probability of win = strategy tester win percentage in decimal form 1 = 100% win rate .67 = 67% etc. Equity balance = account equity , Expected return = strategy tester profit factor , Wins in a row = is the amount of wins in a row as of last trade
" example if your last trade lost this number would be zero if it won it would be 1" . This is my personal take on the Kelly criterion . The Kelly Degradation factor uses the calculation of independent probability to degrade the full Kelly bet by a percent . (example the probability of coin flipping two heads in a row is .50 * .50 = .25 or 25% ) using this calculation if 1 full Kelly bet was 100$ the first trade would be a 100$ stop loss , the second trade would be degraded by 50% making a 50$ stop loss , the third trade would be 25% or 25$ stop loss etc.)

The ATR portion of this table is again a user defined input under the "Average true range (table only)" user input setting menu . This is the ATR of the current chart and timeframe converted into pips and rounded to the nearest whole number multiplied by a user defined ATR Stop loss multiplier and the take profit multiplier is a multiple of the ATR stop loss multiplied ( example 25 pip ATR multiplied by 4 = 100 * take profit multiplier 1.5 the stop would be 150 , the table would read (ATR stop in pips 100) (ATR take profit in pips 150)

초대 전용 스크립트

이 스크립트에 대한 접근은 작성자가 승인한 사용자로 제한되며, 일반적으로 지불이 필요합니다. 즐겨찾기에 추가할 수 있지만 권한을 요청하고 작성자에게 권한을 받은 후에만 사용할 수 있습니다. 자세한 내용은 TWENTYTRADER에게 문의하거나 아래의 작성자의 지시사항을 따르십시오.

트레이딩뷰는 당신이 스크립트 작성자를 100% 신뢰하고 스크립트의 작동 방식을 이해할 때까지 스크립트 비용을 지불하고 사용할 것을 권장하지 않습니다. 대부분의 경우 트레이딩뷰의 커뮤니티 스크립트 에서 무료로 좋은 오픈 소스 대안을 찾을 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

작성자 지시 사항

이 스크립트의 작성자는 더 이상 액세스 승인할 수 없습니다. 액세스를 요청하지 마십시오.

차트에 이 스크립트를 사용하시겠습니까?

경고: 액세스를 요청하기 전에 읽으십시오 .