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
DBL_MAX will be there.
Why isn't the handicapped nandl returned, even though the handicap has been removed?
First print is 10, second print is true, third print is 10 again. Put a slip a minute - still 10.
I think it should be -1(INVALID_HANDLE). Am I thinking wrong?
Why isn't the handicapped nandl coming back, even though the handicap has been removed?
First print is 10, second print is true, third print is 10 again. Put a slip a minute - still 10.
I think it should be -1(INVALID_HANDLE). Am I thinking incorrectly?
The deleted indicators are not removed immediately physically, but after a pause (perhaps a few minutes), in case the same or another program re-opens them (caching option).
In most cases, this is convenient. The problem will occur only if the cycle reads buffers of a large set of indicators (so big that not all of them can fit in the memory at once).
// Only in this case it makes sense to release indicators in the program at all.
// All other variants of use of IndicatorRelease() function are "racially wrong", because indicators are freed at work completion.
Hence, the paradox: the function is useless because caching completely kills all kosher use cases.
In this case Renat once voiced a promise to make a variant of "instantaneous release", but apparently he is still very busy. ;)
--
That's sort of the first part of the answer (without which the second would be incomprehensible).
Now about INVALID_HANDLE. As I see, functions of releasing dynamic objects, as well as the delete operator, don't assign the value INVALID_HANDLE to the pointer per se; they only remove objects which the handle points to. Only memory allocation functions (new operator as well) forcefully assign INVALID_HANDLE values to pointers in case of failure, so the correct way to check the pointer validity is the CheckPointer() function which literally looks through the system table of handles looking for an object and returns the handle type if the object is found or 0 if it is not.
Hopefully the logic of dealing with pointers (handles) is now a little clearer. As well as the results from your example. Everything is correct there : the indicator is a group access object, it's not physically removed at the first whistle (so even CheckPointer() will return non-zero), not to mention the glitch of hoping to get the INVALID_HANDLE value in the pointer variable after passing it to IndicatorRelease() by value.
The article Orders, Positions and Trades in MetaTrader 5 gives the example that"Each trade is based on one particular order, butone order can generate multiple trades. For example, an order to buy 10 lots can be executed through several successive trades in partial execution". My understanding is that if I want to open a position for e.g. 10 lots, then several trades may appear in the history. In my strategy, 1 and 2 position in the same direction, my Expert Advisor (MT4) opens with 1.0 lot, and then the third and then 2.0 lot. In MT5 it may happen that opening the 1st position in the history may appear e.g. 2 or more trades. 2 or more trades may appear in the history. When wishing to open a 2nd position, the Expert Advisor will scroll through the history and find that it will be the 3rd position. And it will open the wrong lot. This is kind of annoying.
Maybe someone knows how to solve this problem or give me a link.
Thank you, just what you need.
// nelp by nelp for dummies - that's what's needed in the articles.
I am trying to create an indicator that uses two different timeframes, e.g. M5 (current one on the screen) and H1. How to synchronize prices between these different timeframes? For example, when calculating the last value of the indicator on M5, I want to automatically pump prices from H1 of the same time (i.e. the zero bar in both timeframes after ArraySetAsSeries corresponds to the current last time, as in OnTick, but not the latest bar on the screen). If there is no such a possibility and we should check the bar times manually, we should add a synchronizing function, like onTick, for indicators.
I have tried to test it in the tester - it is a good thing. Why is the last calculated value not saved on the screen?
I am trying to create an indicator that uses two different timeframes, e.g. M5 (current one on the screen) and H1. How to synchronize prices between these different timeframes? For example, when calculating the last value of the indicator on M5, I want to automatically pump prices from H1 of the same time (i.e. the zero bar in both timeframes after ArraySetAsSeries corresponds to the current last time, as in OnTick, but not the latest bar on the screen). If there is no such a possibility and we should check the bar times manually, we should add a synchronizing function, like onTick, for indicators.
I have tried to test it in the tester - it is a good thing. Why aren't the previously calculated values saved in the indicator?
Use one of the overloads of the function CopyXXXX()
When debugging, make a check in which direction the data is copied (if more than 1 is copied).
Use one of the CopyXXXX() overloads
When debugging, make a check in which direction the data is copied (if more than 1 is copied).
Hello!
Could you please tell me the code of an indicator that draws the max and min on the current minute charts of the previous day?
SPS!
Long time no see =).
Let's say. There is some point in time. For example D'03.07.2005 13:48:12'.
How can I find out the time of the bar (of a certain period) that includes this time period?
It would be nice if there was a function like:
datetime УзнатьВремяБараПоВремениПользователя (datetime времяПользователя, ENUM_TIMEFRAMES периодБаров)
... And that it would return a negative value if there was no trade at that time.
Well, spit it out, is there such a function?