const string name="VLine,VLine2,VLine3", // line name
I made the line name unique. In input too. Doesn't help.
Here, run without input parameters, copy it directly like this and maybe it will become clearer.
//+------------------------------------------------------------------+//| Создает вертикальную линию |//+------------------------------------------------------------------+bool VLineCreate(constlong chart_ID = 0, // ID графикаconststring name = "VLine", // имя линииconstint sub_window = 0, // номер подокнаdatetime time = 0, // время линииconstcolor clr = clrRed, // цвет линииconstENUM_LINE_STYLE style = STYLE_SOLID, // стиль линииconstint width = 1, // толщина линииconstbool back = false, // на заднем планеconstbool selection = true, // выделить для перемещенийconstbool hidden = true) // скрыт в списке объектов
{
ObjectCreate(chart_ID, name, OBJ_VLINE, sub_window, time, 0);
//--- установим цвет линииObjectSetInteger(chart_ID, name, OBJPROP_COLOR, clr);
//--- установим стиль отображения линииObjectSetInteger(chart_ID, name, OBJPROP_STYLE, style);
//--- установим толщину линииObjectSetInteger(chart_ID, name, OBJPROP_WIDTH, width);
//--- отобразим на переднем (false) или заднем (true) планеObjectSetInteger(chart_ID, name, OBJPROP_BACK, back);
//--- включим (true) или отключим (false) режим перемещения линии мышью//--- при создании графического объекта функцией ObjectCreate, по умолчанию объект//--- нельзя выделить и перемещать. Внутри же этого метода параметр selection//--- по умолчанию равен true, что позволяет выделять и перемещать этот объектObjectSetInteger(chart_ID, name, OBJPROP_SELECTABLE, selection);
ObjectSetInteger(chart_ID, name, OBJPROP_SELECTED, selection);
return(true);
}
//+------------------------------------------------------------------+//| Script program start function |//+------------------------------------------------------------------+voidOnStart()
{
datetime time1 = D'2023.06.26 10:00:00';
datetime time2 = D'2023.06.26 11:00:00';
datetime time3 = D'2023.06.26 12:00:00';
//--- создадим вертикальную линию
VLineCreate(0, "Name1", 0, time1, clrBlue, STYLE_DASHDOTDOT);
VLineCreate(0, "Name2", 0, time2, clrGreen, STYLE_SOLID, 5);
VLineCreate(0, "Name3", 0, time3);
}
//+------------------------------------------------------------------+
Yes, I know about them, of course, but I need for other things.... Anyway, the point is this. I recently started trading on binance and wanted to test it. There is also a kitchen broker with a lot of cryptocurrencies, but the spread interferes. And so the quotes match pretty well with binance quotes, especially if you consider the price (bid+ask)/2.
Here I wanted to maximise the match, although of course it will be possible to neglect these discrepancies.
Yeah, I know about them, but that's not what I'm after. Anyway, the point is this. I recently started trading on binance and wanted to test it. There is also a kitchen broker with a lot of cryptocurrencies, but the spread interferes. And so the quotes match pretty well with those of binance, especially if you consider the price (bid+ask)/2.
Here I wanted to maximise the match, although of course it will be possible to neglect these discrepancies.
Perhaps you can look into creating your own chart. MQL5 allows it.
Good afternoon. When writing an Expert Advisor on Mql5 I encountered a problem. There is an array with values of candlesticks opening for the year. On each candlestick of this array I need to create an array of n-candles, say 30, to check the highs and lows. Something like a Zigzag indicator.
I wrote this code, which gives an error: "array out of range" or the values of maximum and minimum in the whole array, but not in the required 30-candle period.
for(int i=0; i<ArraySize(opens); i++)
{
if(i+30<=ArraySize(opens))
{
double maximum=0;
double minimum=9;
for(int j=0; j<30; j++)
{
maximum = ArrayMaximum(opens, i, i+j);
minimum = ArrayMaximum(opens, i, i+j);
}
}
}
Perhaps I need to create another array to check in the ArrayMaximum() and ArrayMinimum() functions, but I'm confused with nested loops and array size.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
const string name="VLine,VLine2,VLine3", // line name
I made the line name unique. In input too. Doesn't help.
const string name="VLine,VLine2,VLine3", // line name
I made the line name unique. In input too. Doesn't help.
You made the name somewhere in the wrong place, and not like that).
const string name="VLine,VLine2,VLine3", // line name
I made the line name unique. In input too. Doesn't help.
Here, run without input parameters, copy it directly like this and maybe it will become clearer.
Here, run it without input parameters, copy it directly like this and maybe it will become clearer.
Thank you very much! Just what I need!
Here are the Buy/Sell functions in the CTrade trading class
I specify a price in them, but the position is still opened by Ask/Bid.
What kind of price can I specify here?
Thank you very much! Just what I need!
unique name)
I specify a price in them, but the position is still opened by Ask/Bid.
What kind of price can I specify here?
Pay attention to other methods
Pay attention to other methods
Yes, I know about them, of course, but I need for other things.... Anyway, the point is this. I recently started trading on binance and wanted to test it. There is also a kitchen broker with a lot of cryptocurrencies, but the spread interferes. And so the quotes match pretty well with binance quotes, especially if you consider the price (bid+ask)/2.
Here I wanted to maximise the match, although of course it will be possible to neglect these discrepancies.
Yeah, I know about them, but that's not what I'm after. Anyway, the point is this. I recently started trading on binance and wanted to test it. There is also a kitchen broker with a lot of cryptocurrencies, but the spread interferes. And so the quotes match pretty well with those of binance, especially if you consider the price (bid+ask)/2.
Here I wanted to maximise the match, although of course it will be possible to neglect these discrepancies.
Perhaps you can look into creating your own chart. MQL5 allows it.
Good afternoon. When writing an Expert Advisor on Mql5 I encountered a problem. There is an array with values of candlesticks opening for the year. On each candlestick of this array I need to create an array of n-candles, say 30, to check the highs and lows. Something like a Zigzag indicator.
I wrote this code, which gives an error: "array out of range" or the values of maximum and minimum in the whole array, but not in the required 30-candle period.
Perhaps I need to create another array to check in the ArrayMaximum() and ArrayMinimum() functions, but I'm confused with nested loops and array size.
Please, give me a hint.