Range Breaker

Strategy Examples

Range Breakup Nasdaq 15-minute

Code

//--------------------------------------------------------//
// *** Range Breakout Strategy - Nasdaq - 15-minutes  *** //
//--------------------------------------------------------//
// Author: Vivien Schmitt
// Website: https://artificall.com
// Indicator: Range Breaker
//--------------------------------------------------------//

DEFPARAM CUMULATEORDERS = False

//--------------------------------------------------------//
// *** SETTING BLOCK *** //
//--------------------------------------------------------//
// Capital to invest
ONCE CapitalToInvest = 10000
// Position Size
NumberOfContracts = ROUND(CapitalToInvest / Close, 2)
// Type of Breakout. Values: 1 to activate; 0 to inactivate
ONCE BullishBreakout = 1
ONCE BearishBreakout = 0
// Length of the range. Best values: 50; 100; 200
ONCE RangeLength = 20
// Extension of the Range
ONCE RangeExtension = 10
// Min range height (%)
ONCE HeightMin = 20
// Max range height (%)
ONCE HeightMax = 50
// Breakout conditions. Values: 1 to activate; 0 to inactivate
ONCE ValidatedBreakout = 0
// Volume Filter
ONCE VolumeIncreases = 0
// Trend Filter
ONCE PositiveTrend = 0
ONCE NegativeTrend = 0
// Target and Stoploss levels
ONCE TargetLevel = 6
ONCE StoplossLevel = 6
// Starting Year
ONCE StartingYear = 2000
// Font Size
ONCE FontSize = 12
// Return target and stoploss. Values: 1 to activate; 0 to inactivate
ONCE ReturnData = 1
//--------------------------------------------------------//

//--------------------------------------------------------//
// * INITIALIZATION OF THE VARIABLES * //
//--------------------------------------------------------//
ONCE myBreakout = 0
ONCE myTargetLong = 0
ONCE myStoplossLong = 0
ONCE myTargetShort = 0
ONCE myStoplossShort = 0
ONCE myHeight = 0
ONCE myTrend = 0
//--------------------------------------------------------//

//--------------------------------------------------------//
// *** IMPORT OF THE RANGE BREAKER INDICATOR *** //
//--------------------------------------------------------//
// -> TO DO BEFORE RUNING THE BACKTEST / A FAIRE AVANT DE LANCER LA BACKTEST //
// * Uncomment the following line before running the backtest (Remove de "//" at the beginning of the line)
// * Decommentez la ligne suivante avant de lancer le backtest (supprimez les "//" au début de la ligne)
myBreakout, myTargetLong, myStoplossLong, myTargetShort, myStoplossShort, myHeight, myTrend = CALL "RANGE.BREAKER"[BullishBreakout, BearishBreakout, RangeLength, RangeExtension, HeightMin, HeightMax, ValidatedBreakout, VolumeIncreases, PositiveTrend, NegativeTrend, TargetLevel, StoplossLevel, StartingYear, FontSize, ReturnData](close)
//--------------------------------------------------------//

IF close >= myTargetLong THEN
  myBreakout = 0
ENDIF

//--------------------------------------------------------//
// *** LONG POSITION OPENING *** //
//--------------------------------------------------------//
// NOT OnMarket AND
IF NOT OnMarket AND myBreakout = 1 THEN
  BUY NumberOfContracts CONTRACTS AT MARKET
  Set Target Price myTargetLong
  Set Stop Price myStoplossLong
ENDIF
//--------------------------------------------------------//

Backtest

Range Break up Nasdaq 15 minute
Share this Doc

Strategy Examples

Or copy link

CONTENTS