# NEOTICKER DATA BEGIN ScriptType=Indicator Description=Open Range Breakout Name=OpRngBO Language=Formula Links=1 MinBars=0 TimerInterval=100 MetaStyle=Normal ValueRange=Large Positive Placement=Smart Multiplot_num_plots=1 Multiplot_color_0=33587200 Multiplot_style_0=Line Multiplot_width_0=1 Multiplot_enabled_0=1 Multiplot_breakstyle_0=0 UpdateByTick=0 TradingSystemUI=1 PrimaryLinkOnly=1 NotifyOnRemoval=0 Param_count=4 Param_name_0=Start Time Param_inuse_0=1 Param_type_0=time Param_default_0=10:10:0 Param_name_1=Avg Daily Range Param_inuse_1=1 Param_type_1=integer.gt.0 Param_default_1=6 Param_name_2=Stop Time Param_inuse_2=1 Param_type_2=time Param_default_2=15:0:0 Param_name_3=Contraction Param_inuse_3=1 Param_type_3=real Param_default_3=140 Explanation_Lines=1 Explanation0=Open Range Breakout is a daytrading system that trades breakout of the range the day has traded upto the Start Time. The system will stop taking new position by Stop Time. One example filter is provided to filter out days right after bigger range days, which are expected to be contraction or consolidation. Open Range Breakout requires one data series (Link 1). # NEOTICKER DATA END ' Open Range Breakout ' Daytrading System ' written by Lawrence Chan ' Copyright (c) 2005 TickQuest Inc. ' All rights reserved ' save parameters into more meaningful names $start_time := param1; $avg_daily_period := param2; $stop_time := param3; $contraction_pct := param4 / 100; ' create the daily data needed for signal generation and filtering compressseries (dailybar, data1, ppdaily, 1); makeindicator (dailyrange, avgrange, dailybar, $avg_daily_period); ' when it is time, figure out the break out price levels $switch_time := time (1) <= $start_time and time > $start_time; $bo_high := if ($switch_time, dailybar.high, $bo_high); $bo_low := if ($switch_time, dailybar.low, $bo_low); ' the system should only trade between the prescribed time period $order_time := time > $start_time and time <= $stop_time; ' only one trade in one direction is taken per day $long_once := if (date <> date (1), 0, if (openpositionlong, 1, $long_once)); $short_once := if (date <> date (1), 0, if (openpositionshort, 1, $short_once)); ' our general trade filter based on wide range movement in ' previous trading day $possible_contraction := (dailybar.high (1) - dailybar.low (1)) >= dailyrange (1) * $contraction_pct; ' order placement ' notice each condition is typed on a new line ' it is a good way for debugging and fine tuning a system ' because you can easily comment out the specific condition ' by the comment marker at the beginning of the line longstop ( $order_time > 0 and $possible_contraction <= 0 and $long_once <= 0 and openpositionlong <= 0, $bo_high, defaultordersize, "LE"); shortstop ( $order_time > 0 and $possible_contraction <= 0 and $short_once <= 0 and openpositionshort <= 0, $bo_low, defaultordersize, "SE"); ' for this system we do not have fancy plotting, just the equity curve plot1 := currentequity;