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

 
Andrey Sokolov:

Once again - for buy,the openingprice is ask. If you count by it, you will at least miss the opening spread.

Once again, if the buy is open, the price is not Ask but Bid plus a loss equal to the spread!
 
MakarFX:
Once again, if a buy is open, the price is not Ask but Bid plus a loss equal to the spread!

Check how your calculations work yourself, especially where the dollar is the base (first).

There are at least two errors in your calculations.

 
Andrey Sokolov:

Once again - for buy,the openingprice is ask. If you use it, you will at least miss the opening spread.


Hence: the sum of profit, swap and commission divided by the pip value- and you can only do this for those pairs where the pip value does not change.

this is a correct breakeven calculationhttps://www.mql5.com/ru/forum/354235/page2#comment_18934560

if your point value changes, then your BU will also be recalculated.... just like your profit order in the terminal will be recalculated every tick

i think this point value should only be applied to calculate the margin - it was discussed on the forums, i don't know what calculations your broker makes

 
Igor Makanu:

this is the correct calculation of Breakevenhttps://www.mql5.com/ru/forum/354235/page2#comment_18934560

It is only possible to calculate accurately for unidirectional positions because the spread changes and this has an impact.

 
Igor Makanu:

this is the correct breakeven calculationhttps://www.mql5.com/ru/forum/354235/page2#comment_18934560

if your point value changes, then the CU will be recalculated.... as well as the profit order in your terminal will be recalculated every tick

i think this point value should only be applicable to calculate the margin - it was discussed on the forums, i don't know what calculations your broker makes

That's what I'm trying to explain

 
Igor Makanu:

if your point value changes, the CU will also be recalculated.... as well as the profit order in your terminal will be recalculated every tick

i asked exactly how to calculate for pairs where the dollar is the base, i.e. the point value changes. And I already understood how.

 
Igor Makanu:

I think this "point value" you have should only be applicable to the calculation of the margin ....

That's not the question.

 
MakarFX:

That's what I'm trying to explain.

You'd better check it out and see for yourself if you're wrong.

 
Andrey Sokolov:

because the spread changes, and that has an impact.

It does affect the closing price and no one is disputing that, but the calculation should be based on the opening price.

My owl displays the line without a loss and changes its position with every tick (if spread or point value changes)

Andrey Sokolov:

You may check it yourself.

There are at least two mistakes in your calculations.

For almost three years this function has never failed.

 
MakarFX:

My owl displays the line without loss and changes its position with every tick (if spread or point value changes)

That's the mistake. What does it show if it constantly changes? I need it to not change and not even for the value of spread.

I repeat, I have already figured out how.