How to get MetaTrader to pick up changes in advisor

 

Whenever I make a change to my Advisor I cannot get meta trader 5 to pick up the changes.

For example if I change one of the global inputs in the code, reload the advisor by right clicking it and hitting refresh. Then right clicking test on the advisor again it will always remember my previous input values.

Another way I can verify it is not picking up the code changes is that if I change the print statements it will still print the statements that were present the first time it was loaded into the test framework. Even after restarting Meta Trader and hitting refresh several times.

The only way I can get meta trader to pick up changes to my code when back testing is by renaming the advisor to a new name and loading everything again.

This is quite problematic when I want to share my advisor code using github as I can't keep making name changes.


Any help would be greatly appreciated.

 
ronald.noble.94:

Whenever I make a change to my Advisor I cannot get meta trader 5 to pick up the changes.

For example if I change one of the global inputs in the code, reload the advisor by right clicking it and hitting refresh. Then right clicking test on the advisor again it will always remember my previous input values.

Another way I can verify it is not picking up the code changes is that if I change the print statements it will still print the statements that were present the first time it was loaded into the test framework. Even after restarting Meta Trader and hitting refresh several times.

The only way I can get meta trader to pick up changes to my code when back testing is by renaming the advisor to a new name and loading everything again.

This is quite problematic when I want to share my advisor code using github as I can't keep making name changes.


Any help would be greatly appreciated.

Sounds like your directory structures are wrong or it is looking in the wrong location for the code. 

I find that if the EA is currently on a chart and I recompile that version then it does restart it on the chart - however, it continues to use the same input values even if the default value has been changed in the code. This is correct behavior and all code changes are otherwise picked up on the recompile. 

 Search this site for info on the mql5 directory locations 

 
MaxTrader:

Sounds like your directory structures are wrong or it is looking in the wrong location for the code. 

I find that if the EA is currently on a chart and I recompile that version then it does restart it on the chart - however, it continues to use the same input values even if the default value has been changed in the code. This is correct behavior and all code changes are otherwise picked up on the recompile. 

 Search this site for info on the mql5 directory locations 

Thanks, I think I've finally figured it out. Seems to be a combination of adding it to favourites and compiling. 
MQL5.community - User Memo
MQL5.community - User Memo
  • 2010.02.25
  • MetaQuotes Software Corp.
  • www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.
 
ronald.noble.94:
Thanks, I think I've finally figured it out. Seems to be a combination of adding it to favourites and compiling. 

you are welcome

 

Reason: