Strategy · Pine Script v5 · On the chart

Fibonacci Martingale Strategy

by thibaultyou

This strategy opens a long base order and preplaces up to seven limit safety orders below entry, increasing size by a volume scale as price falls.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code200
Settings11inputs
LicenceCustom licence
Last update2 years ago9 Aug 2024

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

Fibonacci Martingale Strategy recalculates an average entry and closes the whole position when price reaches a take-profit percentage above that average. Order sizes, deviation, scales, and the safety-order cap are inputs. Stop loss is optional and off by default, so losses are not capped unless that setting is enabled. It draws on the price chart and only trades long.

Details

Published by

thibaultyou on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Mean reversion, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy can add several entries in the same direction
  • The strategy enters trades without a stop loss

Settings

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

SettingTypeDefaultVariable
Base Order Size (%)float3.4base_order_size_pct
Safety Order Size (%)float2.1safety_order_size_pct
Safety Order Step Scalefloat1.7safety_order_step_scale
Safety Order Volume Scalefloat2.8safety_order_volume_scale
Price Deviation to Open Safety Orders (%)float0.89initial_safety_order_distance_pct
Take Profit (%)float1.49take_profit_percentage
Max Safety Orders Countint7max_safety_orders_count
Use Stop Lossboolfalseuse_stop_loss
Stop Loss Deviation (%)float60.0stop_loss_deviation_pct
Bubble backgroundcolorcolor.new(color.white, 100)Bubble background
Bubble textcolorcolor.whiteBubble text
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

330 stars

This strategy divides a fixed price range between an upper and a lower limit into equally spaced grid levels and plots them on the price chart. It marks a buy when price crosses down through a grid and a sell when price crosses up through a grid, using either

Strategy v5 Support & resistanceMean reversion Repaints
Updated 2 months ago · None stated GitHub repository of Grid Bot Simulator [Alorse]

3C QFL Mean Reversal

by hasnocool
106 stars

3C QFL Mean Reversal is a strategy based on the Quickfinger Luc (QFL) trading methodology. It identifies breakdown buying opportunities below established price base levels and enters mean-reversion trades. The strategy includes multi-safety order DCA scaling,

Strategy v5 Mean reversionSupport & resistance Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3C QFL Mean Reversal

This strategy builds a spot grid between user-set high and low prices and draws it on the price chart. It splits that range into ten levels and places up to five long limit orders at the lower levels, sizing each from current equity. Orders already below price

Strategy v6 Support & resistanceMean reversion Repaints
Updated 6 weeks ago · None stated GitHub repository of Grid Spot Trading Algorithm [The Quant Science]

FairValueGap E003

by ruckard
13 stars

Calculates the distance between the current price and the opposite end of the latest fair value gap, entering trades on the expectation that price will partially fill the gap. It incorporates risk management with customizable stop loss, take profit based on ri

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of FairValueGap E003

Wyckoff Phase

by muammeryldrm42
7 stars

This strategy identifies Wyckoff consolidation ranges directly on the price chart to trade potential spring and upthrust events. It calculates highest highs and lowest lows over a customizable lookback period, filtering setups by average volume spikes and ATR

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 3 months ago · MIT GitHub repository of Wyckoff Phase

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