message= StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," THA: ",doWhat);
if (alertsMessage) Alert(message);
if (alertsEmail) SendMail(StringConcatenate(Symbol(),«TMA „),message);
if (alertsSound) PlaySound(“alert2.wav»);
}
}
//
//
//
//
//
int stringToTimeFrame(string tfs)
{
for(int l = StringLen(tfs)-1; l >= 0; l--)
{
int k = StringGetChar(tfs,l);
if((k > 96 && k < 123) || (k > 223 && k < 256))
tfs = StringSetChar(tfs, 1, l — 32);
else
if(k > -33 && k < 0)
tfs = StringSetChar(tfs, 1, l + 224);
}
int tf=0;
if (tfs==«M1» || tfs==«1») tf=PERIOD_M1;
if (tfs==«M5» || tfs==«5») tf=PERIOD_M5;
if (tfs==«M15»|| tfs==«15») tf=PERIOD_M15;
if (tfs==«M30»|| tfs==«30») tf=PERIOD_M30;
if (tfs==«H1» || tfs==«60») tf=PERIOD_H1;
if (tfs==«H4» || tfs==«240») tf=PERIOD_H4;
if (tfs==«D1» || tfs==«1440») tf=PERIOD_D1;
if (tfs==«W1» || tfs==«10080») tf=PERIOD_W1;
if (tfs==«MN» || tfs==«43200») tf=PERIOD_MN1;
if (tf==0 || tf<Period()) tf=Period();
return(tf);
}
tesc