[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 409
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
When you open and update the chart, a request for new data goes to the server. Some greedy brokerage companies prefer to spend their money on their own pockets rather than on more powerful servers and a wider channel. They have to limit the number of requests from the terminal so that a weak server doesn't get "hung up". MRC has only 2000 requests per day. It's 10 times less than the number of their instruments multiplied by the number of TFs, not counting trade requests.
Inludes in MQL4 help to streamline code. For example, this is how an indicator for 3000 lines looks like in my code.
The thing is, I've seen libraries, and it is mentioned in documentation, that inludes are usually placed at the very top of code, where global variables are declared. If there are functions in inludes, it seems strange to think that in a place where global variables are declared there will in fact be a function in that place, and alternatively, some kind of variables. That's not how the code is written. If variables used in the Expert Advisor and external custom variables are declared at the top, no one puts functions next to them! But they place inludes with functions, and it's considered normal, as I understand it. This is what confuses me the most here.
It just doesn't seem logical...
On the other hand, if an inline is placed, somewhere. instead of several functions, which are responsible for getting, say, a trade signal for some attribute, it would be a logical and readable thing.
Unfortunately, the compiler does not allow one inclusion to be used more than once in one module. This is usually a way to save on repetitive code.
Good afternoon, all.
Studying MarketInfo ( ) and Print( ) functions
Here is a simple code using these functions
Tester, TF 60 min.
The request from the chart looks like the CopyRates ArrayCopySeries request and not the RefreshRates one. CopyRates is the only non-trading function that moves the server.
Checked RefreshRates(). If this Expert Advisor is run, for example, on EURUSD, and another tool whose window has not been open for a long time is inserted in the settings (so that the history is not there), the history appears.
So, still RefreshRates() refers to the server and fills the history. As a consequence, controlling the arrival of history is necessary.
Support says that none of the functions directly refers to the server. Everything is performed through the terminal :-).
If you use GetProfitFromDateInCurrency() (original - this is IMPORTANT: I do not know what you might have got there in your version), then the function should be called like this:
and the function will return profits on orders closed since the beginning of the current day.
And you can catch all stupid things in the code using Print().
it doesn't work. It shows all available profit on trades for the entire history.
Here's the original function and I didn't change anything in it, of course
here is its call and print
Checked RefreshRates(). If this Expert Advisor is run, for example, on EURUSD, and another tool whose window has not been opened for a long time is inserted in the settings (so that the history is not there), the history appears.
So, still RefreshRates() refers to the server and fills the history. As a consequence, controlling the arrival of history is necessary.
Support says that none of the functions directly refers to the server. So, everything is done through the terminal :-)
Vadim, I ran your script on a terminal on which I have never opened any instruments apart from majors and crosses with yen. Anyway, here's a screenshot:
Nothing is pumped because the market data array is empty, judging by the comments...
Vadim, I ran your script on a terminal on which I have never opened any instruments apart from majors and crosses with yen. Anyway, here's a screenshot:
Nothing is being pumped up as the market data array is empty, judging by the comments...
Yeah. He also didn't notice that he has MarketInfo() in his Expert Advisor, not just RefreshRates().
Checked RefreshRates(). If this Expert Advisor is run, for example, on EURUSD, and another tool whose window has not been opened for a long time is inserted in the settings (so that the history is not there), the history appears.
So, still RefreshRates() refers to the server and fills the history. As a consequence, controlling the arrival of history is necessary.
Support says that none of the functions directly refers to the server. So, everything is done through the terminal :-)
The level of imagination is impressive. Why did the data appear only for some symbols (which were not opened), and not for all of them in the market review? How did the RefreshRates() function know that some symbols should be updated and some should not?
Junko, stop rambling.
does not work. Outputs all available profits on trades in the entire history.
Here is the original function and I didn't change anything in it, of course
here's its call and print
So everything is correct. You "read" the function line by line and understand how it works, if you're too bored to write it yourself, and everything will fall into place...
You have a function parameter:
is thetime of the last day baropening, i.e. all positions that are closed before the current day bar is opened will be calculated and summed up! Does that make sense? So set another bar, which is required or whatever it is. But it's up to you to see.
Yeah. He also didn't notice that he has MarketInfo() in his Expert Advisor, not only RefreshRates().
All other functions:
DoubleToStr(iOpen(sTool, 0, i), Digits), ",
DoubleToStr(iLow(sTool, 0, i), Digits), ",
DoubleToStr(iHigh(sTool, 0, i), Digits), " ",
DoubleToStr(iClose(sTool, 0, i), Digits), ",
DoubleToStr(iVolume(sTool, 0, i), 0), "\n");
Naturally, the data will be updated.