Yes, you need to have either open source code or a ready-made implementation.
When I set the colour clrNONE in the tester, the colour is still displayed! So clrNONE doesn't work in the tester? I can't check it in real life - it's the weekend...
If I set any colour instead of clrNONE, this colour is displayed, but the empty value = does not work... strange...
But it's better to just use the + operator for strings and convert everything to strings, then you don't need a function (and macro) version with lots of parameters
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)
{
I++;
string result[]; // массив для получения строкStringSplit(sparam, ' ', result); // получим из имени созданного объекта подстрокиulong timeCreate = ObjectGetInteger(0, sparam, OBJPROP_CREATETIME); // получим время создания объектаstring newName = result[0]+" "+result[1]+" "+string(I); // сформируем новое имя объектаObjectSetString(0, sparam, OBJPROP_NAME, newName); // переименуем объект//----------------------------------------------------------------------------------------double Level_0= ObjectGetDouble(
0, // идентификатор графика
newName, // имя объектаOBJPROP_PRICE, // идентификатор свойства0// модификатор свойства
);
double Level_1= ObjectGetDouble(
0, // идентификатор графика
newName, // имя объектаOBJPROP_PRICE, // идентификатор свойства1// модификатор свойства
);
//------------------------------------------------------------------------------------------------------if(Level_0 > Level_1)
{
ObjectSetInteger(0,newName,OBJPROP_COLOR,clrDeepSkyBlue);
}
else
{
ObjectSetInteger(0,newName,OBJPROP_COLOR,clrYellow);
}
}/******************************************************************/
}
Hi, could you tell me why when debugging the code, going step by step the lines are recoloured in both colours depending on coordinate values. And throwing EA on graph, lines condition if(Level_0 > Level_1) is never true ?
Hey, could you tell me why in debugging, when passing the code step by step, lines are repainted in both colours depending on coordinate values. And throwing EA on a graph, the line condition if(Level_0 > Level_1) is never true ?
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 it doesn't work, you need to build the sequence in some other way.
ps; Another option: first repaint with sparam name and then rename it.
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.
An indicator for this must have an input colour parameter. That is, it should be a custom indicator.
THANK YOU! but if I don't have access to the source code, it's not feasible?
THANK YOU! But if I don't have access to the source code, it's not implementable?
Yes, you have to have either open source or a ready-made implementation.
Yes, you need to have either open source code or a ready-made implementation.
When I set the colour clrNONE in the tester, the colour is still displayed! So clrNONE doesn't work in the tester? I can't check it in real life - it's the weekend...
If I set any colour instead of clrNONE, this colour is displayed, but the empty value = does not work... strange...Answer: also repeatedly reload the macro)
But it's better to just use the + operator for strings and convert everything to strings, then you don't need a function (and macro) version with lots of parameters
Thanks. I didn't know that macro can be reloaded.
Thank you. I didn't know the macro could be reloaded.
typo - reload, not reload)
sorted out the examples at the end of this help sectionhttps://www.mql5.com/ru/docs/constants/structures/mqltraderequest
on Metacquot server, everything is OK
on another server, after analyzing error codes of trade request, I found out that the problem is in filling MqlTradeResult field :
request.type_filling = ORDER_FILLING_IOC;a forum search did not find an unambiguous solution - how to determine server settings for the MqlTradeResult field programmatically
UPD: found a working solutionhttps://www.mql5.com/ru/forum/168912/page2#comment_4062864
@fxsaber thanks!
Please tell me how to set the Fibo levels for autobuilding
Example in theFibonaci RR code -
can be set for the levels: number of lines, line value, line colour, line style, line width, line text.
Hi, could you tell me why when debugging the code, going step by step the lines are recoloured in both colours depending on coordinate values. And throwing EA on graph, lines condition if(Level_0 > Level_1) is never true ?
Hey, could you tell me why in debugging, when passing the code step by step, lines are repainted in both colours depending on coordinate values. And throwing EA on a graph, the line condition if(Level_0 > Level_1) is never true ?
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 it doesn't work, you need to build the sequence in some other way.
ps; Another option: first repaint with sparam name and then rename it.