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

 
Good afternoon. Is it possible to display a circle on the chart with the % yield of the instruments? as in myfxbook
 

Please advise, I want to place limit orders, I don't understand the difference between OrderOpen() and PositionOpen() methods. I've read the help, the enumerationENUM_ORDER_TYPE in both of them.

The notes they have are like this:

Successful operation of OrderOpen(...) method does not always mean successful execution of a trade operation. You should check the result of trade request execution (return code of trade server) by calling ResultRetcode() method as well as value returned by ResultOrder() method.

Successful completion of the PositionOpen(...) method does not always mean successful execution of a trade operation. It is necessary to check the result of trade request execution (return code of trade server) by calling ResultRetcode() method, as well as value returned by ResultDeal() method.

Why do we need additional methods SellLimit, BuyLimit, etc.? You can also set a limit by using a special predefinedstructure MqlTradeRequest.

Why is it necessary to place an order in different ways?

 
WinProject:

Please advise, I want to place limit orders, I don't understand the difference between OrderOpen() and PositionOpen() methods. I've read the help, the enumerationENUM_ORDER_TYPE in both of them.

The notes they have are like this:

Successful operation of OrderOpen(...) method does not always mean successful execution of a trade operation. You should check the result of trade request execution (return code of trade server) by calling ResultRetcode() method as well as value returned by ResultOrder() method.

Successful completion of the PositionOpen(...) method does not always mean successful execution of a trade operation. It is necessary to check the result of trade request execution (return code of trade server) by calling ResultRetcode() method, as well as value returned by ResultDeal() method.

Why do we need additional methods SellLimit, BuyLimit etc.? Besides, the limit can be set using a special predefinedstructure MqlTradeRequest.

What is it for and why?

My answers relate to the CTrade trade class:
  • OrderOpen Places a pending order with the specified parameters
  • PositionOpen Places a position with the specified parameters by the specified symbol
  • SellLimit, BuyLimit, etc. - Simplified methods for placing a pending order

That is, we should not confuse a Pending Order with a Position - that's one. In general, several solutions are implemented for different purposes, that's two.

 
Taras Slobodyanik:

Most likely it was crossed, but it was redrawn.
You should check the signal after the candle closes.

The crossover is unlikely. The tails of the candlesticks do not tell you anything about the crossovers.

What do you mean, "You should check the signal after the candle closes"?

Am I a mql "novice"? a month into the subject. I have everything on open candles. VRI doesn't have this parameter at all though.

 
Vladimir Karputov:

  • OrderOpen Places a pending order with the specified parameters
  • PositionOpen Opens a position with specified parameters by the specified symbol
  • SellLimit, BuyLimit, etc. - Simplified methods for placing a pending order

That is, we should not confuse a Pending Order with a Position - that's one. And in general several solutions are created for variety and for different tasks - that's two.

I can place a Limit order with any of these methods, my question is, what are these different tasks?

 
KrasAleks:
I don't think there was a crossover. The tails of the candles are nothing to be crossed at.

What do you mean, "You have to check the signal after the candle closes"?

There was. Don't even doubt it. It happens with almost every indicator on the zero bar. The point is that the value of the indicator remains at the candle's close. And while the candle is not closed, the indicator's values change together with the current price changes.

 
WinProject:

I can set the limit using any of these methods, my question is, what are these different tasks?

Then please try usingPositionOpen to set Buy limit. I've never been into such machinations: I usePositionOpen ONLY for opening POSITION. In general, I'm sorry I got into the section for an old terminal I did not consider.


Leaving.

 
Alexey Viktorov:

There was. Don't even doubt it. It happens with almost every indicator on the zero bar. The point is that the value of the indicator stays at the state when the candle closes. And while the candle is not closed, the indicator changes its value along with the current price change.

Yes? M.B.

OK, not fatal, but unfortunate. There's nothing to be done, is there? There's no parameter in VRI to build the signal by candlestick closing.

Thanks for the clarification.

 
How can I collect information on which pairs the EA works on, and have the profit and which pair is set displayed in the same window?
 
Vladimir Karputov:

Then please try usingPositionOpen to set a Buy limit. I've never been into this kind of machismo: I usePositionOpen ONLY to open a POS. In general, I'm sorry I got into the section for an old terminal, I did not consider it.


Leaving.

Both terminals are discussed here. This is stated in the title of the thread
Reason: