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
Hi Raptor,
there is one thing I don't get in my head... I would try it this way:
With iTime() I get the time-value of the bar which is addressed in the parameters. Let's assume it is AUDUSD, M15. So the result will be the (open)-time of the CURRENT M15 bar in the AUDUSD, correct?
My thinking-problem is this: I don't know with which timevalue I should compare it. When I use for example an Alert which should only be executed once a bar, I use static datetime Time0 = Time[0] and begin the int start() with if Time0==Time[0]... But in this case it seems to be different.
OK, here is how I do it . . .
. . . does this help ?
Hey Raptor,
yes, it helps. It all makes (logically) sense to me. And I think I have to change NULL to CurrPair[i] and PERIOD_X to TimeframeNo[j] because I need the array-values. Right? Do I have to format M1Bar1Time global or static? I read it pretty often in the MQL4-docs but I still haven't understood for which purposes I need static and global variables. Do I have to set them 0 at the beginning at the code?
I think these are really basic questions but you can see that I still have to learn so much about the structure of MQL4. Therefore, believe it or not, I have absolutely no idea where to implement it into my code. The logic in itself is pretty clear to me but structure and syntax of MQL4 is really difficult for a beginner when you have never coded C.
I try and try but I don't get only a small step further. Therefore I would like to make an offer to anyone who reads that. If you would like to complete this code with Raptors idea, I would pay for that. For me it would be the best learning effect to see how it is done correctly. I really like to solve logic tasks but there are so many MQL4-specific issues I don't know and before I do the whole weekend trial and error with things I don't understand, I would rather like to pay someone for completing it.
The indicator should update each column only one time according to the column's timeframe. Like I discussed with Raptor, the M5 should only be updated every 5 minutes, the H4 should only updated every 4 hours and so on. Additionally I have put an Alert into the code which should pop up also once a bar when the conditions are met.
If you are interested to complete it, please let me know and I will send you the price with Paypal.
Thanks, guys!
Here is the complete current code:
Hey Raptor,
yes, it helps. It all makes (logically) sense to me. And I think I have to change NULL to CurrPair[i] and PERIOD_X to TimeframeNo[j] because I need the array-values. Right? Do I have to format M1Bar1Time global or static? I read it pretty often in the MQL4-docs but I still haven't understood for which purposes I need static and global variables. Do I have to set them 0 at the beginning at the code?
I think these are really basic questions but you can see that I still have to learn so much about the structure of MQL4. Therefore, believe it or not, I have absolutely no idea where to implement it into my code. The logic in itself is pretty clear to me but structure and syntax of MQL4 is really difficult for a beginner when you have never coded C.
The best way to learn is to do it, try and try and try again . . . add Print() statements to understand what is happening.