It is very likely that after renaming an object, it is not yet available to be accessed. You can try putting ChartRedraw after renaming. If that doesn't work, then you need to build the sequence somehow else.
ps; Another option is to repaint with sparam name first and then rename.
Thanks for the example, but this is just setting trading levels. I am interested in setting Fibonacci levels like 0.0%, 23.6%, 38.2%, 50%, 61.8%, 100%, 161.8%, 261.8%...
The auto indicator draws by default and by standard Fibo levels. There should be a source code of Fibo tools in the terminal that could be changed or copied from it... I can't find it, if you know it, please give me a hint.
Or how to add the following levels in custom indicator:0.0%, 23.6%, 38.2%, 50%, 61.8%, 100%, 161.8%, 261.8%...
Thanks for the example, but this is just setting trading levels. I am interested in setting Fibonacci levels like 0.0%, 23.6%, 38.2%, 50%, 61.8%, 100%, 161.8%, 261.8%...
The indicator draws by default and by standard Fibo levels. There should be a source code of Fibo tools in the terminal that could be changed or copied from it... I can't find it, if you know it, please give me a hint.
Or how to add the following levels in custom indicator:0.0%, 23.6%, 38.2%, 50%, 61.8%, 100%, 161.8%, 261.8%...
Please advise
the example I gave above - it has just the setting of levels. If you're asking, would you mind opening the code and checking?
The date structure contains eight fields of typeint.
structMqlDateTime { intyear;// year intmon;// month intday;// day inthour;// hour; // hour intmin;// minutes intsec;// seconds intday_of_week;// day of week (0-Sunday, 1-Monday, ....,6-saturday) intday_of_year;// sequence number in a year (January 1 has number 0) };
Целый тип char занимает в памяти 1 байт (8 бит) и позволяет выразить в двоичной системе счисления 2^8 значений=256. Тип char может содержать как положительные, так и отрицательные значения. Диапазон изменения значений составляет от -128 до 127. uchar # Целый тип uchar также занимает в памяти 1 байт, как и тип char, но в отличие от него, uchar...
intOnInit()
{
//---ChartSetInteger(ChartID(), CHART_EVENT_OBJECT_CREATE, true);
//---return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Expert deinitialization function |//+------------------------------------------------------------------+voidOnDeinit(constint reason)
{
//---
}
//+------------------------------------------------------------------+//| Expert tick function |//+------------------------------------------------------------------+voidOnTick()
{
}
//+------------------------------------------------------------------+/***********************OnChartEvent function************************/voidOnChartEvent(constint id, // идентификатор событияconstlong& lparam, // параметр события типа longconstdouble& dparam, // параметр события типа doubleconststring& sparam // параметр события типа string
)
{
if(id == CHARTEVENT_OBJECT_CREATE)
{
//----------------------------------------------------------------------------------------double Level_0= ObjectGetDouble(
0, // идентификатор графика
sparam, // имя объектаOBJPROP_PRICE, // идентификатор свойства0// модификатор свойства
);
double Level_1= ObjectGetDouble(
0, // идентификатор графика
sparam, // имя объектаOBJPROP_PRICE, // идентификатор свойства1// модификатор свойства
);
//------------------------------------------------------------------------------------------------------if(Level_0 > Level_1)
ObjectSetInteger(0,sparam,OBJPROP_COLOR,clrDeepSkyBlue);
elseObjectSetInteger(0,sparam,OBJPROP_COLOR,clrYellow);
//+------------------------------------------------------------------+ulong timeCreate = ObjectGetInteger(0, sparam, OBJPROP_CREATETIME); // получим время создания объектаstring newName = "fibka"+string(timeCreate); // сформируем новое имя объектаObjectSetString(0, sparam, OBJPROP_NAME, newName); // переименуем объект
}
}/******************************************************************///+------------------------------------------------------------------+
Alexey Viktorov:
Maybe I would learn to think logically)))).
I tried everything I could out of what you've told me, I twisted and turned, but all the same colour lines in MT5. In MT4 it re-colours in a normal way, without any delay.
It is very likely that after renaming an object, it is not yet available to be accessed. You can try putting ChartRedraw after renaming. If that doesn't work, then you need to build the sequence somehow else.
ps; Another option is to repaint with sparam name first and then rename.Thanks again!!! What would I do without you? ))))
Example inFibonaci RR code -
Thanks for the example, but this is just setting trading levels. I am interested in setting Fibonacci levels like 0.0%, 23.6%, 38.2%, 50%, 61.8%, 100%, 161.8%, 261.8%...
https://www.metatrader5.com/ru/terminal/help/objects/fibo/fibo_retracement
The auto indicator draws by default and by standard Fibo levels. There should be a source code of Fibo tools in the terminal that could be changed or copied from it... I can't find it, if you know it, please give me a hint.
Or how to add the following levels in custom indicator:0.0%, 23.6%, 38.2%, 50%, 61.8%, 100%, 161.8%, 261.8%...
Please advise
Thanks again!!! What would I do without you? ))))
Maybe I'd learn to think logically.)))
Thanks for the example, but this is just setting trading levels. I am interested in setting Fibonacci levels like 0.0%, 23.6%, 38.2%, 50%, 61.8%, 100%, 161.8%, 261.8%...
https://www.metatrader5.com/ru/terminal/help/objects/fibo/fibo_retracement
The indicator draws by default and by standard Fibo levels. There should be a source code of Fibo tools in the terminal that could be changed or copied from it... I can't find it, if you know it, please give me a hint.
Or how to add the following levels in custom indicator:0.0%, 23.6%, 38.2%, 50%, 61.8%, 100%, 161.8%, 261.8%...
Please advise
the example I gave above - it has just the setting of levels. If you're asking, would you mind opening the code and checking?
I gave you an example above - there's just the setting of levels. If you're asking, bother opening the code and checking.
Thanks, yes there is, it's a bit confusing but I'm trying to understand) thanks
What the code would look like in Mql5
How would the code look like in Mql5
Exactly as it would look in mql4
A bit of help
MqlDateTime
The date structure contains eight fields of typeint.
structMqlDateTime
{
intyear;// year
intmon;// month
intday;// day
inthour;// hour; // hour
intmin;// minutes
intsec;// seconds
intday_of_week;// day of week (0-Sunday, 1-Monday, ....,6-saturday)
intday_of_year;// sequence number in a year (January 1 has number 0)
};
I gave you an example above - there's just the setting of levels. If you're asking, please open the code and check.
Nice auto-drawer) with different objects, levels, timeframes, thanks a lot
Maybe I would learn to think logically)))).
I tried everything I could out of what you've told me, I twisted and turned, but all the same colour lines in MT5. In MT4 it re-colours in a normal way, without any delay.
how to organise an algorithm in one indicator to take points and transfer them to another buffer.
- To draw the trend lines. (as on the picture)
-----------------------------------------
I tried everything with gut feeling, they are drawn but in strange places.
-----------------------------------------------------------------------------------------------------
I attached the indicator - it works - but these lines cannot be adjusted.