FTB Strategy (PineConnector)
What Is PineConnector?
This strategy is called the “Follow The Bear” strategy, and is a strategy I learned from Jason Graystone over at Tier One Trading.
It includes full inbuilt PineConnector automation functionality!
PineConnector allows you to auto-trade the signals this script generates by sending your TradingView alerts to a webhook which relays the command to MetaTrader – which then manages your stops, targets and position sizing automatically.
It’s incredible – I suggest you check it out!
How The FTB Strategy Works
It’s a forex trading strategy designed for one purpose and one purpose only: to take advantage of a recurring pattern on EURUSD’s 1-Hour chart during the European market open.
The video lesson on YouTube explains in great detail how the strategy works, but the basic explanation is this:
During the European open we want to see a rally followed by a swing high shooting star / reversal pinbar candle. This typically means that traders buying EURUSD during the European/London open are now trapped long, and as price begins to retrace they are forced to sell, fueling a short-term retracement.
This strategy takes advantage of that pattern by aggressively selling short with a tight stop-loss above the pinbar candle and a conservative target.
There are many ways to trade this pattern, but this script represents my personal method for trading it.
It is not 100% accurate (no strategy is), but it does have a considerably high win rate over the past 6+ years considering its simplicity and I’ve been trading it for several months and can attest to its edge over the markets (at least through the Oanda data feed which is what I use).
Note: I use different rules to what I learned from Jason Graystone, and I have not found it to be profitable on any other market or timeframe with the optimized default script settings I use. But I haven’t done much testing on other markets as this strategy was originally designed to be traded only on EURUSD and GBPUSD .
My Strategy Rules
- Market: EURUSD
- Timeframe: 1-Hour
- Direction: Short Only
- Timezone: 6AM-10AM GMT
- Days: Tuesday, Wednesday, Thursday
- Entry: Close of Pinbar Setup
- Stop: 2 pips above signal candle
- Target: 1:1
- Risk: Up to you (backtest first! I use 1%)
Click here to see my personal manual backtesting results with these particular rules.
And click here to learn how to backtest.
This script is already prepared to be auto-traded through the PineConnector Expert Advisor.
Basically, if you input the relevant parameters into the script settings and you set the Expert Advisor up correctly on MetaTrader (either MT4 or MT5), then all you need to do is set up your alert for this script on EURUSD on the 1HR timeframe and select “alert() function calls only” as the alert condition. Make sure to input the correct Webhook URL for PineConnector.
The script will do the rest!
Whenever a setup is detected, if you have MetaTrader open on your computer then a sell limit order will be automatically placed on the signal candle with the stop-loss, target and position size that you set up in the settings menu.
Use the PineConnector automation feature at your own risk!
Test it on a demo account first, and never trade it with more money than you can afford to lose. 3rd party automation is not a toy and is highly risky – it can be extremely dangerous for your account if you or the 3rd party developer makes a mistake.
The material and the resources offered here are for educational purposes only. Always do your own research and only execute trades based on your own personal judgement.
Click here to read the full disclaimer regarding the very real risks associated with trading forex. I know it’s boring, but if you haven’t read it before then it’s important that you do. An uninformed trader is a doomed trader!
FTB Strategy Source Code
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © ZenAndTheArtOfTrading / PineScriptMastery.com // FTB Strategy (PineConnector Version) // Last Updated: 21st July, 2021 // @version=4 strategy(" FTB Strategy", shorttitle="FTB", overlay=true, calc_on_order_fills=true, initial_capital=10000, default_qty_value=100000) // Risk Settings var g_risk = "Risk Settings" pips = input(title="Stop Pips", type=input.float, defval=2.0, group=g_risk, tooltip="How many pips above high to put stop loss") rr = input(title="Risk:Reward", type=input.float, defval=1.0, group=g_risk, tooltip="This determines the risk:reward profile of the setup") // Filters var g_filter = "Filter Settings" timezone = input(title="Timezone", type=input.session, defval="0200-0700", group=g_filter, tooltip="Which timezone to search for FTB signals in") days = input(title="Days To Trade", defval="13457", group=g_filter, tooltip="Which days to trade this strategy on (Monday & Friday disabled by default)") useRsiFilter = input(title="RSI OB/OS?", type=input.bool, defval=true, group=g_filter, tooltip="If true then the RSI must be considered overbought before a signal is valid") useCloseFilter = input(title="Previous Bar Must Be Bullish?", type=input.bool, defval=false, group=g_filter, tooltip="If true then the previous bar must have closed bullish") useHighFilter = input(title="High Filter", type=input.bool, defval=false, group=g_filter, tooltip="If true then the signal bar must be the highest bar over X bars") highLookback = input(title="High Lookback", type=input.integer, defval=10, group=g_filter, tooltip="This is for setting the High Filter lookback distance") fib = input(title="Candle Close %", defval=0.5, group=g_filter, tooltip="For identifying shooting star candles (0.5 = must close <= 50% mark of candle size)") rsiLen = input(title="RSI Length", type=input.integer, defval=3, group=g_filter, tooltip="RSI length") rsiOB = input(title="RSI OB", type=input.float, defval=70.0, group=g_filter, tooltip="RSI overbought threshold") // PineConnector Settings var g_pc = "PineConnector Settings" pc_id = input(title="License ID", defval="YOUR_ID", type=input.string, group=g_pc, tooltip="This is your PineConnector license ID") pc_risk = input(title="Risk Per Trade", defval=1, step=0.5, type=input.float, group=g_pc, tooltip="This is how much to risk per trade (% of balance or lots)") pc_prefix = input(title="MetaTrader Prefix", defval="", type=input.string, group=g_pc, tooltip="This is your broker's MetaTrader symbol prefix") pc_suffix = input(title="MetaTrader Suffix", defval="", type=input.string, group=g_pc, tooltip="This is your broker's MetaTrader symbol suffix") pc_spread = input(title="Spread", defval=0.5, type=input.float, group=g_pc, tooltip="Enter your average spread for this pair (used for offsetting limit order)") pc_limit = input(title="Use Limit Order?", defval=true, type=input.bool, group=g_pc, tooltip="If true a limit order will be used, if false a market order will be used") // Generate PineConnector alert string var symbol = pc_prefix + syminfo.ticker + pc_suffix var limit = pc_limit ? "limit" : "" pc_entry_alert(direction, sl, tp) => price = pc_limit ? "price=" + tostring(pc_spread) + "," : "" pc_id + "," + direction + limit + "," + symbol + "," + price + "sl=" + tostring(sl) + ",tp=" + tostring(tp) + ",risk=" + tostring(pc_risk) // Get RSI filter rsiValue = rsi(close, rsiLen) rsiFilter = not useRsiFilter or rsiValue >= rsiOB // Check high & close filter highFilter = not useHighFilter or high == highest(high, highLookback) closeFilter = not useCloseFilter or close > open // InSession() determines if a price bar falls inside the specified session inSession(sess) => na(time(timeframe.period, sess + ":" + days)) == false // Calculate 50% mark of candle size bearFib = (high - low) * fib + low // Check filters filters = inSession(timezone) and closeFilter and high > high and rsiFilter and highFilter and open != close // Detect valid shooting star pinbar pattern var takenTradeAlready = false star = filters and close < bearFib and open < bearFib and not takenTradeAlready // Calculate stops & targets shortStopPrice = high + (syminfo.mintick * pips * 10) shortStopDistance = shortStopPrice - close shortTargetPrice = close - (shortStopDistance * rr) // Save stops & targets for the current trade var tradeStopPrice = 0.0 var tradeTargetPrice = 0.0 // If we detect a valid shooting star, save our stops & targets, enter short and generate alert if star and barstate.isconfirmed tradeStopPrice := shortStopPrice tradeTargetPrice := shortTargetPrice takenTradeAlready := true alertString = pc_entry_alert("sell", tradeStopPrice, tradeTargetPrice) alert(alertString, alert.freq_once_per_bar_close) strategy.entry(id="Short", long=strategy.short, when=strategy.position_size == 0, comment=alertString) // If we have exited the FTB session then reset our takenTradeAlready flag for the next session if not inSession(timezone) and inSession(timezone) takenTradeAlready := false // If price has exceeded target then cancel limit order if it's still active if pc_limit and low <= tradeTargetPrice and strategy.position_size == 0 alert(pc_id + ",cancelshort," + symbol) tradeTargetPrice := na // Draw stops & targets plot(star ? tradeStopPrice : na, color=color.red, style=plot.style_linebr, title="SL") plot(star ? shortTargetPrice : na, color=color.green, style=plot.style_linebr, title="TP") // Draw short signals plotshape(star ? 1 : na, style=shape.triangledown, color=color.red) // Change background color to highlight detection zone bgcolor(color=inSession(timezone) ? color.new(color.red,80) : na, title="Session") // Exit trade whenever our stop or target is hit strategy.exit(id="Short Exit", from_entry="Short", limit=tradeTargetPrice, stop=tradeStopPrice, when=strategy.position_size != 0)
Last Updated: 21st July, 2021