Bernard13

BYP Supervisor

Category: Indicators By: Bernard13 Created: September 18, 2026, 3:15 PM
September 18, 2026, 3:15 PM
Indicators
4 Comments
BYP Supervisor

Hello,

Here is an algorithm that generalizes the “Open Price Range” (OPR) strategy, allowing you to monitor price direction over a specific time interval.

It operates on a 1-minute timeframe, enabling simultaneous (or independent) monitoring of the four major markets: Euronext, London, NYSE/Nasdaq, and Tokyo.

A “custom hours” option is available, which is also useful for 24/7 markets.

The standard OPR observation period is 15 minutes, but you can adjust this parameter to suit your specific goals.

A green or red tag indicates whether your entered times correspond to market opening hours and validates the monitoring process.

The system handles standard weekdays (Monday through Friday) only; this restriction does not apply to the custom hours option.

A light-colored band appears when monitoring begins and darkens as the market approaches closing time; it also displays the midpoint of the monitored range.

Happy trading to everyone.


//==========================================================================================================================
// #I BYP Supervisor (Open Price Range)
//==========================================================================================================================
DEFPARAM DrawOnlastBarOnly= True // Force the graph to the right
//DEFPARAM CalculateOnLastBars= 10000
StartEU = 90000
EndEU = 173000
StartLSE = 80000
EndLSE = 160000
StartUS = 153000
EndUS = 220000
StartJP = 50000
EndJP = 80000
StartFree = 100000
EndFree = 120000
Euronext = 0
TimeControl = 1
LSE = 0
DurationOPR = 1500
NyseNasdaq = 0
OpacityBand = 60
Japan = 0
aLg = 200
FreeHours = 0

//==========================================================================================================================
// ProRealTime V12 / Partage des connaissances ProRealTime. / Sharing ProRealTime knowledge.
// 2026 09 18 12:30 . 2026 09 03 00:15 . 2026 04 13 00:13 . 2025 10 13 18:05 . 2025 10 05 11:40 . 2024 05 01 23:17
// by Bernard13 "BYP"



X= BarIndex // X-axis

//==========================================================================================================================
IF NOT TimeControl THEN // Reminder regarding market hours.
DrawText("Warning: Check the summer/winter hours and market opening/closing times !", 0, 0, Dialog, Bold, 40) Coloured("Red") Anchor(Middle)
ENDIF

//==========================================================================================================================
// 1. Market times, flags permissions, colors
//==========================================================================================================================
//NOTE: Public holidays not managed
IF DayOfWeek >= 1 AND DayOfWeek <= 5 THEN
DayMarket= 1 // Monday Friday
ELSE
DayMarket= 0 // No Saturday Sunday.
ENDIF

//--------------------------------------------------------------------------------------------------------------------------
//----- Standard OPR: 15mn by default HHmmss = 001500
EndOPR= DurationOPR

//----- 1 Euronext (Cyan)
$StartMarket[1]= StartEU // 090000
$EndMarket[1]= EndEU // 173000
$Market[1]= EURONEXT
$r[1]= 0
$g[1]= 255
$b[1]= 255

//----- 2 London (Lime)
$StartMarket[2]= StartLSE // 080000
$EndMarket[2]= EndLSE // 160000
$Market[2]= LSE
$r[2]= 0
$g[2]= 255
$b[2]= 0

//------ 3 United States (Plum)
$StartMarket[3]= StartUS // 153000
$EndMarket[3]= EndUS // 220000
$Market[3]= NYSENASDAQ
$r[3]= 220
$g[3]= 160
$b[3]= 220

//------ 4 Japan (Yellow)
$StartMarket[4]= StartJP // 010000
$EndMarket[4]= EndJP //070000
$Market[4]= JAPAN
$r[4]= 255
$g[4]= 255
$b[4]= 0

//----- 5 Free Hours (Orange)
$StartMarket[5]= StartFree // 100000
$EndMarket[5]= EndFree // 120000
$Market[5]= FreeHours
$r[5]= 255
$g[5]= 160
$b[5]= 0

//=======================================================================================================================
// 2. CALCULATIONS
//=======================================================================================================================
m= 000100 // First candle until closing
FOR i= 1 TO 5 DO // 5 Markets

//----- OPR Start
IF Time = $StartMarket[i] + m THEN
$X0[i]= X
$H[i]= High
$L[i]= Low
ENDIF

//----- OPR in progress
IF Time > $StartMarket[i] AND Time <= $StartMarket[i] + EndOPR THEN
$X[i]= X
$H[i]= MAX($H[i], High)
$L[i]= MIN($L[i], Low)
$Mid[i]= ($H[i] + $L[i]) / 2
$XstartMid[i]= X
a= OpacityBand + 40 // OPR on
$OprMarket[i]= 1 // Market on
DrawPoint($X0[i], $Mid[i], 2) Coloured($r[i],$g[i],$b[i])
DrawSegment($X0[i], $Mid[i], $X[i], $Mid[i]) Coloured($r[i],$g[i],$b[i]) Style(DottedLine4,2)

//----- OPR fixed
ELSIF Time >= $StartMarket[i] + EndOPR AND Time <= $EndMarket[i] THEN
a= OpacityBand // OPR off
$OprMarket[i]= 1 // Market on
$XendMid[i]= X

ELSE //----- Stopping band
$H[i]= $Mid[i]
$L[i]= $Mid[i]
a= 0 // No band. OPR off
$OprMarket[i]= 0 // Market off

ENDIF

//====================================================================================================================
// 3. DISPLAY
//====================================================================================================================
//----- Layout
margin= -80 // X-axis
X0= -100 // X-axis for right margin
Ls= 18 // Y-axis for Lines spacing
Bs= 100 // Y-axis for Blocks spacing

//----- Titles
DrawText("OPR ( UT 1m )", X0 + 25, -Ls, Dialog, Bold, 16) Coloured("White") Anchor(TopRight)
IF i= 1 THEN
DrawText("EURONEXT", X0, Ls - i * Bs, Dialog, Bold, 14) Coloured("Cyan") Anchor(TopRight)
ELSIF i= 2 THEN
DrawText("LONDON", X0, Ls - i * Bs, Dialog, Bold, 14) Coloured("Lime") Anchor(TopRight)
ELSIF i= 3 THEN
DrawText("NYSE NASDAQ",X0, Ls - i * Bs, Dialog, Bold, 14) Coloured("Plum") Anchor(TopRight)
ELSIF i= 4 THEN
DrawText("TOKYO", X0, Ls - i * Bs, Dialog, Bold, 14) Coloured("Yellow") Anchor(TopRight)
ELSIF i= 5 THEN
DrawText("Free Hours", X0, Ls - i * Bs, Dialog, Bold, 14) Coloured("Orange") Anchor(TopRight)
ENDIF

//----- Levels. (PRT V12: No array with DrawText(...) Variables in numeric-mode only !)
Hi= $H[i]
Li= $L[i]
Mi= (Hi + Li) / 2
dHL= Hi - Li
DrawText("H #Hi#", X0, 0 * Ls - i * Bs, Dialog, Bold, 14) Coloured($r[i],$g[i],$b[i],aLg) Anchor(TopRight)
DrawText("Mid #Mi#", X0, -1 * Ls - i * Bs, Dialog, Bold, 14) Coloured($r[i],$g[i],$b[i],aLg) Anchor(TopRight)
DrawText("L #Li#", X0, -2 * Ls - i * Bs, Dialog, Bold, 14) Coloured($r[i],$g[i],$b[i],aLg) Anchor(TopRight)
DrawText("dHL #dHL#", X0, -3 * Ls - i * Bs, Dialog, Bold, 14) Coloured($r[i],$g[i],$b[i],aLg) Anchor(TopRight)

//----- Tag points: Off-market, Open market, Closed market
IF i <> 5 AND DayMarket= 0 THEN
DrawPoint(X0-Margin, Ls - i * Bs, 3) Coloured("Gray") Anchor(TopRight)
ELSE
IF $OprMarket[i]= 1 THEN
DrawPoint(X0-Margin, Ls - i * Bs, 3) Coloured("Lime") Anchor(TopRight)
ELSE
DrawPoint(X0-Margin, Ls - i * Bs, 3) Coloured("Red") Anchor(TopRight)
ENDIF
ENDIF

//----- Bands
IF i= 1 AND Euronext THEN
ColorBetween($H[i], $L[i], "Cyan", a)
DrawPoint($X0[i], $Mid[i], 2) Coloured("Cyan")
DrawSegment($X[i], $Mid[i], $XEndMid[i], $Mid[i]) Coloured("Cyan") Style(DottedLine4,2)
ELSIF i= 2 AND LSE THEN
ColorBetween($H[i], $L[i], "Lime", a)
DrawPoint($X0[i], $Mid[i], 2) Coloured("Lime")
DrawSegment($X[i], $Mid[i], $XEndMid[i], $Mid[i]) Coloured("Lime") Style(DottedLine4,2)
ELSIF i= 3 AND NYSENASDAQ THEN
ColorBetween($H[i], $L[i], "Plum", a)
DrawPoint($X0[i], $Mid[i], 2) Coloured("Plum")
DrawSegment($X[i], $Mid[i], $XEndMid[i], $Mid[i]) Coloured("Plum") Style(DottedLine4,2)
ELSIF i= 4 AND JAPAN THEN
ColorBetween($H[i], $L[i], "Yellow", a+50)
DrawPoint($X0[i], $Mid[i], 2) Coloured("Yellow")
DrawSegment($X[i], $Mid[i], $XEndMid[i], $Mid[i]) Coloured("Yellow") Style(DottedLine4,2)
ELSIF i= 5 AND FreeHours THEN
ColorBetween($H[i], $L[i], "Orange", a+20)
DrawPoint($X0[i], $Mid[i], 2) Coloured("Orange")
DrawSegment($X[i], $Mid[i], $XEndMid[i], $Mid[i]) Coloured("Orange") Style(DottedLine4,2)
ENDIF

NEXT //... 5 Markets

//==========================================================================================================================
RETURN
//==========================================================================================================================

Download
Filename: I-BYP-Supervisor.itf
Downloads: 19
Bernard13
Bernard13 Senior
As an architect of digital worlds, my own description remains a mystery. Think of me as an undeclared variable, existing somewhere in the code.
Author’s Profile

Comments

Bernard13
1 week ago
#

Bonjour @Nicolas,

Ton initiative de préciser les paramêtres qui étaient inclus dans mon code m'a beaucoup surpris.

Pour les novices c'est le bouton "Copy" qui sème le doute et ne devrait pas exister selon moi.

Le bouton "Download" télécharge le code ET tous les paramètres du graphiques ET fait fonctionner le code au premier jet.

Le bouton "Copy" ne fait que copier strictement le code et reste réservé plutôt aux experts pour un gain de temps immédiat à se plonger dans l'algo.

Très cordialement.

Nicolas
1 week ago
#

Le bouton copy est largement plus utilisé que le téléchargement du fichier, presque 11 ans de retour sur le comportement des users du site me le confirme :-) Sans l'ajout des paramètres dans le code, il y a aura inévitablement des commentaires pour dire que le code ne compile pas car il manque telle ou telle variable. Sans compter, toutes les personnes qui auront abandonnées à cause de cette erreur, ce serait vraiment dommage alors que tu as pris du temps pour le partager ! Merci pour ta contribution que j'apprécie. N'hésite pas si tu as d'autres codes ;-)

Bernard13
1 week ago
#

Il y a un problème que je viens de découvrir dans la publication de ce code en le copiant.

@Nicolas, tu as rajouté les lignes 1 à 20, ce qui a pour conséquence de bloquer le code car l'instruction DEFPARAM n'est plus en première ligne et bloque tout l'algo.

Pour ma part, peut-on insérer plusieurs images (capture des variables et capture des saisies) en plus de l'image générique de l'indicateur lorsque l'on propose la publication d'un indicateur ?

Je n'ai pas pu (ou pas su) les insérer.

Ici aussi, dans ces commentaires je ne peux les insérer et rien corriger. Tout cela n'est pas très intuitif pour les novices.

Très cordialement.

Nicolas
1 week ago
#

Désolé c'est corrigé !

ProRealCode ProRealCode
Loading...