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
And OrderClosePrice get's it's value from them. No change since 2012
In your linked post
It turns out that OrderClosePrice is a copy of data and does not update on its own or on a RefreshRates. You have to explicitly do another OrderSelect (by test).
I am unable to test this now as the market is closed, but I have tested it before and OrderClosePrice was updated with re-selecting the order. No need for a RefreshRates.
gjol mentioned that he tested this with a script, maybe he can confirm whether he used RefreshRates or not.
i can't confirm because my test was
Hi Everyone! Thanks for your replies. This is my updated function, which re-selects the order after a requote to try again. The function will iterate all market orders and try to close them over and over again until successful, selecting the order again to do so. This should work, could not test because it is weekend. Use the function if you feel so. Will let you know how it goes.
I ran this test
and the results were
0 05:09:52.937 AB EURJPY,H4: Initial OrderClosePrice = 132.976 Ask = 132.976
0 05:10:53.296 AB EURJPY,H4: After RR() OrderClosePrice = 132.976 Ask = 132.962
0 05:10:53.296 AB EURJPY,H4: After Re-select OrderClosePrice = 132.962 Ask = 132.962
0 05:11:53.656 AB EURJPY,H4: After Sleep OrderClosePrice = 132.962 Ask = 132.962
0 05:11:53.656 AB EURJPY,H4: After Re-select OrderClosePrice = 132.982 Ask = 132.962
0 05:11:53.656 AB EURJPY,H4: After RR() OrderClosePrice = 132.982 Ask = 132.982
This shows that RefreshRates does not need to be called before re-selecting the order.
Hi @qjol! Oh my! Well it would still work because boolean types can be casted to int directly, but it is a major code typo xD Sorry.
Convert int closed = false; to bool closed = false;