
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
GetProfitOpenPosInCurrency() function.
This function returns the total profit of the currently opened positions. Profit is returned in units of the deposit currency. More accurate selection of positions to be taken into account is specified using external parameters:
Wrong code, it's not 131, it's 130.
I see...
Try normalising as follows:
I do so and I don't encounter error 130.This is how I bring in the price, only using Digits. But it doesn't help, the error doesn't always pop up, only in some cases, and I haven't found out what it depends on. I should probably use my hands to check output values trying to be set by robot.
In the light of possible developments in the future, this addition will come in handy:
I wonder if there will be one in five...? ;)))Thanks again for the tip on how to summarise the data in the loop!
Yo-yo, are you kidding me? My compiler doesn't understand OrderTaxes().
Of course!!! :)))
You can see it in the highlighting, and in the comment clearly pointed it out...
Although it is one of the properties of an order, or rather a position, and such a function should in principle be...
-
And if the compiler doesn't understand...
The GNI will teach us ;)
GetProfitOpenPosInPoint() function.
This function returns the total profit of the currently opened positions. The profit is returned in points. A more accurate selection of positions to be taken into account is specified by external parameters:
In this thread I will post the codes of my functions in MQL4, give examples of their use, and answer questions related to their use. Each function will be published in two posts. The first post will contain the function code, the second - examples of use and short explanations. Sometimes I will attach the code of a script to the second post to actually test the function and display the results.
I will start with functions to handle orders as per Lukyanov's request in the topic "How to Run Two EAs At the Same Time" in the end.
Let the first be the order setting function (MT4 tester version):
Hi, please help me write an EA. I don't know much about it but it sounds like a good idea. The meaning of the idea in the following if it is certainly possible.
It is necessary that would open two bids simultaneously one Sell one Buy with parameters (lots=0.1____TafeProfit=30______StopLoss=10) and at the closing of losing opened the second positive with parameters (lots=1____TafeProfit=30______StopLoss=10)
If you're not going to send me on the hoo... then ideally the two initial bets open at minimum or maximum candle or at the appearance of a new candle, but if the second part of write long make at least the first part of my ramblings
Thanks a lot in advance !!!! If you write it, put it here vms.80@mail.ru
GetTicketLastPos() function.
This function returns the ticket of the last open position or -1. A more accurate selection of positions to be taken into account is specified by external parameters:
I don't know what to do with it but I have an idea what to do with it. I have no idea about it, but it may be a good idea. The gist of it is as follows, if it is possible.
It is necessary that would open two bids simultaneously one Sell one Buy with parameters (lots=0.1____TafeProfit=30______StopLoss=10) and when closing the loss-making opened the second positive with parameters (lots=1____TafeProfit=30______StopLoss=10)
If you're not going to send me on the hoo... then ideally the two initial bets open at minimum or maximum candle or at the appearance of a new candle, but if the second part of write long make at least the first part of my ramblings
Thanks a lot in advance !!!! If you write it, put it here vms.80@mail.ru
Or maybe send the comrade all the CodeBase EAs to this address.
Sorry, Igor, for being off-topic. If anything, I will delete it.
Or maybe send the comrade all the CodeBase EAs to this address.