//@Name:Raff Regression Channels //@Description:A trand line with channels based on the highest high/lowest low //@Env:Production //@Editable:Yes var HLbuttonHandle; var CbuttonHandle; var state = 0; var anchorHandle; var firstIndex; var useClose = 0; var items = []; //array of stored data var lineCol = Colour.Red; function init(status) { HLbuttonHandle = createButton("x", HLbutton); CbuttonHandle = createButton("x", Cbutton); createButton("Remove All", reset); createButton("Set Colour", setup); if (status == Loading || status == Editing) lineCol = storage.getAt(0); if (status == Adding) storage.setAt(0, lineCol) var F = new File(); try { F.open("/Output/RaffRegChannels.cfg",File.ReadMode); } catch (e) { F.open("/Output/RaffRegChannels.cfg",File.WriteMode); } finally { F.close(); } } function setup() { lineCol = storage.getAt(0); dlg = new Dialog("Settings...", 145, 55); dlg.addOkButton(); dlg.addCancelButton(); dlg.addColPicker("COL1",20,15,-1,-1,"","",lineCol); if (dlg.show()==Dialog.Cancel) return false; var1 = dlg.getValue("COL1"); storage.setAt(0, var1); } function onNewChart() { clearDisplay(); state = 0; updateInterface(); drawStoredLevels(); } function reset() { clearDisplay(); state = 0; updateInterface(); 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("RaffRegChannels.cfg",File.WriteMode); for (i=0;i