Is there an indicator of support and resistance levels on this site for the trading day, that was not redrawable. It was also possible to choose for which candles it should be redrawn (Daily, Monthly, Week). If I wanted to use this indicator as a basis for my own estimations, I would not have to look at them too closely, but I would expect to get a good results.
Search for "work with orders" in a textbook or documentation. use the order search function to find an order according to your parameters, change it with the order modification function.
The essence of the problem is to have 4 files with the values need to open each file, write everything to an array and calculate the average maximum and minimum values and then pass it to another array.
The error is this: when I call GetFileData();, ArrInsertInt(InsertArr, MathAbs(StrToInteger(value)); it starts to add values and not write them again.
string FNLenUp;//имя файла для записи\чтения длин восходящего движенияstring FNSpeedUp;//имя файла для записи\чтения скорости восходящего движенияstring FNLenDown;//имя файла для записи\чтения длин восходящего движенияstring FNSpeedDown;//имя файла для записи\чтения скорости восходящего движения //----------------------------------------------------------------------------------------------------------//int SpeedArrUp[];//массив времени фиксации цен восходящегоint LengthArrUp[];//массив цен восходящегоint SpeedArrDown[];//массив времени фиксации цен нисходящегоint LengthArrDown[];//массив цен нисходящегоexterndouble percent = 0.005;//пунктыint init()
{
GetNameF();
GetFileData(FNLenUp,LengthArrUp);
GetFileData(FNSpeedUp,SpeedArrUp);
GetFileData(FNLenDown,LengthArrDown);
GetFileData(FNSpeedDown,SpeedArrDown);
}
int GetFileData (string FileName, int& RetArr[])
{
int Handle = 0;//файловый указательint i = 0;
int F_newFile = -1;//Флаг создания нового файла (1)-да (0)-нетint InsertArr[];//Массив для извлечения в него данных из файлаint ArrSize = -1;//Размер массиваint ArrMax = -1;//Максимальное значениеint ArrMin = -1;//Минимальное значениеint ArrAverage = -1;//Среднее значениеstring value = 0;
//---------------------------------------------------------------------////Print(ArrSize);//Смотрим существует ли файл//И меняем флаг что файл не создавался
F_newFile = 0;
//значит открываем его для чтения
Handle=FileOpen("lengthEURUSD0.0050Down.csv", FILE_READ);
if(Handle<1)
{
Print("Ошибка открытия файла для чтения.");
return(0);
}
FileSeek(Handle, 0, SEEK_SET);
while(FileIsEnding(Handle)==false)
{
value =FileReadString(Handle);
if(value!="")
{
//Записываем всё в массив из файла
ArrInsertInt(InsertArr, MathAbs(StrToInteger(value)));
}
if(FileIsEnding(Handle)==true)
{
break;
}
}
//Рассчитываем значения средние максимальные и т.д.
ArrSize = ArraySize(InsertArr);
Print(ArrSize);
//---------------------------------------------------------------------//
ArrMax = ArrayMaximum(InsertArr,ArrSize,0);
ArrMax = InsertArr[ArrMax];
//---------------------------------------------------------------------//
ArrMin = ArrayMinimum(InsertArr,ArrSize,0);
ArrMin = InsertArr[ArrMin];
//---------------------------------------------------------------------//
ArrAverage = 0;
for(i = 0; i<=ArrSize; i++)
{
ArrAverage = ArrAverage+InsertArr[i];
}
ArrAverage = ArrAverage/ArrSize;
//---------------------------------------------------------------------// FileClose(Handle);
//---------------------------------------------------------------------////Смотрим если все значения есть, тогда запихиваем всё в массив и передаём егоif(F_newFile != -1 && ArrSize != -1 && ArrMax != -1 && ArrMin != -1 && ArrAverage != -1)
{
ArrInsertInt(RetArr,F_newFile);
ArrInsertInt(RetArr,ArrSize);
ArrInsertInt(RetArr,ArrMax);
ArrInsertInt(RetArr,ArrMin);
ArrInsertInt(RetArr,ArrAverage);
ArrInsertInt(RetArr,Handle);
Print(RetArr[0],"|",RetArr[1],"|",RetArr[2],"|",RetArr[3],"|",RetArr[4],"|",RetArr[5]);
return (RetArr);
}
//---------------------------------------------------------------------////иначе передаем только файловый указатель
ArrInsertInt(RetArr,Handle);
ArrInsertInt(RetArr,F_newFile);
return (RetArr);
}
void GetNameF()
{string symbol;//инструмент которым будем торговать//создаём имя файла
symbol = Symbol();
//---------------------------------------------------------------------------------------------------------------------------//
FNLenUp = "length"+symbol+DoubleToStr(percent,4)+"up";
//--------------------------------------------------------//
FNSpeedUp = "speed"+symbol+DoubleToStr(percent,4)+"up";
//--------------------------------------------------------//
FNLenDown = "length"+symbol+DoubleToStr(percent,4)+"Down";
//--------------------------------------------------------//
FNSpeedDown = "speed"+symbol+DoubleToStr(percent,4)+"Down";
}
int ArrInsertInt(int& m[], int e, int p=-1) {
int j, k=ArraySize(m);
p=-1;
ArrayResize(m, k+1);
if (p>=0 && p<k) {
for (j=k; j>p; j--) m[j]=m[j-1];
m[p]=e;
} else m[k]=e;
return(k+1);
}
The essence of the problem is to have 4 files with the values need to open each file, write everything to an array and calculate the average maximum and minimum values and then pass it to another array.
The error is this: when I call GetFileData();, ArrInsertInt(InsertArr, MathAbs(StrToInteger(value)); it starts to add values and not write them again.
here's the script and one of the files
The file is not attached for some reason. here are the contents:
I'm trying to compare the SAR parabolic, the current one and the previous one. But it doesn't work, I've been struggling for a day. Why doesn't this code work? Here is the script code:
int start()
{
double sar0 = iSAR(Symbol(), 0, 0.02, 0.2, 0);
double sar2 = iSAR(Symbol(), 0, 0.02, 0.2, 1);
sar0 = sar2;
if (sar0 == sar2) //если написать sar0 = sar2,Alert("SAR проверяется"); //то работает, как в коде нижеreturn;
}
Pupersa, найди этот ордер и измени в нём параметр "стоплосс", ничё сложного.
If you don't mind, can you elaborate?
Let me give you the nut and you tell me why the car won't start... :)
With the right nut, you can tell me... :-)
Attached is the file... Thanks in advance!
If you don't mind, can you elaborate?
Please help me find a bug in the script.
The essence of the problem is to have 4 files with the values need to open each file, write everything to an array and calculate the average maximum and minimum values and then pass it to another array.
The error is this: when I call GetFileData();, ArrInsertInt(InsertArr, MathAbs(StrToInteger(value)); it starts to add values and not write them again.
here is the script and one of the files
Please help me find a bug in the script.
The essence of the problem is to have 4 files with the values need to open each file, write everything to an array and calculate the average maximum and minimum values and then pass it to another array.
The error is this: when I call GetFileData();, ArrInsertInt(InsertArr, MathAbs(StrToInteger(value)); it starts to add values and not write them again.
here's the script and one of the files
The file is not attached for some reason. here are the contents:
121
58
91
176
87
58
105
166
95
54
59
99
54
172
79
55
69
110
97
80
119
113
124
68
80
79
51
84
58
112
51
181
I'm trying to compare the SAR parabolic, the current one and the previous one. But it doesn't work, I've been struggling for a day. Why doesn't this code work? Here is the script code:
This variant works: