Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 815

 
Igor Makanu:

we must be talking about this example:

No, not at all, before that, in Ordersend() the value was set from the same variable. Even in the printout, it was exactly the same.

 
Andrey Sokolov:

No, not only that, but before that, in Ordersend() the value was set from the same variable. Even the print output was exactly the same.

In my opinion, Print() does not always output all doubles accurately, I don't know what the reason is

But to our point - normalize StopLosses and TakeProfits before sending them to the server, it's written in the help, and I think this is correct.

 
Igor Makanu:

I think Print() doesn't always output all doubles accurately, I don't know what the reason is

but to our point - normalize the stoplosses and takeprofits before sending them to the server, it's written in the help, and I think this is correct.

That variable was from a normalized expression
 
Andrey Sokolov:
The variable was from the normalized expression

I don't see it from here))), normalize the value in OrderSend () when sending it to the server - there are no options there, the normalized value will definitely be sent to the server

 
if(MacdCurrent<0 && MacdCurrent>SignalCurrent && MacdPrevious<SignalPrevious && 
         MathAbs(MacdCurrent)>(MACDOpenLevel*Point) && MaCurrent>MaPrevious)


This is the standard MACD (as you have already realised)

Please tell me what this lineMathAbs(MacdCurrent)>(MACDOpenLevel*Point) means?

What areMathAbs and(MACDOpenLevel*Point)?

 
Maxim Kuznetsov:

rotate text by 30-40 degrees. Then the labels will remain readable, but they will overlap less often

add "multiplication" - when the mouse pointer is inside the session, highlight the price in size and colour

Before the code is very far though found a little turn of degrees, yes now I wanted to do a horizontal and vertical shift of the price and the code highlighted does not work, why do not know?

objname = session + " Session Low label";

ObjectCreate(objname, OBJ_TEXT, 0, time2 - 1800, price1);

ObjectSet(objname, OBJPROP_BACK, false);

ObjectSet(objname, OBJPROP_XDISTANCE, 477);

ObjectSet(objname, OBJPROP_YDISTANCE, 91);

ObjectSetText(objname, DoubleToStr(price1, Digits), 9, "Tahoma", Lime);

ObjectSet(objname, OBJPROP_ANGLE,-41);

And what is "multiplication".
 
Tell us briefly about quote smoothing algorithms, what are they?
 

there is a question, there is probably no answer: so, look, there is a certain ideology of writing expressions, which is repeated all the time, for example:

if(Tdk>Odk) flag=true; there is the exact opposite sign expression but with the same ideology if(Tdk<Odk) flag=true; in both cases the same code is involved if(Tdk Odk) flag=true; change sign > to this <, it would be cool if we could save sign to variable by logical condition for example:

if(p==2) save sign >, if(p==1) save sign < and substitute it between values if(Tdk sign Odk) and eventually no need to use this entry 2 times, it would be very convenient in long expressions with the same ideology, we could put this thing in a function and reduce the amount of code. Is something like this possible?

 
Seric29:

there is a question, there is probably no answer: so, look, there is a certain ideology of writing expressions, which is repeated all the time, for example:

if(Tdk>Odk) flag=true; there is the exact opposite sign expression but with the same ideology if(Tdk<Odk) flag=true; in both cases the same code is involved if(Tdk Odk) flag=true; change sign > to this <, it would be cool if we could save sign to variable by logical condition for example:

if(p==2) save sign >, if(p==1) save sign < and substitute it between values if(Tdk sign Odk) and eventually no need to use this entry 2 times, it would be very convenient in long expressions with the same ideology, we could put this thing in a function and reduce the amount of code. Is something like that possible?

Yes.

Read code from @fxsaber.

Read more here

LifeHack для трейдера: замешиваем ForEach на дефайнах (#define)
LifeHack для трейдера: замешиваем ForEach на дефайнах (#define)
  • www.mql5.com
— В чем сила, брат?                                   —А сила, брат, в дефайнах                     Вы все ещё пишете на MQL4 и хотите перейти на MQL5, но не знаете с чего начать? Тогда мы идём к вам! Теперь появилась возможность комфортно работать в редакторе MetaEditor MQL5 и при этом использовать MQL4-нотацию (справедливости ради замечу...
 
Seric29:

there is a question, there is probably no answer: so, look, there is a certain ideology of writing expressions, which is repeated all the time, for example:

if(Tdk>Odk) flag=true; there is the exact opposite sign expression but with the same ideology if(Tdk<Odk) flag=true; in both cases the same code is involved if(Tdk Odk) flag=true; change sign > to this <, it would be cool if we could save sign to variable by logical condition for example:

if(p==2) save sign >, if(p==1) save sign < and substitute it between values if(Tdk sign Odk) and eventually no need to use this entry 2 times, it would be very convenient in long expressions with the same ideology, we could put this thing in a function and reduce the amount of code. Is something like this possible?

Well, then write yourself a comparison function/template

if (Compare3(Tdk,Odk)==GREATER_THEN) { flag=true; do_something(); }

Reason: