//@Name:Hidden Gap //@Description:Changes the colour of Hidden Gap Candles to a user defined colour. /* WRB *W*ide* R*ange* Body* (candlestick chart users) is an interval that has a body difference between Open and Close) with a price area larger than the bodies of *each* of the prior *three intervals *(each interval individually compared to the WRB). *WRB Hidden GAP* The Hidden GAP is (defined) by the price action of the single interval *before* the WRB and the price action of the single interval *after* the WRB. Simply, if you remove the WRB and there’s *no overlapping in prices* between the interval *before* the WRB and the interval *after* the WRB…the WRB is transformed into a WRB Hidden GAP. */ var hgColour = Colour.DarkBlue var pcnt = 10 function init(status) { if (status == Loading || status == Editing) { hgColour = storage.getAt(0); } if(status == Adding|| status == Editing) { drawDialogBox(); } buttonHandle = createButton("Settings", onButton0); } function onButton0() { hgColour = storage.getAt(0); drawDialogBox(); } function drawDialogBox() { var dlg = new Dialog("Settimgs...", 200, 55); dlg.addOkButton(); dlg.addCancelButton(); dlg.addColPicker("VAL1",5,15,-1,-1,"","Hidden Gap Candle Colour",hgColour); if (dlg.show() == Dialog.Cancel) return false; hgColour = dlg.getValue("VAL1"); storage.setAt(0, hgColour); onNewChart(); } function onNewChart() { clearDisplay(); draw(); } function onNewBarUpdate(preExisting) { if (!preExisting) { clearDisplay(); draw(); } } function draw() { var currBody = 0; //Current Body size. var wrb = 0; //Wide Range Body flag. for(var i=3;i Math.abs(bars[i-1].open-bars[i-1].close) && currBody > Math.abs(bars[i-2].open-bars[i-2].close) && currBody > Math.abs(bars[i-3].open-bars[i-3].close) )wrb = 1; if(wrb == 1) { if(bars[i+1].low> bars[i-1].high || bars[i+1].high