Running MT4 Expert Advisors - general operating questions

MPW Capital  

I'm coming from trading on MultiCharts and new to using MT4, so please bear with me... I have a few questions about running live EA's that I'm hoping someone might be able to help with. I tried searching the forums and Google for answers but am having a hard time finding specific answers, so if you have any feedback on any of my questions I'd appreciate it! My questions are as follows:

  1. If I add a EA to a chart and it starts running, is there any way to tell if it should have an open position already for instance if a trade was supposed to be opened a few bars before I actually added and started the EA? For instance, in MultiCharts, they have a Strategies and Positions window where when I add a strategy to a chart it will let me know if my real-world account positions match the positions that the chart would otherwise indicate - is there anything in MT4 that's similar?
  2. Do you know of any indicators that sync up with the expert advisors that would show the historical expert advisor trades on the charts, or would tell me if my real world positions match what the expert advisor position should be?
  3. Related to question 1, if I freshly add or re-start an EA on a chart and a current position exists in my trading account, how can I be sure the the real account position is synced to the expert advisor position?
Fernando Carreiro  
MPW Capital:

I'm coming from trading on MultiCharts and new to using MT4, so please bear with me... I have a few questions about running live EA's that I'm hoping someone might be able to help with. I tried searching the forums and Google for answers but am having a hard time finding specific answers, so if you have any feedback on any of my questions I'd appreciate it! My questions are as follows:

  1. If I add a EA to a chart and it starts running, is there any way to tell if it should have an open position already for instance if a trade was supposed to be opened a few bars before I actually added and started the EA? For instance, in MultiCharts, they have a Strategies and Positions window where when I add a strategy to a chart it will let me know if my real-world account positions match the positions that the chart would otherwise indicate - is there anything in MT4 that's similar?
  2. Do you know of any indicators that sync up with the expert advisors that would show the historical expert advisor trades on the charts, or would tell me if my real world positions match what the expert advisor position should be?
  3. Related to question 1, if I freshly add or re-start an EA on a chart and a current position exists in my trading account, how can I be sure the the real account position is synced to the expert advisor position?

If you are just starting I would suggest you advance to using MT5 instead. Yes, MT4 is easier to use and understand, but it's development has been halted for close to a decade already.

  1. Yes and no! The EA has to be coded to analyse any open trades and pick up where it left off. If an EA does not have that kind of logic build it, it can easily "mess up" and place duplicate trades. You can visually see if an EA has any open trades (or trade history) by the "magic number" of orders, if you know which magic number was used by an EA before.
  2. No, that is not how things work on MetaTrader. Please refer to my previous point.
  3. Again, not how MetaTrader works. See answer to point 1.
MPW Capital  
Fernando Carreiro #:

If you are just starting I would suggest you advance to using MT5 instead. Yes, MT4 is easier to use and understand, but it's development has been halted for close to a decade already.

  1. Yes and no! The EA has to be coded to analyse any open trades and pick up where it left off. If an EA does not have that kind of logic build it, it can easily "mess up" and place duplicate trades. You can visually see if an EA has any open trades (or trade history) by the "magic number" of orders, if you know which magic number was used by an EA before.
  2. No, that is not how things work on MetaTrader. Please refer to my previous point.
  3. Again, not how MetaTrader works. See answer to point 1.

Thanks so much for your reply, Fernando! Unfortunately the group I'm planning on trading with only uses MT4 for now, so switching to 5 isn't as option for me currently.

Regarding the 'magic number', I did a little lookup and just wanted to clarify something... So you're saying that unless the trade was initially opened by an Expert Advisor and assigned a magic number, there is no way to sync a manually-opened position to the expert advisor, correct? So basically when first adding an EA, if it should have an existing trade open when it's first added to the chart but it doesn't it would just skip the trade and wait until another entry signal exists? And the only way for a trade to be assigned a magic number is for it to actually be assigned during the opening of the trade using the EA, and I can't go back and change the magic number of any existing trades to line them up with new incoming EA signals?

Fernando Carreiro  
MPW Capital #: Thanks so much for your reply, Fernando! Unfortunately the group I'm planning on trading with only uses MT4 for now, so switching to 5 isn't as option for me currently.

Regarding the 'magic number', I did a little lookup and just wanted to clarify something... So you're saying that unless the trade was initially opened by an Expert Advisor and assigned a magic number, there is no way to sync a manually-opened position to the expert advisor, correct? So basically when first adding an EA, if it should have an existing trade open when it's first added to the chart but it doesn't it would just skip the trade and wait until another entry signal exists? And the only way for a trade to be assigned a magic number is for it to actually be assigned during the opening of the trade using the EA, and I can't go back and change the magic number of any existing trades to line them up with new incoming EA signals?

You calling it "syncing", but such a concept is not how MetaTrader or EAs work. So you will have to abandon that way of looking at it.

Manually placed trades always have a magic number of "0". EAs on the other-hand can assign any magic number, including "0" to the trades it places or manages.

So, an EA can be coded to look for manually placed trades (magic number = 0) and then continue to manage the trades for you, for example adjusting stops as the trade progresses. This obviously has to be coded into the EA's logic.

Alternatively, you can use a "Trade Assistant" or "Trading Panel" EA to place trades "manually" via its own user interface, to place trades with a specified magic number instead of the default "0" that the terminal uses.