Reset input variable after trigger

 

Hi, I want to reset extern variable in this code:

extern double alert1 = 0;

OnCalculate {

int AlertCount = 0;
if (alert1 != 0){
if (Bid >= alert1 ){
static datetime TimeStamp;
if(TimeStamp != Time[0])
{
Alert(Symbol(), "Alert");
AlertCount = 1;
TimeStamp = Time[0];
}
alert1 = 0;
}
}

}

when price reaches indicated price (price is indicated in input menu) it must be reset to 0 in input window too, someone has experience on this?

 
You can't modify inputs. Don't modify externs. Copy the variable in OnInit, use/reset the copy.
 
William Roeder:
You can't modify inputs. Don't modify externs. Copy the variable in OnInit, use/reset the copy.

Ok, thanks William !

Reason: