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
I dont know if it my browser or what the problem is, I have all kinds of problems posting replies and quotes in this forum, one thing that bugs me is when i do reply, more often than not my cursor is stuck in the quote box and wont come out.
I dont know if it my browser or what the problem is, I have all kinds of problems posting replies and quotes in this forum, one thing that bugs me is when i do reply, more often than not my cursor is stuck in the quote box and wont come out.
ok I didnt think i did that but i guess i could have without realizing.
Make sure you don't backspace before typing your message, it's very easy to remove the blank space after the quote but very hard to add it back in.
I agree it's very annoying, that occurs enough often.
In that case, I do the following :
ok I didnt think i did that but i guess i could have without realizing.
Nope . . .
is the same as
and the problem with this is that EMA1, EMA2, EMA3 and EMA4 are all doubles, but the expression (EMA1 < EMA2) results in a bool, so (EMA1 < EMA2) < EMA3 is testing a bool against a double and is not what was ever intended.
Yes i understand now, boolean cant be compared with double.
So if i write it like this
if(EMA1<EMA2 && EMA2<EMA3 && EMA3<EMA4) SELL=true;
This implies that all moving averages will be either under eachother or over eachother, in this case under the slowest one, so by using the < instead of <= that means that no MA will cross eachother they will move along like a wave-like MA structure, and always the quickest MA which in this case is the 1 period "EMA1" will be under EMA2 and EMA2 will be under EMA3 and EMA3 will be under EMA4... and so on, for the sell order to be triggered, right?
While
if(EMA1<EMA2<EMA3<EMA4)
Will result in an error, because its a nonsense.
if(EMA1<EMA2<EMA3<EMA4)
Will result in an error, because its a nonsense.
No it won't. You can do that and if they are all beneath each other that condition will be true.
No it won't. You can do that and if they are all beneath each other that condition will be true.
if(EMA1<EMA2 && EMA2<EMA3 && EMA3<EMA4) SELL=true;