La posizione dell’Open e Close della barra daily di ieri influenza la price action di oggi … in altre parole, esiste un legame tra la Open/Close di ieri e ciò che mi posso aspettare oggi?
Il primo che conosco ad essersi posto la domanda ed avere provato a dare una risposta statistica è Toby Crabel, per capirci il papà della tecnica OBR (il suo libro è introvabile oltre a costare una fortuna ma se si sa dove cercare … non dico altro)
Oggi ho “spipolato” un po’ con EL ed ho costruito uno script che se applicato come strategia a vari sottostanti mostra delle caratteristiche interessanti.
La logica di fondo è quella di segmentare la barra daily di ieri in percentili quindi far variare la Open e la Close nei vari segmenti ed andare ad aprire un trade long o short all’open della barra di oggi che viene chiuso a fine giornata. Ripetendo questo ragionamento su un certo numero di anni si può osservare se esistono alcuni pattern interessanti.
Non consiglio di tradare questi pattern … ma se si pensa ad eventuali filtri magari su sistemi intraday la cosa si fa interessante
Vi allego alcuni screenshot elaborati in excel e lo script EL.
Buon lavoro
P.S.1: Lo script è ben commentato ma se qualcuno avesse problemi lasci un post con le sue domande.
P.S.2: Nello script si può attivare un flag che permette l’analisi di ogni singolo segmento per chi volesse farci ulteriori studi.
___________________________________________________________________
{== START OF HEADER ==========================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2018. WIZ3003
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Program: BIAS Close-Open Analyzer
Date: 2019-04-14
Platform: TradeStation v9.5 (Update 27)
Timeframe : Daily or the equivalent in minutes to avoid the settlement effect
DESCRIPTION:
Code to analyze Close OPen filter in the market on daily timeframe (Daily Segment Study)
Objective is to study if the yesterday Open-Close relationship influences the today price action.
For more information see:
Toby Crabel - Day Trading with Short Term Price Patterns and ORB pag. 227
VERSION LOG:
R00.00: Release of the first version of the template
== END OF HEADER =============================================================================}
Input: {Declaration of Inputs ================================================================}
// +++ Daily bar scanning
N_Part(10), // Number of bar segments (Percentile)
X(0), // Lower boundary : Range for optimization [0 --> Segment-1]
Y(0), // Upper boundary : Range for optimization [0 --> Segment-1]
IsPercentile(false), // OFF if you study sectors effects
IsSector(true), // OFF if you study percentile effects
// +++ Trading side
IsLongAllowed(true), // Long side flag
IsShortAllowed(false); // Short side flag
Var : {Declaration of variables ============================================================}
Segment(0); // Unit segment Lenght
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//| CLOSE-OPEN PERCENTILE BIAS SCANNER - SETUP TF DAILY
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Segment = (High-Low)/N_Part;
If IsPercentile then // Check the Open and Close position in the yesterday bar
If (TRUE // Analyze the influence of each percentile
and Open >= Low + X*Segment and Open < Low + (X+1)*Segment
and Close >= Low + Y*Segment and Close < Low + (Y+1)*Segment) then begin
if IsLongAllowed then buy next bar at Open;
if IsShortAllowed then sellshort next bar at Open;
end;
If IsSector then // Check the Open and Close position in the yesterday bar
If (TRUE // Analyze the influence of different sectors
and Open >= Low + X*Segment //and Open < Low + Y*Segment
and Close >= Low + Y*Segment //and Close < Low + Y*Segment
) then begin
if IsLongAllowed then buy next bar at Open;
if IsShortAllowed then sellshort next bar at Open;
end;
setexitonclose;
//
// PRINT LOG Routine
//
if lastbaronchart then print(
Getsymbolname," ",
" %P: ", percentprofit:0:1,
" MaxDD: ", Maxiddrawdown:0:0,
" NetProfit: ", netprofit:0:0,
" NP/MaxDD: ", -netprofit/(Maxiddrawdown-0.01):0:1,
" NumOP: ", Totaltrades:0:0,
" AvgTrd: ", (Netprofit/(Totaltrades+1)):0:1,
" ProfitFactor: ", -grossprofit/(grossloss-0.01):0:2);
{== END OF MAIN PROGRAM ======================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2018. WIZ3003
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}