Hi,
i want to find Text value of arrow in my chart.
in this chart ,incoming many arrow and whenever i see new arrow in my chart i want to receive alert message
and i was modified some source .
one of problem is after every bar alert message popup.
how can i make alert message only one time ?
thanks in advance!
i want to find Text value of arrow in my chart.
in this chart ,incoming many arrow and whenever i see new arrow in my chart i want to receive alert message
and i was modified some source .
one of problem is after every bar alert message popup.
how can i make alert message only one time ?
thanks in advance!
Inserted Code
#property indicator_chart_window
extern bool alertsOn = true;
extern bool alertsOnCurrent = false;
extern bool alertsMessage = true;
extern bool alertsSound = false;
extern bool alertsEmail = false;
//bool Alerted = false;
extern bool displayAlert = true;
static datetime lastAlertTime;
//
//------------------------------------------------------------------
datetime gOldTime=0;
bool NewBar()
{
bool new = Time[0] != gOldTime;
gOldTime = Time[0];
return (new);
}
int init() {
return(0);
}
int deinit() {
return(0); }
int start()
{
//static datetime Time0;
//if (Alerted) return(-1);
//int Sit;
int counted_bars=IndicatorCounted();
int i,shift;
int limit;
if(counted_bars < 0)
return(-1);
if(counted_bars > 0)
counted_bars--;
limit = Bars - counted_bars;
for(i = shift ;i<=limit;i++){
string name = ObjectName(i);
if (StringFind(name, "Test") == 0)
{
DisplayAlert("Found!",Symbol());
Print(Symbol());
}
}
}
void DisplayAlert(string message, int shift)
{
if(shift <= 2 && Time[shift] != lastAlertTime)
{
lastAlertTime = Time[shift];
Alert(message, Symbol(), " , ", Period(), " minutes chart");
}
}
void doAlert(int forBar, string doWhat)
{
static string previousAlert="nothing";
static datetime previousTime;
string message;
if (previousAlert != doWhat || previousTime != Time[forBar]) {
previousAlert = doWhat;
previousTime = Time[forBar];
//
//
//
//
//
message = Symbol()+" at "+TimeToStr(TimeLocal(),TIME_SECONDS)+" "+doWhat;
if (alertsMessage) Alert(message);
if (alertsEmail) SendMail(Symbol()+"alerts",message);
if (alertsSound) PlaySound("alert2.wav");
}
} Attached Image