#property show_inputs
extern string Date="2004.07.01 00:00";
extern string DateOut="2010.12.31 23:00";
//+–+
//| script program start function |
//+–+
int start()
{
int handle=FileOpen("In.csv",FILE_CSV|FILE_READ|FILE_WRITE,";");
int handleOut=FileOpen("Out.csv",FILE_CSV|FILE_READ|FILE_WRITE,";");
Alert("Идет запись файлов");
for(int i=iBars(NULL,0)-1; i>=0; i–)
{
string Date1=TimeToStr(iTime(NULL,0,i));
if(DateOut>=Date1 && Date<=Date1)
{
if(iHigh(NULL,0,i)>iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_MAIN,i) && iLow(NULL,0,i)<iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_MAIN,i) && ((iHigh(NULL,0,i+1)<iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_MAIN,i+1) && iLow(NULL,0,i+1)<iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_MAIN,i+1)) ||