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
I already provide these data in the topic, not ?
Sorry, I mean ticks for the whole second duration (+/-1 sec) around the time the position was closed. because I suspect the terminal has some synchronization (timing) issues.
Sorry, I mean ticks for the whole second duration (+/-1 sec) around the time the position was closed. because I suspect the terminal has some synchronization (timing) issues.
I already posted it. You want more ?
Forum on trading, automated trading systems and testing trading strategies
SYMBOL_TRADE_TICK_VALUE_LOSS vs SYMBOL_TRADE_TICK_VALUE_PROFIT
Alain Verleyen, 2023.02.21 20:54
No. Please check the link to the original post to get all information ;-)
The bid and ask were known and the bid was 1.44725. I checked the history, this trade was close exactly at 2022.08.28 23:05:00.871 and at that time here are the ticks :
The loss is clearly calculated using 1/Ask, not 1/Bid.
I already posted it. You want more ?
I already posted it. You want more ?
This is really frustrating Alain, not gonna lie, I'm still trying to figure out what is happening in this example and I don't understand why it would use the ask to convert the loss, this make no sense... I'm still trying to understand though...
Wait few minutes. I am posting the results of the test I ran it.
See it and then decide.
This is really frustrating Alain, not gonna lie, I'm still trying to figure out what is happening in this example and I don't understand why it would use the ask to convert the loss, this make no sense... I'm still trying to understand though...
Yeah...I can't figure it out either.
Forum on trading, automated trading systems and testing trading strategies
Serious bug in the OrderCalcProfit() function
amrali, 2023.02.21 23:35
Ok, this is a proof based on numbers from the terminal (not theories).
I ran the test on two different terminal, one with an account currency = EUR, the other's account currency is USD.
First I use a script, to open positions on all forex symbols on the market watch using a large position size as possible. I increased the demo balance to the maximum 100K to do the tests.
Then, I used a second script "2. AnalyzePositionProfits_Script.mq5" to analyze profits of all open positions, using these methods:
The script outputs the results to csv file. I always use Ron's CSV editor to read csv files. https://www.ronsplace.ca/Products/RonsEditor/Download
Here is the result from the EUR account:
Here is the result from the USD account:
As can be seen POSITION_PROFIT is sometimes (but not always) equal to profit calculation using OrderCalcProfit(). The reason for this may be a timing (sync) issue between the ticks on the server used to calculate the POSITION_PROFIT field and the later ticks reaching the terminal. So, my conclusion is that the value of the POSITION_PROFIT field is calculated on the server, independent of the quote data arriving to the terminal in that exact moment.
All the other methods are matching my previous calculations:
Yeah...I can't figure it out either.
Maybe they convert the AUD loss to GBP first and then they convert from GBP to EUR... I'm not sure but I read something like that once, I'm going to try to read something on this topic tonight to double check
This is really frustrating Alain, not gonna lie, I'm still trying to figure out what is happening in this example and I don't understand why it would use the ask to convert the loss, this make no sense... I'm still trying to understand though...
I am also having no explanation for your trade @Alain Verleyen. I told you before it is contradictory to my previous tests.
I am also having no explanation for your trade @Alain Verleyen. I told you before it is contradictory to my previous tests.
I will check your results and investigate further on my side.
Will post my feedback...not sure when though.