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
You are not suppose to just read one section! That is the same as reading that section of reference documentation. The purpose of the book is for it to be read from start to finish, as it builds up your ability to code in MQL4 step by step, from basics to advanced.
It is obvious, that you still do not know the basics, so you cannot expect to start "running" when you can barely "crawl"!
If you have the book it in your library (hopefully it is the 2014 edition and not the 2010 one which is no longer valid or compatible), then you cannot state that you cannot afford it when you have it freely available.
What you can state, is that you lack the discipline to actually follow through in your research and learning, in a structured and ordered fashion, and just want to skip to the end and have the finished product.
It does not work that way, and that is why a mentioned the "required mindset for a trader". Unfortunately, most people of the younger generations, are living in an "instant" world where they want everything "here & now" in an "instant" - it is just "me, me, me", "want, want, want", "now, now, now"!
The real world, does not work that way! It takes time to learn, to gain a skill, to perfect and to improve! In needs discipline, dedication, commitment and these require time and most importantly, effort.
EDIT: As for bugs in the book, the link I referenced also has a download of all the source code with corrections and errata for the book!
if you read mql4 book, its free on mql4 site, i leaned from there, anyone can and its for free, about your problem where is ordersend function?
if you read mql4 book, its free on mql4 site, i leaned from there, anyone can and its for free, about your problem where is ordersend function?
have you tried if ( spread >= 0) ?
i think its best to use == or >= on if functions, never only > or <
have you tried if ( spread >= 0) ?
i think its best to use == or >= on if functions, never only > or <
I did try that, and it didn't work. If it had it would have raised more questions though. The main problem I have here is that one of the nested if statements works fine, but the other one just won't no matter what I do. I've even tried removing the working one from code so that there's only on nested if statement, but it still won't do anything. Here's the code as it stands now:
It also doesn't work if I remove the first if statement (if (Spread >= 0) and just have the nested if statements on their own.
Just to cover all bases, here is the Indicator code. This works perfectly and does seem to generate the correct signals to pass along to the EA via iCustom:
So if you see anything that is obviously wrong please feel free to point it out. Thanks!!
Regards,
Nik
I did try that, and it didn't work. If it had it would have raised more questions though. The main problem I have here is that one of the nested if statements works fine, but the other one just won't no matter what I do. I've even tried removing the working one from code so that there's only on nested if statement, but it still won't do anything. Here's the code as it stands now:
It also doesn't work if I remove the first if statement (if (Spread >= 0) and just have the nested if statements on their own.
Just to cover all bases, here is the Indicator code. This works perfectly and does seem to generate the correct signals to pass along to the EA via iCustom:
So if you see anything that is obviously wrong please feel free to point it out. Thanks!!
Regards,
Nik
Just by glancing the code - not by trying:
You are running a script - not an ea (OnStart is for scripts).
Scripts run once the OnStart - and quit running - and in the code you check the current bar (0) of the indicator buffer Buffer4 (the 4th buffer in the indicator).
Looking at the buffer4 in the indicator you gave, there are sometimes you set it to 0 and sometimes you set a value.
Your If statement checks Trigger variable against values 1 or 2 - but it is probably zero for the current bar (0) and that's why you are not entering.
The new sell section had an "else" statement so basically ,
lets assume a buy signal was valid , then the code would check for a sell signal and if it was not valid it would trigger the else function
and zero out the Trigger[i].
I placed zeroing out of Trigger Buffer1 Buffer2 before the checks .
The issue was in your indicator ,
The new sell section had an "else" statement so basically ,
lets assume a buy signal was valid , then the code would check for a sell signal and if it was not valid it would trigger the else function
and zero out the Trigger[i].
I placed zeroing out of Trigger Buffer1 Buffer2 before the checks .