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

 
Petronet arrow indicators arrow and vertex, the task is to create an EA based on these indicators. There is no open source code for these indicators, only ex.4. I cannot use the logs to identify the necessary buffer. I have an idea to process the Alert event or log entry left by these indicators when Sell or Buy arrows appear. But I do not know how to do it. Maybe we can handle an event like "arrow appearing on the chart"?

Please help with this question.

  • press ctr+d to see the buffers
  • the list is also in parameters - tab colors
 
I convert pips to price for pending orders, on five-digit orders everything works as intended, on three-digit pending orders open 150 pips lower.
NormalizeDouble(цена - (Ask + 5 пипсов)*Point, Digits);

 
Nerd Trader #:
NormalizeDouble(цена - (Ask + 5 пипсов)*Point, Digits);

hard to guess what your code means, but 5 points is 5 *_Point

 
Igor Makanu #:

it's hard to guess what your code means, but 5 pips is 5 *_Point

is the opening price of a stop set. The same code is used for buy and stop orders.

NormalizeDouble("цена low предыдущего бара" - (MODE_STOPLEVEL + "отступ 5 пипсов")*Point, Digits);

Nothing has changed with "_Point". If Ask is replaced with MODE_STOPLEVEL and the 5 pips indentation is removed, the pending orders of all symbols open lower (or higher in case of a buy stop) by an additional ~20 pips.

 
Nerd Trader #:

The same code is also used for buy and stop orders.

Nothing has changed with "_Point". If Ask is replaced with MODE_STOPLEVEL and the 5 pips indentation is removed, the pending orders of all symbols open lower (or higher if the buy stop) by an additional ~20 pips.

Put MODE_STOPLEVEL on .
 

pending orders, on five-digit orders everything works as intended, on three-digit pending orders open 150 pips lower.

NormalizeDouble(цена - (Ask + 5 пипсов)*Point, Digits);


What is Adk? This is price, right now USDJPY is 115.080, if you add 5 to this value you get 115.085 and then multiply it by 0.001, you get... three guesses ...

And on five digits, too, it works through ... this very spot. Only you don't see it, or you just don't want to see it...

 
MakarFX #:
Put MODE_STOPLEVEL .
exactly 14 pips for three and five digits

Forum on trading, automated trading systems & strategy testing

Any questions from newbies on MQL4 and MQL5, tips and discussion on algorithms and codes

Alexey Viktorov, 2021.11.23 07:37


What is Adk? This price is USDJPY 115.080, if you add 5 to this value you get 115.085 and then multiply by 0.001, you get... three guesses...

And on five digits, too, it works through ... this very spot. Only you don't see it, or you just don't want to see it...

115.080 + 5 = 120... I didn't take into account that ask-bid is the price, not the difference. I should have done so (Ask-bid + 5 pips)*Point and it works, now on all instruments stop orders are placed 5 pips away from the previous high/low bar.
 
Nerd Trader #:
exactly 14 pips for three and five digits

115.080 + 5 = 120... I didn't take into account that Ask is the price, not the difference. I should have done (Ask-bid + 5 pips)*Point and it works this way, now stop-orders are placed 5 pips away from the previous high/low bar on all symbols.

Well, yes. I am not without sin. The main thing is that you have understood your mistake and everything went right.

But still it is correct (Ask + 5*Point) or (Bid - 5*Point)

 
Alexey Viktorov #:

Yeah, well, I'm not without sin. The main thing is that you understood your mistake and everything went right.

But still it is correct (Ask + 5*Point) or (Bid - 5*Point)

In this case, for a SellStop:

NormalizeDouble(previous_bar.low - order_indent*Point, Digits)


Buy Stop:

NormalizeDouble(previous_bar.high + ((Ask - Bid) + order_indent*Point), Digits)

For a Sell Stop, we don't need to consider Ask in order to place the order but for a Buy Stop we have to make a difference (Ask-bid) otherwise (Ask + 5*Point), we will add Ask + Points to the price of the previous bar and the order will open at 150 points higher.

 
Nerd Trader #:

Well, then, for a Sell-Stop:

NormalizeDouble(previous_bar.low - order_indent*Point, Digits)


Buy Stop:

NormalizeDouble(previous_bar.high + ((Ask - Bid) + order_indent*Point), Digits)

For a Sell Stop, we don't need to consider Ask in order to place the order but we have to make a difference for a Buy Stop (Ask-bid) otherwise (Ask + 5*Point), we will add Ask + Points to the price of the previous bar and the order will open at 150 points higher.

This is an idea of your own taste. You should do it the way you like.

Reason: