//@Name:Alarm:Mid HH-LL //@Description:An alarm that triggers when the mid price crosses the previous day's high or low //@Update:Periodic, 30 //@Env:Production //@Returns:Text //@Width:160 // 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. //Coded by: Richard Chiesa, ShareScript Support function getVal(share) { var mid = share.getIMid(); if (mid==null) return; var h = share.getHigh(); var l = share.getLow(); var oldAlarm = getValueForShare(share); var alarmText; if ((oldAlarm != 1 || !isAlarmContext) && mid>h) { setValueForShare(share, 1); alarmText = "Price above prev high"; } if ((oldAlarm != -1 || !isAlarmContext) && mid