
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
Hei Alexander Martinez,
I appreciate your patience in answering my questions. Before entering a trade, I want to confirm two conditions by looking for both the MA and the CCI to give a confirmed signal on either bullish momentum or bearish conditions.
With this in mind, I'd like to be able to set these in my EA's Settings as "true" or "false."
I hope my idea is clear for your support with this plan
The code attached is what I'm trying to implement in my EA
No problem. I edited my previous post since I didn't see your post afterwards.
By the way, with the code you provided, you're now re-declaring x1 and x2 here:
Also, in the future, it's recommended that you post your entire code instead of big parts that are missing other parts.
Lastly, since you're still learning, I recommend that you write mini-programs of your code to make sure it works exactly how you want, then integrate it into your main program. This way, you can be absolutely certain about what it is you're doing and that you're getting the desired result. Otherwise, your main program becomes a lot tougher to debug and also tougher for others to help you out.
For example, if you had written this in a separate program, you would realize that you're missing a semi-colon at the end of the bool declaration, and that that you have a type mismatch (i.e., you're declaring a bool variable, but you're actually assigning a double value to it). You would also see that you're not getting the desired result and you can debug that pretty quickly.
I'm thinking that my task might be a bit of a mission to complete, so I've decided to go off with CCI and 2MA conditions integrated into my system:
I'd appreciate it if you could walk me through the following two errors:
The void OnTick(){ presents an '{' - unbalanced parentheses followed with '}' - unexpected end of program
I'm thinking that my task might be a bit of a mission to complete, so I've decided to go off with CCI and 2MA conditions integrated into my system:
I'd appreciate it if you could walk me through the following two errors:
The void OnTick(){ presents an '{' - unbalanced parentheses followed with '}' - unexpected end of program
I made a quick attempt at fixing all the syntax errors, but there's just so many extra / missing curly braces and parenthesis.
I also think this is a good opportunity for you to learn to write organized, structured code, and make it consistent throughout your program.
On top of better styling, your functions and if-statements shouldn't be huge; break some of them down into smaller blocks of code by creating functions.
I'm going to leave you a link to the Google C++ Style Guide. The code blocks in red are bad practices, the code blocks in white are good practices.
Believe me:
1. Create a new EA
2. Take a block of code from start of your current EA and paste it into the new EA.
3. Fix the style so it complies with Google's C++ Style Guide
4. Hit "Compile" and see what errors come up - then fix those errors.
5. If the block of code you copied is huge, break it down into functions, replace the block with a call to those functions, then hit "Compile" and check for errors - fix if any errors that come up.
6. Repeat steps 2-5.
Once you've done that, your program should compile, and then we can check for any logical errors rather than having to deal with syntax errors.