So you may not be necessary to use magic number for trading one EA on one currency only but to run it on multiple currencies and/or along with other EA's at the same time it will be necessary
It's sort of like an ID number to match your orders with your EA. So that one EA does not delete or send orders of that of another EA etc.
At least that's how I understand it.
So you have to decide if you will need magic numbers or not and how your EA will work with other EA's or more then one currency etc.
Hope this helps
Hi Agent,
Thank you for the informative reply. If this is the case, then I'll want to keep that magic #.
What I understand from you is that, in this example, 13131313 will be attached to every order which gets generated by this EA, in order for the EA to track its own orders and to protect them from being touched by other EAs. Is that correct?
Beyond that, could you take away all the other unnecessary blocks of code and keep only the CCI, MA? I am attaching here my latest amended copy.
I would appreciate your support a lot.
tapo
Hi Agent,
Thank you for the informative reply. If this is the case, then I'll want to keep that magic #.
What I understand from you that when you say [code]extern int _MagicenNumber = 13131313;[/code] yo
Use the SRC button and paste your code into the box then click Insert . . . don't use tags . .
extern int _MagicenNumber = 13131313;
Hi Raptor,
You've caught my reply right after it was sent by mistakenly hitting that button. You look like just what you do in the picture :) Anyway, thank you for telling my about SRC. Could you also have a look at my reply to Agent? Perhaps I would learn something even greater from you.
What I understand from you is that, in this example, 13131313 will be attached to every order which gets generated by this EA, in order for the EA to track its own orders and to protect them from being touched by other EAs. Is that correct?
That is essentially correct. In general you would use the magic number in combination with the OrderSymbol to determine if an order had been placed by an EA on a specific chart . . . ideally the magic number will contain a reference to the timeframe then you will have all avenues covered.
Thank you Raptor for confirming that. Can you/another friend have a look at the code attached above and tell how to keep only the CCI and MA functions plus the necessary stuff like magic #? I would like to be able to see how a pure CCI with MA code is written. I basically want to learn from it, and the current code looks complicated and a bit messy.
Additionally, I am running this EA live on a demo account to see how it trades. I have noticed that it opened trader not only based on CCI. I looked carefully to the code and it looks like the MA is not a filter which is applied to the price but it's applied to CCI instead and it triggers trades as well. This is interesting!
I'd appreciate it a lot if someone help me with this code, to understand it and clean it up.
kind regards
tapo
Hi Agent,
Thank you for the informative reply. If this is the case, then I'll want to keep that magic #.
What I understand from you is that, in this example, 13131313 will be attached to every order which gets generated by this EA, in order for the EA to track its own orders and to protect them from being touched by other EAs. Is that correct?
Beyond that, could you take away all the other unnecessary blocks of code and keep only the CCI, MA? I am attaching here my latest amended copy.
I would appreciate your support a lot.
tapo
I have to look it over some more and it will take me some time to understand what it's doing because I'm an intermediate NOOB if there is such a thing, but yet still newbish so it takes me time to follow down the code to understand how some codes are working.
At first glance, I don't understand the use of the continuous != on everything in your code
Especially the != _MagicNumber
A lot of these do not seem typical uses to me; and I have not seen it used this way before.
That certainly does not mean that it cannot be used or is not correct, but simply don't understand it at first glance
I'll try to take a deeper look maybe tonight after dinner if I get a little extra time.
At first glance, I don't understand the use of the continuous != on everything in your code
Especially the != _MagicNumber
I'd appreciate it a lot if someone help me with this code, to understand it and clean it up.
Hi
I have to look it over some more and it will take me some time to understand what it's doing because I'm an intermediate NOOB if there is such a thing, but yet still newbish so it takes me time to follow down the code to understand how some codes are working.
At first glance, I don't understand the use of the continuous != on everything in your code
Especially the != _MagicNumber
A lot of these do not seem typical uses to me; and I have not seen it used this way before.
That certainly does not mean that it cannot be used or is not correct, but simply don't understand it at first glance
I'll try to take a deeper look maybe tonight after dinner if I get a little extra time.
Also I don't know how much MQL knowledge you have. And your profile shows you recently joined the forums and I'm guessing your somewhat new to MQL code ?
Anyhow I'll try to work this out with you, but your going to have to start reading the documentation, book, perhaps the lessons on the forex TSD site, I think this is a version of it. You might search those forums for the lastest version
https://www.forex-tsd.com/metatrader-4-mql-4-development-course/134-welcome-mql4-course-2.html#post3746
Also this book which I plan to purchase and read as well
http://www.expertadvisorbook.com/
Here is a link to a forum subject about it too
https://www.mql5.com/en/forum/124567
Anyhow I'll look over your code some more later tonight, I know this is probably not what you really wanted, but it's a process.
You have to make it through the process which will take some time and reading to get all the syntax down.
The forex-tsd lessons is the best place to start, and then move from there perhaps to the book, documents etc. and so on.
Hope this helps
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi friends,
I'm new to mql4, and would like to learn it step by step. My main intention is currently not to write a profitable EA, but rather to learn this great language. I have check the default MACD EA and removed the SL and TP from it and it worked.
Now I've found this CCI EA in the codebase, played with the code a little bit, and want to a pure CCI and MA code with nothing else in this EA, in order to examine the main functions in it. I see there is stuff like magic #, err, ... etc which I don't think neccesary for generating trades according to CCI triggers and MA filter. Can you please help me with this?
Kind regards,