//+------------------------------------------------------------------+
//| вфайл.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp. |
//| _http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
bool b;bool a;
double lowest;
extern int period;
extern int kolbardo=5;
extern int AOkol=7;
int profrast=0;int handle;int handle1;int h , h1;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
profrast=profrast*Point;
handle=FileOpen("buy.CSV", FILE_CSV|FILE_WRITE|FILE_READ, '/');
handle1=FileOpen("sell.CSV", FILE_CSV|FILE_WRITE|FILE_READ, '/');
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
period=Period();
/*
if(Bid-iHigh(Symbol(),period,iLowest(Symbol(),period,MODE_HIGH,kolbardo,0))>profrast)
{
if(handle>0)
{
FileSeek(handle,0, SEEK_END);
for(int i=0;i<=AOkol;i++)
{
Print("почему целое число? buy",iHigh(Symbol(),period,iLowest(Symbol(),Period(),MODE_HIGH,kolbardo,0)));
FileWrite(handle,iAO(Symbol(),period,i),"");
FileSeek(handle,-1, SEEK_END);
}
//FileWrite(handle,"\r\n");
}
}
if(iLow(Symbol(),period,iHighest(Symbol(),period,MODE_LOW,kolbardo,0))-Ask>profrast)
{
//-------------------------
if(handle1>0)
{
FileSeek(handle1,0, SEEK_END);
for(i=0;i<=AOkol;i++)
{
Print("почему целое число?sell",iHigh(Symbol(),period,iLowest(Symbol(),Period(),MODE_HIGH,kolbardo,0)));
FileWrite(handle1,iAO(Symbol(),period,i),"");
FileSeek(handle1, -1, SEEK_END);
}
//FileWrite(handle1,"\r\n");
}
}
*/
////////////////////////////////////////////////////////////////////////////////////////////////
//h=FileOpen("buy.CSV", FILE_CSV|FILE_READ, '/');
if(handle>0)
{
Print("if(handle>0)");
FileSeek(handle,0, SEEK_SET);
while (FileIsLineEnding(handle)<0.5)
{
string b=FileReadString(handle,1);
Print("df buy",b);//,FileTell(handle));
//FileSeek(handle,20, SEEK_CUR);
}}
else{Print("ошибка buy",GetLastError());}
//------------------------------------
//handle1=FileOpen("sell.CSV", FILE_CSV|FILE_READ, '/');
if(handle1>0)
{
Print("if(handle1>0)");
FileSeek(handle1,0, SEEK_SET);
while (FileIsLineEnding(handle1)<0.5)
{
string a=FileReadString(handle1,1);
Print("df sell",a);//,FileTell(handle1));
//FileSeek(handle1,20, SEEK_CUR);StringSubstr(Text,0,3)
}}
else{Print("ошибка sell",GetLastError());}
//----
return(0);
}