[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 209
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
These are the functions, and the objects are the rectangles that appear on the graph.
First, print something out of the library functions in Print, so that you know if they are called at all
Graphical objects are created in library functions . After the first call to the indicator, the objects are created and displayed in the terminal window.
When you call them again they are not present in the list of objects, which suggests that the external functions are not working when re-calculating the indicator for some reason, and the terminal is silent about it.Ok. Instead of indirect signs, print ( " call of this function") in the indicator; we will see at once if this function is called.
You should be less arrogant, then the errors will be found faster)
In general, your problem is most likely in the function
The thing is, the statics isn't reset during reinitialization, so when you restart, your BarTime is always equal to the time of the last bar counted last time, i.e. isNewBar () is false until a new candle arrives. It would be better to move the function from the library to the mqh inluder and zeroize BarTime=0 explicitly in init ().
This is just a first glance at the code, so do not judge too severely if I am wrong.
I would start by removing this line from your library
#property library
Since you are not using a library, but an include file
As far as I remember, you have to specifically remember this time when you set the pending order. You can memorise it directly in the comment to the order (or in magik, as a special perversion:).
QUESTION 1.
How to code this idea.
To set a pending order but make it convert to a market order only if the pending order set price coincides with the opening price of any TF60 candle
QUESTION 2.
How to code this idea.
If a pending order is converted into a market order, in 10 min we should set another pending order with the same values: open price, stop price, volume as in the previous pending order which was converted into a market order.
Thank you.
Ok. Maybe, instead of judging by indirect signs, just type in the indicator itself: Print ("call of such and such function"); we'll see at once if it is called or not.
You should be less overconfident then the errors will be found faster).
And in general your problem is most likely in the function
The thing is that the statics is not zeroed when reinitializing, so on restarting the BarTime is always equal to the time of the last bar counted last time, i.e. isNewBar () will be false until a new candle arrives. It would be better to move the function from the library to the mqh inluder and zeroize BarTime=0 explicitly in init ().
This is just a first glance at the code, so do not judge too severely if I am wrong.
Thank you very much!
Removed isNewBar () from library and put in indicator file. Everything works like clockwork!