//@Name:ADX Level Cross //@Description:Finds shares that have crossed above the set trigger level. //@Returns:Number //@Width:80 //@Env:Production // Author: ShareScript Support // Care has been taken in preparing this code but it is provided without guarantee. // You are welcome to modify and extend it. Please add your name as a modifier if you distribute it. var period = 14; var level = 30; function init(status) { if (status == Loading || status == Editing) { period = storage.getAt(0); level = storage.getAt(1); } if (status == Adding || status == Editing) { dlg = new Dialog("Strong ADX",164,75); dlg.addOkButton(); dlg.addCancelButton(); dlg.addIntEdit("INT1",8,-1,-1,-1,"","Period",period,2,1000); dlg.addIntEdit("INT2",8,-1,-1,-1,"","Trigger level",level,0,100); dlg.addText(8,45,152,30,"Returns 1 if ADX is above trigger and DI+>DI- Returns -1 if ADX is above trigger and DI+=level) { if (adx1.getPDI()>=adx1.getNDI()) output = 1; else output = -1; } return output }