//@Name:Gann Levels //@Description:Draws Gann levels between two fixed points. //@Env:Production //@Editable:No var posButtonHandle; var negButtonHandle; var posNeg = 0; //draw positive or negative Gann var chl = 0; //use close or high-low to draw gann levels var state = 0; //the 3 drawing states: 0:before button press, 1:before candle click var items = []; //array of shares with stored gann values var thisItem; //the line number of the current share function init() { posButtonHandle = createButton("x", posButton); negButtonHandle = createButton("x", negButton); chlButtonHandle = createButton("x", chlButton); createButton("Remove All", reset); var F = new File(); try { F.open("/Output/GannLevels.cfg",File.ReadMode); } catch (e) { F.open("/Output/GannLevels.cfg",File.WriteMode); } finally { F.close(); } var F = new File(); try { F.open("/Output/GannLevels.txt",File.ReadMode); } catch (e) { F.open("/Output/GannLevels.txt",File.WriteMode); F.writeLine("0.0625,0.083,0.1,0.125,0.1666,0.25,0.33,0.375,0.50,0.67,0.75,0.90,1"); } finally { F.close(); } } function onNewChart() { clearDisplay(); state = 0; updateInterface(); drawStoredLevels(); } function reset() { clearDisplay(); state = 0; items[thisItem].length = 2; //delete the whole storage entry for this share except for the SharescopeID and share number //write the changes to the file var F = new File(); F.open("GannLevels.cfg",File.WriteMode); for (i=0;i