------robot uses trawl in %balance, please advise how to add step changes here. If I understand it correctly it is needed for Tralingprocent. For example if step =2%, then trailingprocent increases by at least 2%.
P.S.khorosh, I cannot reply to you in private - the chat is not working!
Thank you, Vitaliy! And how do I attach it to the tip of the curve of an indicator which is in a separate window? I tried to set Time[0] and curve buffer value on zero bar as coordinates, but it didn't work.
Thank you, Vitaly! And how to tie it to the tip of the curve of the indicator which is in the separate window? I tried to set Time[0] and the curve buffer value on the zero bar as coordinates, but it does not work.
That's how he answered that question. The only nuance that often comes up is the wndNum value itself. The value of wndNum is not a constant. It must be constantly monitored. The user can delete the indicator subwindow, which precedes the current one. Also do not look for the indicator itself in OnInit(). This code should be moved to OnCalculate(). In any case you should always check if the subwindow index is correct.
That's how he answered the question. The only nuance that often comes up is the wndNum value itself. The value of wndNum is not a constant. It must be constantly monitored. The user can delete the indicator subwindow, which precedes the current one. Also do not look for the indicator itself in OnInit(). This code should be moved to OnCalculate(). In any case you must always check if the subwindow index is correct.
His example shows that object coordinates are initially assumed to be in pixels (static object). But I need to bind to an indicator curve. So, first we have to calculate these coordinates. It is not shown in his work. I tried it this way, but it doesn't work (in LevLabelSpread variable there is a curve buffer value on the first bar):
He has an example where object coordinates are initially assumed to be in pixels (static object). But I need to link it to an indicator curve. So, I have to calculate these coordinates beforehand. It is not shown in his work. I tried it this way but it doesn't work (the variable LevLabelSpread has the curve buffer value on the first bar):
Why should I calculate price in pixels for an object of TEXT type? It is positioned by bar time and price. I have it like this:
Please explain the meaning and purpose of the two concepts: chart handle andchart identifier. What is the difference between them and how and when they are used.
khorosh: Please explain the meaning and purpose of two notions: chart handle andchart identifier. What is the difference between them and how and when they are used.
Show me how you get both. So far it seems that we are talking about the same thing.
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.
{ NewProfProc=Profit(-1)/(AccountBalance()/100); if(NewProfProc>0 && (ProfitProcent==0 || ProfitProcent<NewProfProc)) {ProfitProcent=NormalizeDouble(NewProfProc, 2);} if(ProfitProcent>0 && ProfitProcent>(TralProcent+TralStartProcent)) {TrallingProcent=ProfitProcent-TralProcent;} //+------------------------------------------------------------------+ if(NewProfProc>0 && TrallingProcent!=0 && NewProfProc<=TrallingProcent) {CloserS(); CloserB(); ProfitProcent=0; TrallingProcent=0;}Artyom Trishkin:
Objects - they can be output to any terminal window and its subwindows.
--------------------------------------------------------------------------------------------------------------------------------------
I tried it like this, but it doesn't work.
Maybe there is something wrong with the window numbering. If there is one separate window in the chart, its number ==1?wndNum number of the window where to display
P.S.khorosh, I can't reply in private - the chat doesn't work!wndNum number of the window where to display
P.S.khorosh, I cannot reply to you in private - the chat is not working!Thank you, Vitaliy! And how do I attach it to the tip of the curve of an indicator which is in a separate window? I tried to set Time[0] and curve buffer value on zero bar as coordinates, but it didn't work.
Thank you, Vitaly! And how to tie it to the tip of the curve of the indicator which is in the separate window? I tried to set Time[0] and the curve buffer value on the zero bar as coordinates, but it does not work.
That's how he answered that question. The only nuance that often comes up is the wndNum value itself. The value of wndNum is not a constant. It must be constantly monitored. The user can delete the indicator subwindow, which precedes the current one. Also do not look for the indicator itself in OnInit(). This code should be moved to OnCalculate(). In any case you should always check if the subwindow index is correct.
That's how he answered the question. The only nuance that often comes up is the wndNum value itself. The value of wndNum is not a constant. It must be constantly monitored. The user can delete the indicator subwindow, which precedes the current one. Also do not look for the indicator itself in OnInit(). This code should be moved to OnCalculate(). In any case you must always check if the subwindow index is correct.
His example shows that object coordinates are initially assumed to be in pixels (static object). But I need to bind to an indicator curve. So, first we have to calculate these coordinates. It is not shown in his work. I tried it this way, but it doesn't work (in LevLabelSpread variable there is a curve buffer value on the first bar):
He has an example where object coordinates are initially assumed to be in pixels (static object). But I need to link it to an indicator curve. So, I have to calculate these coordinates beforehand. It is not shown in his work. I tried it this way but it doesn't work (the variable LevLabelSpread has the curve buffer value on the first bar):
Why should I calculate price in pixels for an object of TEXT type? It is positioned by bar time and price. I have it like this:
Result:
Why calculate the price in pixels for a TEXT object? It is positioned by bar time and price. I've got it like this:
Result:
Thank you very much.
It worked out fine:
Please explain the meaning and purpose of two notions: chart handle andchart identifier. What is the difference between them and how and when they are used.
Show me how you get both. So far it seems that we are talking about the same thing.