Download MetaTrader 5

[MQL5] If you do not use MetaEditor to code, which alternative editor do you use? - page 2

To add comments, please log in or register
Anthony Garot
552
Anthony Garot  
whroeder1:
. . . code folding

As I recall, this was the specific reason I sought editors outside MetaEditor.

Marco vd Heijden
Moderator
6514
Marco vd Heijden  

And here is Bluefish editor, this one is particular handy if you are working with embedded HTML for example to produce web content directly from MQL.

http://bluefish.openoffice.nl/index.html


Bluefish Editor : Home
  • bluefish.openoffice.nl
Bluefish 2.2.10 is a maintenance release. Various language files have been improved, most notably languages that include CSS. There are also various fixes for newer gtk versions and for gtk on wayland (which is now the default on Fedora Linux). A new feature in the 2.2.10 release is the possibility to import/export syntax color styles, included...
Carl Schreiber
Moderator
8356
Carl Schreiber  
I use Notepad++ too and beside what has already mentioned I am occasionally very happy with it as it has a plugin to translate and replace Russian comments in e.g. English, just with a few clicks.
Pierre Rougier
623
Pierre Rougier  
Fernando Carreiro:

I cannot speak for others, but I personally use both MetaEditor as well as Microsoft Visual Studio Code (free and open-source) with the MQL4/5 Syntax Highlight extension.



Do you compile in Visual Studio Code or outside with MetaEditor ?

Fernando Carreiro
3819
Fernando Carreiro  
Pierre Rougier: Do you compile in Visual Studio Code or outside with MetaEditor ?

I usually compile in MetaEditor for convenience, because I can just double-click on the warnings and errors and go directly to the offending lines.

However, you can also setup it up to compile from within VSCode, using MetaEditor's command line parameters and have the compilation log open up in VSCode automatically.

Compilation from the Command Line

A MetaEditor executable file can be used as the compiler when working with a source code in external editors. The compiler is started from the command line, specifying the path and name of the file you want to compile:

  • metaeditor.exe /compile:"<full path to the source file>"
  • metaeditor64.exe /compile:"<full path to the source file>"

Example

"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5"


Compilation log

Specify the additional /log key for more information about the compilation process. In this case, <source file name>.log compilation log file is created in the folder containing the source file.

Example

"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5" /log
Log file: C:\Program Files\TradingPlatform\MQL5\Script\myscript.log

aries
68
aries  

OMFG I love you. I thought that extention was just for MQL4 and left disappointed before rereading the description :))))

I was trying to switch to some other IDE for years lol, but with all the hassle it was always better to just grind teeth and use metaeditor.

THANK YOU SO MUCH!!!! :)) I'm happy now :)

Emma Schwatson
1667
Emma Schwatson  
Fernando Carreiro:

Yes, it also has "Code Folding", "Auto-complete/IntelliSense", "Code-snippets" as well as "Bracket matching", but I am not advocating VSCode over others, it is simply my own personal preference.

If you are interested, here is an overview of the features: Code Editing Features in VS Code


I'm coming over to VScode from sublime because there is no intellisence for c++... I'll have plenty of questions for you... but for starters how did you get the intellisence to work with MQL? I hacked it by mapping mq4,mq5,mqh files to the cpp intellisence, edited the include folder location to MQL\Include, and then disabled the cpp problem underlining. Is there a better way? 

Also, I'm slowly adding in the MQL built-in functions to the custom user snippets... do you already have these?

Any other tips?

Edit: I'm new to VSC, but so far VSC > Sublime > notepad++
Fernando Carreiro
3819
Fernando Carreiro  
nicholishen: I'm coming over to VScode from sublime because there is no intellisence for c++... I'll have plenty of questions for you... but for starters how did you get the intellisence to work with MQL? I hacked it by mapping mq4,mq5,mqh files to the cpp intellisence, edited the include folder location to MQL\Include, and then disabled the cpp problem underlining. Is there a better way? 

Also, I'm slowly adding in the MQL built-in functions to the custom user snippets... do you already have these?

Any other tips?

No need to hack it that way. Just install the MQL4/5 Syntax Highlight extension for which I provided a link on my post #1.

PS! Do a clean install of VSCode so that your hacked changes don't conflict with the extension functionality!

Emma Schwatson
1667
Emma Schwatson  
Fernando Carreiro:

No need to hack it that way. Just install the MQL4/5 Syntax Highlight extension for which I provided a link on my post #1.

PS! Do a clean install of VSCode so that your hacked changes don't conflict with the extension functionality!


Syntax highlighting is only highlighting, and yes I had it installed already. I'm actually referring to the intellisence features, and if you haven't enabled the cpp intellisence and mapped it to MQL files, it's going to blow your freaking mind! It was enough for me to say goodbye to sublime after like 5 seconds of demoing :-p 

 VsCode cpp intellisence


Save this in your user settings

{
    "files.associations": {
        "*.mqh":"cpp",
        "*.mq4":"cpp",
        "*.mq5":"cpp"
    },

    "editor.tabSize": 3,
    "[cpp]": {
      
   }
}


Install the c++ intellisence package

There will be a warning that pops up to configure your include folder... I run in portable mode so mine was easy... eg. C:\User\Dropbox\MT\MQL4\Include

C++ programming with Visual Studio Code
C++ programming with Visual Studio Code
  • 2016.04.14
  • code.visualstudio.com
C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development using VS Code on Windows, Linux, and macOS. The extension is still in preview and our focus is code editing, navigation, and debugging support for C and C++ code everywhere that VS Code runs. If you just want a...
Emma Schwatson
1667
Emma Schwatson  

BTW, this is how I configured the c_cppproperies.json file 

...
        {
            "name": "Win32",
            "includePath": [
                "${workspaceRoot}",
                "C:\\Users\\User\\Dropbox\\MT-TK\\MQL4\\Include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE"
            ],
            "intelliSenseMode": "msvc-x64",
            "browse": {
                "path": [
                    "${workspaceRoot}"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            }
        }
...
123
To add comments, please log in or register