- You have Magic#. Example: myMagic=0;
- if( WindowExpertName( )=="myExpert1" ){ myMagic=1; }
- if( WindowExpertName( )=="myExpert2" ){ myMagic=2; }
- You have OrderComment(),
- Example: myOComment=WindowExpertName().
- OrderSend(..................................myOComment......);
- for(blah...blah...blah){
- if( OrderSelect() )
- if( OrderComment()=="myExpert1" ){ do_something=1; }
- if( OrderComment()=="myExpert2" ){ do_something=2; }
- ****Careful using comments as some Brokers overwrite them *Rare.
Thanks Guys.
This is helpful stuff for the first part of my
problem. I knew that the answer was in magic numbers. Its interesting to
see how you have applied them in your codes.
Thanks Guys.
This is helpful stuff for the first part of my problem. I knew that the answer was in magic numbers. Its interesting to see how you have applied them in your codes.
My Opinion, just create a different Expert with a different Magic_Number. The Magic_Number is pretty much the mechanism provided by design to distinguish/label orders. Should Expert_B want to know whats happening in Expert_A, just check_for the Magic# of Expert_A.
Example: Expert_B does Nothing but wait. Expert_A places order based on Algorithm. Expert_B gets Tick, Searches to see if there's any OpenOrders with Expert_A's Magic#. Expert_B attempts placing order like A but with B's Magic# (Obviously there's some Synchronization issues && No_Guarantees on OpenPrice). B is responsible for Closing her own orders. A is responsible for Closing her own orders. They recognize their orders through [yep] Magic#.
For association, you have allot of different options to choose from. Examples: Magic_Numner_PreFix, OrderComments(), GlobalVariableSet(), File. All having advantages and dis-advantages. If you're still confused then perhaps you should practice allot of Simple Experts before attempting complex Experts.
Perfect! That's exactly what I wanted my EA to do. My code writing is not fantastic but I'm up for a challenge. What you've given me is enough to start from. Now I've just got to turn my ideas into an EA (or two EA's)
Thanks heaps.
I'm definitely not a computer geek. Never thought I would be doing this.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This is a challenge for me but maybe someone out there knows how to get around a couple of tricky scenarios.
If I want to run two different experts on two separate charts, both charts having the same symbol and time frames, how do I achieve this so that they do not interfere with each other?
Also can I write an EA that generates a buy or sell condition by recognizing a trade generated by an EA on a separate chart?
Hope this makes sense.
David