Status changed from New to Waiting for information
Attachment EMAwithPSARM5V4.sq4 added
Attachment WFM Config.xml added
Hi,
Here are the requested files. I have tried other .sq4 that I made, and I realize that for this strategy in particular, for some reason, the Booleans used for Signals end up as parameters in the WFM, but not for the other strategies.
Since I'm here, I would like to add three other little bugs in the code generation for MT4 in the EA Wizard that cause compile errors and mismatched trade closing:
1) the DrawDownArrow and the DrawUpArrow cause a compile error, since the line added, sqDrawDownArrow(1), is missing the ";" at the end
2) the ConvertToPips function creates a few instances of code like this:
sqSetGlobalVariable(_ticket, "TrailingStop", sqStringHash("sqConvertToRealPips(OrderSymbol(), sqConvertToPips("Current", (TSCoef * sqATR(NULL,0, ATRPeriod, 1))))"));
Please note the double quotes around Current. Since we're already in a string, this causes a compile error, I have to manually modify these lines to replace double quotes with single quotes
3) the sqManageOrder function seems to be missing a condition, the line:
if(OrderMagicNumber() != magicNumber) {
should be:
if((OrderMagicNumber() != magicNumber) || (OrderSymbol() != Symbol())) {
, otherwise, when running the EA on multiple pairs in the same MT4 instance, open positions from pair one get closed when opening position on pair two. And maybe it would be a good idea to add a condition comparing the comment of the open trade, like it was in SQ3. This way there would be even less chance of one EA instance closing trades made by another EA instance.
Thank you very much for the support!
Mirc
Status changed from Waiting for information to Fixed
As for 3) this is intentional - your EA can place orders with multiple symbols. You should use unique Magic Number in every EA.