OrderSelect, OrdersTotal, OrderLots are fast. They read data, which is already fetched. You should worry only about OrderSend and OrderModify, that wait for server response.
MisterDog:
Using a variable will always be quicker than calling a function, do you really need the speed ? are you happy you can be sure your variable is current and not holding a value that is now out of date ? I would suggest that first you make your code work as you want it to, then if it needs it optimize it for performance.
Do we need to think about the speed of functions in our program structure? If code uses Trade Functions between the the part of the code that makes the decision to trade and the code that actually makes the trade, then speed could matter. In a fast moving market would the following program be too slow?
Would the program be more reliable if we call the Trading Functions ahead of these time sensitive parts of code and assign them to variables like this? So the code uses faster variables in time sensitive sections.
What do you think?
Ovo:
Only OrderSend and OrderModify wait for the server. This is good to know. Perhaps speed was not my program issue -- just sloppy coding.
RaptorUK:
Using a variable will always be quicker than calling a function, do you really need the speed ? are you happy you can be sure your variable is current and not holding a value that is now out of date ? I would suggest that first you make your code work as you want it to, then if it needs it optimize it for performance.
Using a variable will always be quicker than calling a function, do you really need the speed ? are you happy you can be sure your variable is current and not holding a value that is now out of date ? I would suggest that first you make your code work as you want it to, then if it needs it optimize it for performance.
Since most of the Order functions don't call on the server then I do see your point. -- thanks.
Ovo: You should worry only about OrderSend and OrderModify, that wait for server response.
RaptorUK: And OrderClose(), OrderCloseBy() and OrderDelete() also some other functions may also wait for the server to respond.
Agreed. Those and calls that download history (different pair/TF) (iTime, etc/ArrayCopyRates)
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
Do we need to think about the speed of functions in our program structure? If code uses Trade Functions between the the part of the code that makes the decision to trade and the code that actually makes the trade, then speed could matter. In a fast moving market would the following program be too slow?
Would the program be more reliable if we call the Trading Functions ahead of these time sensitive parts of code and assign them to variables like this? So the code uses faster variables in time sensitive sections.
What do you think?