MT4 EA - page 2

William Roeder  
Hey32 #: Here is the file sir. 

Still does not compile.

Hey32  
William Roeder #:

Still does not compile.

To compile you have to change the external string symbol because your broker might not have those symbol. Like change it to something that’s available to trade in your platform. Thanks
Fernando Carreiro  
Hey32 #: To compile you have to change the external string symbol because your broker might not have those symbol. Like change it to something that’s available to trade in your platform. Thanks

That has nothing to do with compilation. Compilation is irrespective of broker or account or anything else.

As it stands now, your file does not compile due to some strange quirks in your code. You have non-breaking spaces (character 0xa0) instead of normal spaces (character 0x20) in your code.

For some reason you seem to have copy/pasted via some HTML editor or something like that.

Please provide the file directly from where you have compiled it in MetaEditor successfully.

Fernando Carreiro  

However, even after fixing the non-breaking spaces in your file, it will still not compile due to many errors:

'demooo.mq4'    demooo.mq4      1       1
'Long' - undeclared identifier  demooo.mq4      224     7
'Long' - some operator expected demooo.mq4      224     7
expression has no effect        demooo.mq4      224     1
',' - unexpected token  demooo.mq4      225     66
'PERIOD_CURRENT' - some operator expected       demooo.mq4      225     68
',' - unexpected token  demooo.mq4      225     82
'(' - unbalanced left parenthesis       demooo.mq4      225     3
',' - unexpected token  demooo.mq4      225     82
',' - unexpected token  demooo.mq4      225     87
expression has no effect        demooo.mq4      225     84
',' - unexpected token  demooo.mq4      225     90
expression has no effect        demooo.mq4      225     89
',' - unexpected token  demooo.mq4      225     100
expression has no effect        demooo.mq4      225     92
',' - unexpected token  demooo.mq4      225     113
expression has no effect        demooo.mq4      225     102
')' - unexpected token  demooo.mq4      225     116
expression has no effect        demooo.mq4      225     115
'&&' - operand expected demooo.mq4      226     4
',' - unexpected token  demooo.mq4      226     69
'PERIOD_CURRENT' - some operator expected       demooo.mq4      226     71
',' - unexpected token  demooo.mq4      226     85
result of expression not used   demooo.mq4      226     64
',' - unexpected token  demooo.mq4      226     90
expression has no effect        demooo.mq4      226     87
',' - unexpected token  demooo.mq4      226     93
expression has no effect        demooo.mq4      226     92
',' - unexpected token  demooo.mq4      226     103
expression has no effect        demooo.mq4      226     95
',' - unexpected token  demooo.mq4      226     116
expression has no effect        demooo.mq4      226     105
')' - unexpected token  demooo.mq4      226     119
expression has no effect        demooo.mq4      226     118
'&&' - operand expected demooo.mq4      227     4
',' - unexpected token  demooo.mq4      227     69
'PERIOD_CURRENT' - some operator expected       demooo.mq4      227     71
',' - unexpected token  demooo.mq4      227     85
result of expression not used   demooo.mq4      227     64
',' - unexpected token  demooo.mq4      227     90
expression has no effect        demooo.mq4      227     87
',' - unexpected token  demooo.mq4      227     93
expression has no effect        demooo.mq4      227     92
',' - unexpected token  demooo.mq4      227     103
expression has no effect        demooo.mq4      227     95
',' - unexpected token  demooo.mq4      227     116
expression has no effect        demooo.mq4      227     105
')' - unexpected token  demooo.mq4      227     119
expression has no effect        demooo.mq4      227     118
'&&' - operand expected demooo.mq4      228     4
',' - unexpected token  demooo.mq4      228     69
'PERIOD_CURRENT' - some operator expected       demooo.mq4      228     71
',' - unexpected token  demooo.mq4      228     85
result of expression not used   demooo.mq4      228     64
',' - unexpected token  demooo.mq4      228     90
expression has no effect        demooo.mq4      228     87
',' - unexpected token  demooo.mq4      228     93
expression has no effect        demooo.mq4      228     92
',' - unexpected token  demooo.mq4      228     103
expression has no effect        demooo.mq4      228     95
',' - unexpected token  demooo.mq4      228     116
expression has no effect        demooo.mq4      228     105
')' - unexpected token  demooo.mq4      228     119
expression has no effect        demooo.mq4      228     118
'&&' - operand expected demooo.mq4      229     4
',' - unexpected token  demooo.mq4      229     69
'PERIOD_CURRENT' - some operator expected       demooo.mq4      229     71
',' - unexpected token  demooo.mq4      229     85
result of expression not used   demooo.mq4      229     64
',' - unexpected token  demooo.mq4      229     90
expression has no effect        demooo.mq4      229     87
',' - unexpected token  demooo.mq4      229     93
expression has no effect        demooo.mq4      229     92
',' - unexpected token  demooo.mq4      229     103
expression has no effect        demooo.mq4      229     95
',' - unexpected token  demooo.mq4      229     116
expression has no effect        demooo.mq4      229     105
')' - unexpected token  demooo.mq4      229     119
expression has no effect        demooo.mq4      229     118
'&&' - operand expected demooo.mq4      230     4
',' - unexpected token  demooo.mq4      230     71
'PERIOD_CURRENT' - some operator expected       demooo.mq4      230     73
',' - unexpected token  demooo.mq4      230     87
result of expression not used   demooo.mq4      230     65
',' - unexpected token  demooo.mq4      230     92
expression has no effect        demooo.mq4      230     89
',' - unexpected token  demooo.mq4      230     95
expression has no effect        demooo.mq4      230     94
',' - unexpected token  demooo.mq4      230     105
expression has no effect        demooo.mq4      230     97
',' - unexpected token  demooo.mq4      230     118
expression has no effect        demooo.mq4      230     107
')' - unexpected token  demooo.mq4      230     121
expression has no effect        demooo.mq4      230     120
')' - unexpected token  demooo.mq4      231     2
',' - unexpected token  demooo.mq4      238     66
'PERIOD_CURRENT' - some operator expected       demooo.mq4      238     68
',' - unexpected token  demooo.mq4      238     82
'(' - unbalanced left parenthesis       demooo.mq4      238     3
',' - unexpected token  demooo.mq4      238     82
',' - unexpected token  demooo.mq4      238     87
expression has no effect        demooo.mq4      238     84
',' - unexpected token  demooo.mq4      238     90
expression has no effect        demooo.mq4      238     89
',' - unexpected token  demooo.mq4      238     100
expression has no effect        demooo.mq4      238     92
',' - unexpected token  demooo.mq4      238     113
expression has no effect        demooo.mq4      238     102
')' - unexpected token  demooo.mq4      238     116
expression has no effect        demooo.mq4      238     115
'&&' - operand expected demooo.mq4      239     4
',' - unexpected token  demooo.mq4      239     69
'PERIOD_CURRENT' - some operator expected       demooo.mq4      239     71
',' - unexpected token  demooo.mq4      239     85
result of expression not used   demooo.mq4      239     64
',' - unexpected token  demooo.mq4      239     90
expression has no effect        demooo.mq4      239     87
',' - unexpected token  demooo.mq4      239     93
expression has no effect        demooo.mq4      239     92
',' - unexpected token  demooo.mq4      239     103
expression has no effect        demooo.mq4      239     95
',' - unexpected token  demooo.mq4      239     116
expression has no effect        demooo.mq4      239     105
')' - unexpected token  demooo.mq4      239     119
expression has no effect        demooo.mq4      239     118
'&&' - operand expected demooo.mq4      240     4
',' - unexpected token  demooo.mq4      240     69
'PERIOD_CURRENT' - some operator expected       demooo.mq4      240     71
',' - unexpected token  demooo.mq4      240     85
result of expression not used   demooo.mq4      240     64
',' - unexpected token  demooo.mq4      240     90
expression has no effect        demooo.mq4      240     87
',' - unexpected token  demooo.mq4      240     93
expression has no effect        demooo.mq4      240     92
',' - unexpected token  demooo.mq4      240     103
expression has no effect        demooo.mq4      240     95
',' - unexpected token  demooo.mq4      240     116
expression has no effect        demooo.mq4      240     105
')' - unexpected token  demooo.mq4      240     119
expression has no effect        demooo.mq4      240     118
'&&' - operand expected demooo.mq4      241     4
',' - unexpected token  demooo.mq4      241     69
'PERIOD_CURRENT' - some operator expected       demooo.mq4      241     71
',' - unexpected token  demooo.mq4      241     85
result of expression not used   demooo.mq4      241     64
',' - unexpected token  demooo.mq4      241     90
expression has no effect        demooo.mq4      241     87
',' - unexpected token  demooo.mq4      241     93
expression has no effect        demooo.mq4      241     92
',' - unexpected token  demooo.mq4      241     103
expression has no effect        demooo.mq4      241     95
',' - unexpected token  demooo.mq4      241     116
expression has no effect        demooo.mq4      241     105
')' - unexpected token  demooo.mq4      241     119
expression has no effect        demooo.mq4      241     118
'&&' - operand expected demooo.mq4      242     4
',' - unexpected token  demooo.mq4      242     69
'PERIOD_CURRENT' - some operator expected       demooo.mq4      242     71
',' - unexpected token  demooo.mq4      242     85
result of expression not used   demooo.mq4      242     64
expression has no effect        demooo.mq4      242     87
100 errors, 61 warnings         100     62
Hey32  
Hello sir any update yet ? 
Fernando Carreiro  
Hey32 #: Hello sir any update yet ? 

Reduce your code to a single symbol. It makes no sense to make an EA to trade multiple symbols and then just treat each one independently.

As it is now you are just copy/pasting code for each symbol. That is a very bad coding practice. There is no proper structure to the code.

If you want help, then reduce it to trading the current symbol only. You can easily then attach such an EA to each chart of a different symbol instead of one EA for multiple symbols.

Once you have reduced it to single current symbol, it will be easier to analyse it and find the problem.

EDIT: Also, on MT4 you can only back-test single-symbol EAs, not multi-symbol. That is one more reason to reduce your code to trading only the current symbol.