//@Name:Trading Days Line //@Description:Draws a line between two fixed points and displays the percentage change and the number of trading days between them. //@Env:Production //@Editable:Yes var buttonHandle; var startIndex; var anchorHandle; 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() { buttonHandle = createButton("x", onButton); createButton("Remove All", reset); var F = new File(); try { F.open("/Output/tradDaysLine.cfg",File.ReadMode); } catch (e) { F.open("/Output/tradDaysLine.cfg",File.WriteMode); } 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 a part for the name //write the changes to the file var F = new File(); F.open("tradDaysLine.cfg",File.WriteMode); for (i=0;i