// Downloaded From https://www.WiseStockTrader.com _SECTION_BEGIN("Gartley Tool"); Gartley=ParamToggle("Gartley","OFF|ON",1); Trg=ParamToggle("Show Targets","Yes|No",1); Type=ParamToggle("Label","ABCD|PRICE",1); Snap=ParamToggle("Snap","Yes|No",1); if(Gartley==1) { SetBarsRequired( -2, -2 ); bi = BarIndex(); bis = SelectedValue( bi ); symbol = Name(); tframe = Interval(); chartID = GetChartID(); Xname = "X" + chartID + symbol + tframe; Yname = "Y" + chartID + symbol + tframe; LeftButton = GetCursorMouseButtons() & 1; a = Nz(StaticVarGet("counter")); if ( leftButton ) { StaticVarSet("counter", a+1); x = GetCursorXPosition( ); y = GetCursorYPosition( ); StaticVarSet( Xname + bis, x ); StaticVarSet( Yname + bis, y ); } j = 0; dt = DateTime(); shapePlot = 0; shapePos = Null; xx = yy = Null; FirstVisibleBar = Status( "FirstVisibleBar" ); Lastvisiblebar = Status( "LastVisibleBar" ); for ( i = FirstVisibleBar; i