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

 
Artyom Trishkin:

So his script works only once - I put it on the chart - the script worked(closed positions) and unloaded.

You don't need a script, you need an Expert Advisor.

I've got it working fine as an EA. it only works for buy trades.

I don't want to trade with sl. it only pushes the sl in the open position and i may lose as the price turns.

So i ask you to show me how to put this slevel=OrderStopLoss()>Ask+Point*TS; string into else. or what string i should put there.

It's a bit hard to figure it all out. my brain is slowly starting to leak :)

 

Good afternoon!

I decided to try Andrews Pitchfork in MT4 not as lines, but in the background. I've got nothing working - only lines.

Please advise, maybe I'm doing something wrong?

 

Guys, how to sort a one-dimensional string array alphabetically. I understand the numeric, but what about the string array? I need to sort the characters.

If anyone has a function, please share.

 
Vitaly Muzichenko:

Guys, how to sort a one-dimensional string array alphabetically. I understand the numeric, but what about the string array? I need to sort the characters.

If anyone has a function, please share.

Later, not at the computer now.
 
Vitaly Muzichenko:

Guys, how to sort a one-dimensional string array alphabetically. I understand the numeric, but what about the string array? I need to sort the characters.

If anyone has a function, please share.

Not a function. Just a link to an example.
 
Artyom Trishkin:
Not a function. Just a link to an example.

Great, thanks Artem!

Strange, of course, that there's still no such default function in the terminal.

 

Hello!

Help me get around the problem of optimising the owl.How can I get the value in an alternative way

price_up_1

?...

TrendCreate("1",Time[bar1],up_level_1,Time[bar2],up_level_2);
price_up_1=NormalizeDouble(ObjectGetValueByShift("1",bar_seek),Digits);
 
trader781:

Hi all, who can help find bugs?

On tests with one order and 1 instrument it worked perfectly, but when I put a few dozen on different pairs it stopped working. I don't know why I hadn't noticed it before, but I have noticed that it is nowhere to be seen. The work with the pending orders is not provided from the very beginning. The purpose is to find out why it does not work as intended.

This condition allows the board to work only with pending orders. was that the intention?

     if (OrderSymbol() == Symbol() && OrderType()<2)
          continue;
 
Nikolay Gaylis:

Hello!

Help me get around the problem of optimising the owl.How can I get the value in an alternative way

price_up_1

?...

TrendCreate("1",Time[bar1],up_level_1,Time[bar2],up_level_2);
price_up_1=NormalizeDouble(ObjectGetValueByShift("1",bar_seek),Digits);
Build a virtual line instead of a graphical object instead of a trend line. Respectively, and get the value not by ObjectGetValueByShift("1",bar_seek), but by straight line equation.
 
Nikolay Gaylis:

This condition only allows the board to work with pending orders. was that the intention?

     if (OrderSymbol() == Symbol() && OrderType()<2)
          continue;
That was probably the idea. However, this check will take into account not only pending orders, but also all operations with the trading account - deposits, withdrawals, bonuses and other actions with the account.
Reason: