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
Yea I need it specifically for PERIOD_H1 chart. As I may change time frames and want that hard coded for that TF.
(Im worried that I am doing this wrong - especially what you've written to me twice now WHRoeder regarding MA's and the if statement... - So i'm bracing for some slapping, but I think that would tell me the bar where the MA's crossed (below). So this would surely work by applying it to iBarShift...?)
Multiple moving averages will not cross at the same time.
Why are you double posting? Your question was previously answered.
Find the earliest bar where they were all in the proper order.
Can I ask what the Bar variables purpose is? Also, what does "--" mean? The two "--" and "!" marks? (if you'd be so kind? I have looked through the help section, but haven't come across what they're purposes are.)
Can I ask what the Bar variables purpose is? Also, what does "--" mean? The two "--" and "!" marks? (if you'd be so kind? I have looked through the help section, but haven't come across what they're purposes are.)
And can I ask you why basic from book is still unknown ??
https://book.mql4.com/basics/expressions
learn to code.
But I know what a gas key is... - that's more simple than coding...
You lot are right though - I do need to read it through.
It's because I learn best from trial and error (im a hands on guy when it comes to retaining knowledge). It helps me understand logic when I see it. Plus the MQL4 site doesn't necessarily explain things clearly on how they all work together.
So to answer your question deVries, that is why I know some basics and some more advance stuff, but it comes patchy because I like to play around and learn that way.
Sorry if I am becoming a pain!
EDIT - I still don't understand "Bar" part of that code you wrote WHRoeder - I'm not sure that's right?
But would you be trying to drive without knowing what it was? That would be moronic.
You are trying to code without knowing what "--" and "!" are. What's the difference?
!= True, if x is not equal to y - (DIR != 0) - If DIR (which is 0) is not equal to "0" then the Break operator will return control to the for operator. And start the loop again.
-- Subtraction of 1 from the value of the variable. So "iBar--;" = iBar = 0, so subtracting 1 = -1?
Hey - I'm really trying here. I'm sorry if I don't learn as quick as what some people do (and don't you think I'd rather be that way! I would much rather learn it by myself and get it, without having to ask for someone' help!) but I am trying my best. I may not be the brightest spark in the world... So forgive me for that at least...
!= True, if x is not equal to y - (DIR != 0) - If DIR (which is 0) is not equal to "0" then the Break operator will return control to the for operator. And start the loop again.
-- Subtraction of 1 from the value of the variable. So "iBar--;" = iBar = 0, so subtracting 1 = -1?
Hey - I'm really trying here. I'm sorry if I don't learn as quick as what some people do (and don't you think I'd rather be that way! I would much rather learn it by myself and get it, without having to ask for someone' help!) but I am trying my best. I may not be the brightest spark in the world... So forgive me for that at least...
In this loop
iBar has here different values as long it is smaller as Bar it will become value 1 higher
means....
iBar = iBar - 1;
Ah - I think I got it working now - Just staring at Bar for a while and then realised :) - I am starting to realise that what I am trying to code is slightly more complex than I first thought. I need the MA's to turn and fan up or down (depending if its a buy or sell). If its fanned up (for a long) They dont always needs to be in the right order - it's just a case of first identifying when they're all stacked up and fanned apart in the right order - from this point all I am wanting is price to check the 21 ema and then place an order above the highs. I'll have a play around of course! NOT expecting anyone to write me the code - just merely writing my thoughts aloud.
Thank you!