Kod: Zaznacz cały
// EWX3 - zapis /odczyt
// EWX2 - DŹWIĘK
extern bool alarm=true; //wł/wył alarm
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if (alarm==true)
{
int uchwyt = FileOpen("EWX-dane.csv", FILE_CSV | FILE_WRITE, "\t");
FileWrite(uchwyt, Close[0], Open[0], High[0], Low[0], TimeToStr(OrderOpenTime()), "dupa");
FileClose(uchwyt);
int tab[3], uchwytx = FileOpen("EWX-dane.csv", FILE_CSV | FILE_READ);
if(uchwytx > 0)
{
Alert(FileReadArray(uchwytx, tab, 0, 3));
FileClose(uchwytx);
}
Comment("To jest alarm próbny");
PlaySound("alert.wav");
return(0);
}
//----
return(0);
}
//+------------------------------------------------------------------+