The MetaTrader 5 window shows the Bid& Ask values, which (as far as I understand) determine the win/loss.
However, when I try to use minute quotes of the history to test my strategy, these quotes do not contain the Bid andAsk values, but give the values " OPEN", "HIGH" "LOW", "CLOSE", "TICKVOL","VOL", "SPREAD". It is not quite clear how to take Bid andAsk from these values, as well as how to calculate the spread.
Everything is absolutely clear. Describe in more detail what exactly is meant by "when I try to use minute history quotes"? What exactly are you doing or want to do?
longSymbolInfoInteger(
string name, // символ ENUM_SYMBOL_INFO_INTEGER prop_id // идентификатор свойства
);
2. Returns true or false depending on success of the function. If successful, the value of the property is placed in the destination variable passed by reference by the last parameter.
boolSymbolInfoInteger(
string name, // символ ENUM_SYMBOL_INFO_INTEGER prop_id, // идентификатор свойства long& long_var // сюда примем значение свойства
);
2. Returns true or false depending on success of the function. If successful, the value of the property is placed in the destination variable passed by reference by the last parameter.
#property copyright"Copyright 2018, Sergey S Morozov"#property link"https://www.mql5.com"#property version"1.00"#property strict//#property indicator_separate_window // Индик. рисуется в новом окне#property indicator_chart_window// Индик. рисуется в основном окне#property indicator_buffers1// Количество буферов#property indicator_color1 Red // Цвет первой линииexternint History =50; // Колич.баров в расчётной историиexternint Aver_Bars=5; // Количество баров для расчётаdouble ArrayBuff[];
//----------------------------------------------------------------------------------------------------intOnInit()
{
SetIndexBuffer(0,ArrayBuff);
SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,1);
return(INIT_SUCCEEDED);
}
intOnCalculate(
constint rates_total,
constint prev_calculated,
constdatetime &time[],
constdouble &open[],
constdouble &high[],
constdouble &low[],
constdouble &close[],
constlong &tick_volume[],
constlong &volume[],
constint &spread[])
{
int i, // Индекс бара
n, // Формальный параметр
Counted_bars; // Количество просчитанных баров double
Sum_H, // Сумма значений High за переиод
Sum_L; // Сумма значений Low за переиод//--------------------------------------------------------------------
Counted_bars=IndicatorCounted(); // Количество просчитанных баров
i=Bars-Counted_bars-1; // Индекс первого непосчитанногоif (i>History-1) // Если много баров то ..
i=History-1; // ..рассчитывать заданное колич.while(i>=0) // Цикл по непосчитанным барам
{
Sum_H=0; // Обнуление в начале цикла
Sum_L=0; // Обнуление в начале циклаfor(n=i;n<=i+Aver_Bars-1;n++) // Цикл суммирования значений
{
Sum_H=Sum_H + High[n]; // Накопление суммы макс.значений
Sum_L=Sum_L + Low[n]; // Накопление суммы мин. значений
}
ArrayBuff[i]=(Sum_H-Sum_L)/Aver_Bars; // Знач. 0 буфера на i-ом баре
i--; // Расчёт индекса следующего бара
}
return(rates_total);
}
//+------------------------------------------------------------------+
I just started, I don't know how to write in this language yet. But the problem is - if in a new window, the graph appears. But I can't display it in the current one... What is my error? Considering that I myself could not write it and I can't find examples here. All the more, it's clearly not through a function like SetChartData(point1,point2); it just happens by itself...
And the variable seems to be set(indicator_chart_window), but still it doesn't work....
Задавайте вопросы по техническому анализу, обсуждайте торговые системы и улучшайте свои навыки программирования торговых стратегий на языке MQL5. Общайтесь и обменивайтесь опытом на форуме с трейдерами всего мира и помогайте ответами новичкам — наше сообщество развивается вместе с вами. Как прописать расписание торговли робота? Здравствуйте...
Absolutely everything is available. Describe in more detail what exactly is meant by "when I try to use minute history quotes"? What exactly are you doing or want to do?
In order to download history quotes load MetaTrader 5, click on the icon with dollar symbol: "Symbol List Display" (or you can press CtrlU). The "Symbols" window will appear. On the "SPECIFICATION" tab find the desired currency pair, e.g. GBPCHF. In the tab "BARs" set minute quotations (M1) and dates of the beginning and the end of the required period. After clicking on the "REQUEST" button, a csv file will be downloaded, which can be used to test strategies with the Metatrader or with your own programs.
Using EXCEL you can view the content of this file, where the first line reveals the information in the file, i.e. "date, time" and then" OPEN", "HIGH" "LOW", "CLOSE", "TICKVOL", "VOL", "SPREAD"
I know exactly what this data means, but how to make BIT and ASK from this data, which MetaTrader 5 uses?
Please advise me where in mt5 you can check information about a symbol? I remember in mt 4 you could check in the strategy tester, but in the mt5 tester I haven't found this function.
Simply add another CArrayObj array to the CArrayObj: Add() array
Doesn't work that way. parameter conversion not allowed
By the way, if it matters. My object to be added to the array is a class inherited from CArrayObj.
Well, it swears at the last line - parameter conversion not allowed.Dear forum members help please!!!
I want to assign a price step to a variable:
int V=SymbolInfoInteger(Symb,SYMBOL_POINT);
error: 'SymbolInfoInteger' - no one of the overloads can be applied to the function call
What is my error again?
int V=(int)SymbolInfoInteger(Symb,SYMBOL_POINT);
So try it.
Dear Members of the Forum!
Please advise!!!
The MetaTrader 5 window shows the Bid& Ask values, which (as far as I understand) determine the win/loss.
However, when I try to use minute quotes of the history to test my strategy, these quotes do not contain the Bid and Ask values, but give the values " OPEN", "HIGH" "LOW", "CLOSE", "TICKVOL","VOL", "SPREAD". It is not quite clear how to take Bid and Ask from these values, as well as how to calculate the spread.
Everything is absolutely clear. Describe in more detail what exactly is meant by "when I try to use minute history quotes"? What exactly are you doing or want to do?
Dear forum members help please!!!
I want to assign a variable to the price step:
int V=SymbolInfoInteger(Symb,SYMBOL_POINT);
error: 'SymbolInfoInteger' - no one of the overloads can be applied to the function call
What's my mistake again?
SymbolInfoInteger help:
1. Directly returns the value of the property.
2. Returns true or false depending on success of the function. If successful, the value of the property is placed in the destination variable passed by reference by the last parameter.
That is OR long OR bool.
Dear forum members help please!!!
I want to assign a price step to a variable:
int V=SymbolInfoInteger(Symb,SYMBOL_POINT);
error: 'SymbolInfoInteger' - no one of the overloads can be applied to the function call
What's my error again?
Point is a value of type double. When received as int it will have a zero value.
SymbolInfoInteger Help:
1. Directly returns the value of the property.
2. Returns true or false depending on success of the function. If successful, the value of the property is placed in the destination variable passed by reference by the last parameter.
That is OR long OR bool.
Got it, thanks)
I just started, I don't know how to write in this language yet. But the problem is - if in a new window, the graph appears. But I can't display it in the current one... What is my error? Considering that I myself could not write it and I can't find examples here. All the more, it's clearly not through a function like SetChartData(point1,point2); it just happens by itself...
And the variable seems to be set(indicator_chart_window), but still it doesn't work....
Absolutely everything is available. Describe in more detail what exactly is meant by "when I try to use minute history quotes"? What exactly are you doing or want to do?
In order to download history quotes load MetaTrader 5, click on the icon with dollar symbol: "Symbol List Display" (or you can press Ctrl U). The "Symbols" window will appear. On the "SPECIFICATION" tab find the desired currency pair, e.g. GBPCHF. In the tab "BARs" set minute quotations (M1) and dates of the beginning and the end of the required period. After clicking on the "REQUEST" button, a csv file will be downloaded, which can be used to test strategies with the Metatrader or with your own programs.
Using EXCEL you can view the content of this file, where the first line reveals the information in the file, i.e. "date, time" and then" OPEN", "HIGH" "LOW", "CLOSE", "TICKVOL", "VOL", "SPREAD"
I know exactly what this data means, but how to make BIT and ASK from this data, which MetaTrader 5 uses?