Posts: 4
Please rate this topic Current rating: 2.0 Votes: 6
RSS
ranifa
ranifa
Free Member
Offline
  • Registered: 09-26-14
  • Posts: 86
  • Email
  • Thanks: 1

What happen if I close and restart an EA?

What happen if I close and restart an EA?
I play around a little bit with different EAs. Following question came up:

If an EA opens one or more trades, and then I close and restart the EA (or MT4), I don't see the opening of the position anymore on the chart. What happened:

1. It closed the position immidiately  yikes
2. It "forgot" the open position and never closes it again  >:(
3. It closes the position according the strategy   smile

expertfx
expertfx
Free Member
Offline
  • Registered: 10-23-14
  • Posts: 78
  • Email
  • Thanks: 4

Usually #3 will happen for good coded EAs.

Good EAs monitor their orders with a magic number and can continue to work according the strategy after MT restarts.

jay007hot3
Active Member
Offline
  • Registered: 11-11-14
  • Posts: 114
  • Email
  • Thanks: 1

Very Important equation, thanks for post this , I also was know  about it , thanks Sir

Migs
Migs
Lifetime PRO - Unlimited Download Access
Offline
  • From: Spain
  • Registered: 10-24-23
  • Posts: 67
  • Gender: male
  • Age: 38
  • Email

Great question! When you close and restart an EA (Expert Advisor), what happens largely depends on how the EA has been programmed. Here's a breakdown of the options you mentioned:

It closed the position immediately: Some EAs might indeed close the position as soon as you stop or restart them. This could be due to the EA not having a mechanism to remember and manage its open trades.
It "forgot" the open position and never closes it again: This isn't ideal and can be a problem if the EA doesn't have proper trade management capabilities. It's important for EAs to remember their open trades, even after a restart.
It closes the position according to the strategy: This is the best-case scenario. Well-coded EAs typically use a "magic number" to identify their trades, and they can continue to manage these trades according to the strategy even after a restart. So, option #3 is what you'd hope for.


Expertfx has provided an excellent explanation. Good EAs indeed use a magic number or other trade identification mechanisms, allowing them to continue functioning according to their programmed strategy after a restart. So, it's essential to choose or develop EAs that exhibit this behavior.



Now, let's evaluate why these functions are good:

Option 1 (Immediate closure): This could be useful if you want the EA to exit trades quickly in case of any issues or unexpected market movements. However, it's not very flexible.
Option 2 (Forget and never close): This is usually not a desired outcome. EAs should ideally remember and manage their trades properly.
Option 3 (Closing according to strategy): This is the most favorable because it allows the EA to continue managing trades in line with the chosen strategy, even after a restart. It provides flexibility and is often preferred by traders.

A good function to have in an EA would be the ability to set specific behaviors for handling open trades upon a restart, giving traders more control over how the EA manages their positions. Additionally, providing notifications or logs about the EA's actions during a restart could be valuable for transparency and troubleshooting.

Profit posts by forum members!

NOTE: You can only share open-source Forex robots on this platform. Sharing hacked or unauthorized versions of copyrighted Forex robots is strictly prohibited and can result in a ban on your account.

By using the MT4talk website, you automatically agree to the Forum Rules & Terms of Use, as well as the terms below.

Everything you see on the MT4talk website is created by its users, mainly the members of the MT4talk forum, as well as the forum administrators.

What is MT4talk? 
MT4talk is an online Forex forum with over 5000 Forex robots and over 3000 Forex indicators uploaded by forum members in the last 10 years, available to download from forum posts. The uploaded files do not come with support or any guarantee.

The website does not sell Forex robots and does not provide support for any downloaded Forex robots. MT4talk offers a PRO membership, allowing you to download unlimited files from forum posts. If you choose to download a Forex robot from the forum, you do so at your own risk.

The MT4talk Team also provides an Artificial Intelligence Forex robot called "Trade Executor EA," which can be downloaded by PRO members, just like any other Forex robot on the forum. This Forex robot is only a bonus and is not included in the original PRO membership.

MT4talk is an informational website and does not guarantee the performance, profitability, or reliability of any Forex robot available for download. Updates for Forex robots may be limited or nonexistent, depending on the creator. If you choose to download any Forex robot or setting file from the forum, you acknowledge that you are using it at your own risk. MT4talk PRO membership is a digital product. Therefore, after you complete the PRO membership purchase, there is no refund available!


We are conducting real-life tests on Forex robots to assess their performance. For certain robots, we may use a demo account to conduct tests, and for other Forex robots, we may use a real Forex account. It's essential to recognize that we are not financial advisors and cannot provide investment guidance. Our objective is to discover effective market analysis solutions through testing various strategies, which could be beneficial to our community.


CFTC RULE 4.41 – HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS, IN GENERAL, ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.

Disclaimer - No representation is being made that any Forex account will or is likely to achieve profits or losses similar to those shown on backtests in this forum. In fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. Hypothetical trading does not involve financial risk, and no hypothetical trading record can completely account for the impact of financial risk in actual trading. All information on this forum is for educational purposes only and is not intended to provide financial advice. Any statements posted by forum members or the MT4talk EA Tester Team about profits or income expressed or implied, do not represent a guarantee. Your actual trading may result in losses as no trading system is guaranteed. You accept full responsibilities for your actions, trades, profit or loss, and agree to hold the MT4talk team and forum members of this information harmless in any and all ways.


Affiliates Disclaimer - The website may have links to partner websites, and if you sign up and trade through these links, we will receive a commission. Our affiliate partners are FXOpen, FBS, Plexytrade, and MyForexVPS.

Copyright MT4talk.com Forum Rules - Privacy Policy.