# NEOTICKER DATA BEGIN ScriptType=Indicator Description=Jeff Cooper Expansion Breakouts Part 1 Name=sys_jc_exbreakoutspart1 Language=Formula Links=1 MinBars=0 TimerInterval=100 MetaStyle=Normal ValueRange=Same as Source Placement=New Pane Multiplot_num_plots=1 Multiplot_color_0=255 Multiplot_style_0=Line Multiplot_width_0=1 Multiplot_enabled_0=1 Multiplot_breakstyle_0=0 UpdateByTick=0 TradingSystemUI=1 PrimaryLinkOnly=0 NotifyOnRemoval=0 Param_count=4 Param_name_0=postion size Param_inuse_0=1 Param_type_0=integer.gt.0 Param_default_0=100 Param_name_1=entry point size Param_inuse_1=1 Param_type_1=real Param_default_1=0.13 Param_name_2=protective stop point Param_inuse_2=1 Param_type_2=real Param_default_2=1.0 Param_name_3=days to exit Param_inuse_3=1 Param_type_3=integer.gt.0 Param_default_3=5 Explanation_Lines=0 # NEOTICKER DATA END $mysize := param1; $myentry := param2; $myprotective := param3; $myexitbar := param4; 'save position direction information pos_dir := choose(openpositionlong>0,1,openpositionshort>0,-1,0); 'make a month bar out of the underlying daily bars compressseries(monthseries, data1, ppMonthly, 1); 'long signal two calendar month high $longrule1 := (h>monthseries.h(1)) and h>=monthseries.h and (monthseries.h>0) and (monthseries.h(1)>0); 'short signal two calendar month low $shortrule1 := (l0) and (monthseries.l(1)>0); 'bigest range of in the pass 9 day $rule2 := range(data1) >= hhv(1,range(data1),9); 'save stop price value at long signal bar $longstopprice := if($longrule1>0 and $rule2>0 and openpositionflat>0, c(2)-$myprotective, $longstopprice); longlimit($longrule1>0 and $rule2>0 and openpositionflat>0, h+$myentry, $mysize, "long limit above today high"); longexitstop(openpositionlong>0, $longstopprice, $mysize, "exit long stop under yesterday close"); longexitatmarket(summation(pos_dir, $myexitbar)>=$myexitbar and openpositionlong>0, $mysize, "exit long at market at 5th day"); $shortstopprice := if($shortrule1>0 and $rule2>0 and openpositionflat>0, c(2)+$myprotective, $shortstopprice); shortlimit($shortrule1>0 and $rule2>0 and openpositionflat>0, l-$myentry, $mysize, "short limit below today low"); shortexitstop(openpositionshort>0, $shortstopprice, $mysize, "exit short stop above yesterday close"); shortexitatmarket(absvalue(summation(pos_dir, $myexitbar))>=$myexitbar and openpositionshort>0, $mysize, "exit short at market at 5th day"); plot1 := currentequity;