fpArray[x] = new FunctionParameter("AlertOn", FunctionParameter.STRING); with(fpArray[x++]){ setName("Alert"); addOption("OFF"); addOption("Warning"); setDefault("Warning"); function main(sStrategy, bShowTS, bShowL, bShowArrows, ViewValue, cColor, AlertOn) if (nClose1 < nATRTS1 && nClose > nATRTS1) { if(AlertOn="OFF"){ } else{ Alert.playSound("Warning.wav"); } Alert.email(getSymbol(),ViewValue,sStrategy, "Alert"); if (bShowArrows) drawShape( Shape.UPARROW, BelowBar1, Color.green); if (sStrategy == "Long") { if (bShowL) drawTextRelative(0, BelowBar2, " LONG", Color.white, Color.green, Text.PRESET|Text.CENTER|Text.FRAME, "Arial Black", 8, "b"+(getCurrentBarCount()), -5); Strategy.doLong("Long", Strategy.MARKET, Strategy.NEXTBAR); } else { if (bShowL) drawTextRelative(0, BelowBar2, " REVERSE", Color.white, Color.green, Text.PRESET|Text.CENTER|Text.FRAME, "Arial Black", 8, "b"+(getCurrentBarCount()), -5); if (Strategy.isShort()) Strategy.doCover("Exit Short", Strategy.MARKET, Strategy.NEXTBAR); }