Strategy · Pine Script v6 · On the chart

IBKR Safe Forex Strategy

by CodeThat

The IBKR Safe Forex Strategy is a Pine Script v6 strategy that trades forex pairs using crossovers of 10-period and 50-period EMAs, filtered by a 200-period EMA and restricted to London or New York session overlap.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code64
Settings2inputs
LicenceNone stated
Last update1 year ago11 Apr 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

IBKR Safe Forex Strategy enters long positions on fast EMA above slow EMA with price above filter, and short on the opposite crossover. Position size is calculated from equity risk percentage divided by ATR-based stop distance at 3x multiplier, adjusted for leverage up to 50 percent equity usage. The strategy plots fast, slow, and filter EMAs on the price chart. Main settings adjust leverage, risk percent, ATR length, and stop multiplier.

Details

Published by

CodeThat on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Trend, Moving averages, Volatility & bands, Sessions & time

Markets

Forex

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Leverageint10leverage
Risk %float1.0riskPercent
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

4 stars

This strategy trades directional momentum breakouts for crude oil on the price chart. It enters long or short positions when a fast exponential moving average crosses a slow exponential moving average, provided that current Average True Range exceeds its movin

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of CL Crude Oil Momentum [trugurpala]

Session Wicks

by g-moe
3 stars

This strategy executes long and short trades on the price chart by combining multi-timeframe smoothed Heikin-Ashi trends, higher-timeframe Hull Moving Average variations, and an ATR-based trailing stop. Users can adjust timeframes, smoothing lengths, Hull form

Strategy v5 TrendMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of Session Wicks

3Commas Bot

by regalouisei
2 stars

This strategy draws two moving averages on the price chart and uses their bias to open long or short trades. It places the stop beyond a swing high or low using an ATR risk multiple, then sets a limit exit from the reward-to-risk ratio. An optional ATR trail c

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of 3Commas Bot
1 stars

This Pine Script v6 strategy uses multi-timeframe analysis to identify intraday trends and generate trading signals. It requests higher-timeframe data for trend context via EMAs and Supertrend direction. On the local timeframe it plots EMA cross signals for lo

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Tn Sovereign MTF Intraday v6

Strategy Template

by MoDarK-MK
1 stars

This strategy template provides a modular foundation for building TradingView v6 backtests. It uses a placeholder Exponential Moving Average crossover signal combined with customizable filters for higher-timeframe trend alignment, volatility regime thresholds,

Strategy v6 TrendMoving averages
Updated 7 weeks ago · MPL-2.0 GitHub repository of Strategy Template

This mean-reversion strategy plots Bollinger Bands and a long-term moving average directly on the price chart. It enters trades when price candles penetrate the outer Bollinger Bands beyond a user-defined body percentage, anticipating a price reversal. Entries

Strategy v5 Mean reversionVolatility & bands
Updated 2 months ago · None stated GitHub repository of Bollinger Bands Winner PRO [Alorse]

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers