| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Empty4 v600 for Coders https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3439 |
Page 1 of 5 |
| Author: | SpiderX [ Tue Feb 11, 2014 2:17 pm ] |
| Post subject: | Empty4 v600 for Coders |
Hi, Thought that it would be nice to make a checklist of stuff to do when porting EA's over to the new version 600. Please feel free to suggest stuff to add to this checklist, and will do my best to update this first post. 1. Replace all names with "." i.e "var1.limit" , change the "." to "_" , eg. "var1_limit" 2. All "return; " must be converted to "return(0);" 3. Function variables should not have same name as global variables 4. Replace StringSubStr with StringSubStrOld. You need to add the function below into your EA code. Reference: http://www.forexfactory.com/showthread. ... ost7268388 Code: Select all 6. Add #property strict on top of the code and compile. This would flush out more errors and warnings. 7. Reference: http://www.stevehopwoodforex.com/phpBB3 ... 914#p88899 Need to add a boolean variable to catch the output of OrderSelect, OrderClose etc. Code: Select all Lets add on to the list as we find more stuff. Cheers |
|
| Author: | milanese [ Tue Feb 11, 2014 2:24 pm ] |
| Post subject: | Re: Empty4 v600 for Coders |
Thank you for bringing this topic Cheers Tommaso |
|
| Author: | dietcoke [ Tue Feb 11, 2014 6:31 pm ] |
| Post subject: | Re: Empty4 v600 for Coders |
I have found that MQ4 function libraries where the functions are imported via an MQH header file compile ok, but new mq4 appears not to call the functions when the code that is using themi is run. I have been having problems with an EA which uses LibOrdrReliable. basically, t wasn't opemning, modifying or closing anything until I moved the library functions to the include folder and renamed to MQH. Would be intereste to know if anyne else has seen this or tried it to fix another problem |
|
| Author: | AnotherBrian [ Wed Feb 12, 2014 4:36 am ] |
| Post subject: | Re: Empty4 v600 for Coders |
I like the new compiler although it is talking smack about my code 2. All "return; " must be converted to "return(0);" Agree, except for "void" functions where you use return; since it is not supposed to return a value. Try putting #property strict at the top and the compiler. http://forum.mql4.com/60555 Working with functions, scope of variables and memory release in local arrays has also been changed. Since the number of changes is large enough, the new #property strict property has been introduced to provide maximum compatibility with the previous approach to developing MQL4 programs. When creating new MQL4 application using MQL wizard, this property is always added to the template. The table below contains the differences between MQL4, new MQL4 without using strict and new MQL4 with specified strict compilation mode. * Please pay special attention to "Array out of range" error - many old custom indicators will display this error in strict mode of the new compiler when launched on the chart. It is recommended to find the cause and eliminate it. |
|
| Author: | SpiderX [ Wed Feb 12, 2014 2:39 pm ] |
| Post subject: | Re: Empty4 v600 for Coders |
Hi all, Yes. #property strict seems to do some stuff. Putting it in BASA introduces the following errors and warnings -implicit conversion from number to string -possible loss of data due to type conversion -possible use of uninitialized variable Error - xxx -undeclared identifier This one is easy to resolve, the problem occurs when you have Code: Select all Code: Select all Cheers |
|
| Author: | SpiderX [ Wed Feb 12, 2014 2:46 pm ] |
| Post subject: | Re: Empty4 v600 for Coders |
Next warning: implicit conversion from 'number' to 'string' Results from Code: Select all Code: Select all Edit: These turn out to be a lot of trouble to correct....would be great if someone can provide a quicker solution. |
|
| Author: | renexxxx [ Fri Feb 14, 2014 7:17 am ] |
| Post subject: | Re: Empty4 v600 for Coders |
In my opinion, CrapQuotes has created a total mess with v60x, as it is the stepping stone to MQL5, but with (some) backward compatibility to MQL4. For instance, for indicators we had in MQL4 Code: Select all Code: Select all The next step, no doubt, will be is to get away from the internal indicator functions (such as: iMA(...)) and replace them with the IndicatorCreate(), to create a handle and to use CopyBuf() when you want to use the values, like this is now done in MQL5. In this total mess, I find it hard to create "future-proof" code, as the MQL language/compiler is undergoing rapid changes. That means that us, coders, are too busy changing code, that we have no more time to actually make money. Thoughts? |
|
| Author: | SpiderX [ Fri Feb 14, 2014 10:16 am ] |
| Post subject: | Re: Empty4 v600 for Coders |
As long as we have that stuff which we have in between our ears running...I guess we can take whatever they throw at us right ? Cheers |
|
| Author: | Pedigree [ Tue Feb 18, 2014 7:58 am ] |
| Post subject: | Re: Empty4 v600 for Coders |
Thank you so much for starting this. It is sorely needed and will be such great help. A Question: What redress, if any, is there to help 509 dlls retain their viability in 6xx other than a complete re-write? |
|
| Author: | SpiderX [ Tue Feb 18, 2014 10:01 am ] |
| Post subject: | Empty4 v600 for Coders |
Apologies but I got no experience with dll. Hopefully someone here is able to help you. Cheers |
|
| All times are UTC | Page 1 of 5 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|