Query regarding article - Templates a spot to stand on

 

hi all

i'm pretty new to MQL4 and have been working my way though the above article. the article itself is great as is the template example. i am however, with the greatest repect to the author, having difficulty getting the modifymarkets function to run. i.e. i have created a very simple EA using the template... buy when price is above MA, sell when below. for the inital stop it's the previous bar's range subtracted from the low for longs and added to the high when short.

i would like the stop to trail as follows ... for long orders the lowest low of the last 5 bars, and for shorts the highest of the last 5 highs etc. im not concerned how good these setting are, just that as a new bar appears, the stop will adjust as required. the trailing stop code is not the problem i just cant get the modifymarkets function to run.

the best i have been able to work out is that the array ' newSL_and_TP[][] ' called from within the modifymarkets function is always of zero size and therefore the function quits.... i think?!?!? lol

i have tried for several days everything i can think of, ...stripping down the ea to a minimum etc with no success. it's a bank hol coming up and i would love to start making some progress in working through the EA and move on to other things.

i'd therefore be very grateful for any advice, or best of all, if anyone has a fully working ea using this template, could it be uploaded so i can download and work through?

i'd be very very grateful.

many thanks in advance


Regards

chael

 

..just keeping it on the page.