i plot 400 bar high and 400 bar lows. however the market is trending so high that my 400 bar low is very far away sqewing my charts as you can see here.
i would like to not plot the 400 bar low if its >3 ATR away on the visible chart. I am thinking aloud and any ideas will help me fix it.
sym = "";
SetChartOptions( 0, chartShowArrows | chartShowDates );
sym="DJA";
result=SetForeign( sym, fixup = False, tradeprices = False ) ;
if(result){
Plot( C, "Close", ParamColor( "Color", colorBlack ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
//PlotForeign( sym, sym, ParamColor( "Color", colorCycle ), ParamStyle( "Style" ) | GetPriceStyle() );
// PlotForeign( sym, sym, ParamColor( "Color", colorCycle ), ParamStyle( "Style" ) | GetPriceStyle() );
movingAverageOfInd = EMA( c, 9 );
Plot( movingAverageOfInd, "movingAverageOfInd", colorYellow, styleLine );
fourhundredHighLong = Ref( HHV( h, 400 ), -1 );
fourhundredHighShort = Ref( llv(l, 400 ), -1 );
Plot( fourhundredHighLong, "400 High", colorWhite, styleLine );
Plot(fourhundredHighShort, "400 low", colorWhite, styleLine );
Title = " Market chart is " + sym + " " + Name() + " " + FullName();
}
RestorePriceArrays( True ); // <- should match parameter used in SetForeign