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
borilunad:
The most complex calculations do not slow down as much as functions that check the various necessary market data and open positions on every tick.
Holy truth, MarketInfo is one of the worst testing problems. I usually write in two blocks for such cases if possible, making "real" queries only for real trading mode. This is especially effective for unmeasured (in the tester) data, for example:
You can also send in block if(!IsTesting()) all sorts of RefreshRates(), queries to MODE_BID and MODE_ASK (replacing them with quick Bid and Ask) and so on.
Holy truth, MarketInfo is one of the worst testing problems. I usually write in two blocks for such cases if possible, making "real" queries only for real trading mode. This is especially effective for unmeasured (in the tester) data, for example:
You can also send in block if(!IsTesting()) all sorts of RefreshRates(), queries to MODE_BID and MODE_ASK (replacing them with quick Bid and Ask) and so on.
Thank you very much, Pako! How did I not guess, it's so easy! I'll have dinner now and do what I can and check the speed of the passage.
And this I don't understand what you mean. Where did you get those numbers from? And if you're interested in short variable names, I prefer short ones to long ones. Or what else? Yes, just noticed that you added two brackets before clo and at the end after clo to my formula. That's not necessary at all, it disturbs the calculation. But thank you all the same!
<--- 10,444 = 8,087 > 3,908 is that in what language?
Made, checked, it worked, but the result has not pleased me yet, practically did not reduce the time of the run! Tomorrow I'll try to do everything I can, maybe then there will be some difference.
But anyway the main thing is that thanks to you, Pako, Aleksey, Victor and others I've learned another important method of code writing, for which I'm extremely grateful!
I use a function in such cases.
For example:
I always use Bid and Ask.
Then you do need RefreshRates()))
I use a function in such cases.
For example:
Then you do need RefreshRates()))
Yes, I have RefreshRates() at the start, or is that not enough?
Yes, I have RefreshRates() at the start of Start, or is that not enough?
It all depends on how long the calculations take to run. There may be a situation where the price has updated during this period, and hence Ask and Bid become irrelevant. That's why it's better to call RefreshRates() additionally before executing trades (or rather, before calculating prices for them).
So you need RefreshRates() before each series of conditions? Because I thought there's also RefreshRates() in each executing function, where it checks for errors, to repeat the order, and that's enough. Then I'll try putting more RefreshRates() and see what happens! Thanks!
And Pap'e Yozh my thanks as well!