Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1054
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Igor Makanu:
standard CTrade does not provide an out-of-the-box service
On MT4 there are trading things that are coded in one line. On MT5 you can't do the same thing through SB even in a hundred lines. On pure MQL5 it's even worse. That's ok.
https://www.mql5.com/en/forum/218100
Thanks, good example I'll look into it, here's a script for MT4 - determine profit in pips:
I wrote it from scratch in 10 minutes? - Well, about that, the logic is simple and straightforward - you take it and write it, in MT5 so far we only discuss a spherical horse in a vacuum... if trades and whether there are orders, left to discuss types of accounts netting or hedge.... and we will write something by morning.
Thank you, good example, I will study it, I made a script for MT4 - determine profit in pips
I do not need to tell you how to run this script in MT5. However, the script itself has errors.
First I will show you the history
and the result of the execution
Прибыль последнего закрытого ордера -259 пунктов
Here are errors
And the errors here.
При таком вычислении легко потерять один пункт.
How to fix? I've never thought about it, the scheme seems to be standard: 2 prices - find the difference and divide by points
i agree with the rest, but i need to think, the scheme of order search is classic and i want to compare the time to the highest.... just in case. i need to think, although it's the first time i have to do it - 99.99% of the time nobody even tries to trade hft TS on MT4
How to fix it? I never thought about it, the scheme seems to be standard: 2 prices - find the difference and divide by points
Loss when casting double -> int.
I agree with the rest, but I need to think, the scheme of enforcing orders is classic, and I want to compare the time to the highest.... just in case. i need to think, although this is the first time i've encountered such a problem - in 99.99% of cases no one even tries to trade hft TS on MT4
HFT has nothing to do with it. CloseAll script may well close two positions within one second. In MT4 you have to compare, in MT5 it's unnecessary. And it is probably easier to compare via ArraySort (if, for example, you want to quickly change to the penultimate closed position).
The loss when casting double -> int.
this is all clear, but how do I correctly calculate the difference of 2 prices in integer points?
This is all clear, but how do I calculate the difference in pips between 2 prices?
Forum on trading, automated trading systems and testing trading strategies
need help for calculated total pips for order closed today (Mql5)
fxsaber, 2017.10.25 01:00
Thank you!
I especially liked it.
I'll keep that in mind, I usually write everything in global visibility, your example reads much better
....
And this is correct? In the order loop, would SymbolInfoDouble(OrderSymbol(), SYMBOL_POINT); be recalculated each time, becauseOrderSymbol() will be different each time?
Forum on Trading, Automated Trading Systems and Strategy Tests
Questions from Beginners MQL5 MT5 MetaTrader 5
Igor Makanu, 2019.06.04 18:43
Thanks, good example i'll look into it, here's a script i drafted for MT4 - determine profit in pips:
Written from scratch in 10 minutes? - Well, approximately so, the logic is simple and straightforward - you take it and write it, in MT5 we are discussing only a spherical horse in a vacuum... if trades and whether there are orders, left to discuss types of accounts netting or hedge.... and we will write something in the morning.
I wrote it on the fly, as I wanted - I wanted to output +100 points or -100 points, it was a matter of taste - I had no specific task, but to write conditions to determine the order type and compare the opening and closing price, it seemed that there would be too many extra lines...
ZS: This is a forum for programmers, isn't it? - They are like that. They can optimize one code (especially someone else's) 10 times over, to replace 5 lines with 4 )))