stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Just made an IDE for MQL4
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=627
Page 21 of 32
Author:  alex_forex [ Sun Aug 19, 2012 1:14 pm ]
Post subject:  Re: Just made an IDE for MQL4

Awesome job w633 !! :o

Thanks for that ;)

Regards
Alex
Author:  f-trader [ Sun Sep 16, 2012 10:47 am ]
Post subject:  Re: Just made an IDE for MQL4

jjasper7 wrote:i am trying to include some files including a new one of small routines/snippets pulled out of the main ea (to reduce size), but do not understand how to make and use the symbolic link mentioned above. would someone please elaborate the process for me? i suspect a second problem might be coming up soon... one of my routines i am trying to add, will alert me with a specific sound, so those 'sounds' will also need to be called from the routine (meaning an #include in the #include). should the same kind of link definition probably work. i have Empty4 set up in c:\fx\fxcm (instead of the programs dir)
Symbolic links are not possible in WindowsXP.
There is a free program which helps to create junction links.
http://www.rekenwonder.com/linkmagic.htm

This works for me.
Author:  gaheitman [ Mon Oct 22, 2012 12:53 am ]
Post subject:  Re: Just made an IDE for MQL4

garyfritz wrote:OK, MetaEditor compiles it OK.
SciTE fails for both me and Steve.

Sounds like a SciTE-specific problem to me...
Man am I behind...

So, I hit this problem with the first indicator I compiled but instead of putting in a symbolic link, I changed the compile.bat file to switch to the Experts\ directory and then call the metalang.exe file from the same directory as terminal.exe.

The old code (other\compile.bat) was:

Code: Select all

 @echo off
 %2\other\metalang.exe %1
 if errorlevel 1 goto end
 %2\other\refreshcrapt4.exe
 
 :end
 exit %ERRORLEVEL%
New code is:

Code: Select all

 @echo off
 cd %2\experts
 %2\metalang.exe %1
 if errorlevel 1 goto end
 %2\other\refreshcrapt4.exe
 
 :end
 exit %ERRORLEVEL%
I'm running Windows XP (I know, I know... ;>) and copied the IDE into the terminal.exe directory to replace metaeditor, so YMMV.

George
Author:  gaheitman [ Mon Oct 22, 2012 8:34 am ]
Post subject:  Slight Changes

Unwilling to leave well enough alone, I made a couple of changes to my settings. First of all, I changed the search function to use the dialog box instead of the strip at the bottom of the screen. I'm old school that way. The settings to change are in SciTEGlobal.Properties under the [Search and Replace] section. Surprisingly enough, they are:

Code: Select all

find.use.strip=0
replace.use.strip=0
Secondly, I wanted to add some things in the context menu so I can use my mouse instead of learning key combos... You can add pretty much anything to the menu, I chose to make mine look like this:
IMG_35.gif
You can do this too, by adding the following lines to SciTEGlobal.Properties after the [Shortcuts] section:

Code: Select all

user.context.menu=||Help|IDM_HELP|Go/Compile|303|Find|210|\
Block Comment|IDM_BLOCK_COMMENT|\
Box Comment|IDM_BOX_COMMENT|\
Stream Comment|IDM_STREAM_COMMENT|||\
Bookmark|IDM_BOOKMARK_TOGGLE|   Next|IDM_BOOKMARK_NEXT|   Previous|IDM_BOOKMARK_PREV|   Clear All|IDM_BOOKMARK_CLEARALL|||\
Show Calltip|232|
I won't actually keep all three comment styles in there, that's more for an example. Now, to add a toolbar... ;)

George
Author:  dietcoke [ Mon Oct 22, 2012 10:00 am ]
Post subject:  Re: Just made an IDE for MQL4

Does anyone know how the autocomplete is configured? I'd like it to be able to see imported and included functions if possible.
Author:  w633 [ Tue Oct 23, 2012 3:59 am ]
Post subject:  Re: Just made an IDE for MQL4

dietcoke wrote:Does anyone know how the autocomplete is configured? I'd like it to be able to see imported and included functions if possible.
currently there's no easy way for that, it is incapable of dynamically parsing source code to spit out function info.

you'll have to add the functions statically by editing "api\mql.api".
Author:  gaheitman [ Tue Oct 23, 2012 7:28 am ]
Post subject:  Re: Just made an IDE for MQL4

w633 wrote:
dietcoke wrote:Does anyone know how the autocomplete is configured? I'd like it to be able to see imported and included functions if possible.
currently there's no easy way for that, it is incapable of dynamically parsing source code to spit out function info.

you'll have to add the functions statically by editing "api\mql.api".
Actually, the sidebar code does dynamically scan the source code to give you the list of functions that it displays.

From MultiBob:
IMG_37.gif
It would probably be possible to modify the lua code to create a secondary api file so you could see the calltips.

Autocomplete also presents you a list of keywords from your existing buffer when nothing matches your current typed text from the api file. For example, as you type "calc" you'll see the following:

"c"
IMG_38.gif
"ca"
IMG_39.gif
"cal" matches nothing, but once you type "calc"
IMG_40.gif
This example just showed functions being displayed, but it will show you variables as well.

BTW, I've added the rest of the reserved words to the api file, which is why I got so many choices to begin with.

I haven't mentioned this yet, but I'm loving this editor!
George
Author:  dietcoke [ Tue Oct 23, 2012 7:46 am ]
Post subject:  Re: Just made an IDE for MQL4

gaheitman wrote:
BTW, I've added the rest of the reserved words to the api file, which is why I got so many choices to begin with.

I haven't mentioned this yet, but I'm loving this editor!
George

George,

would you mind posting your mods?
Author:  SteveHopwood [ Tue Oct 23, 2012 8:01 am ]
Post subject:  Re: Just made an IDE for MQL4

gaheitman wrote:I haven't mentioned this yet, but I'm loving this editor!
George
It has revolutionised my coding life.

:D
Author:  gaheitman [ Tue Oct 23, 2012 9:41 am ]
Post subject:  Re: Just made an IDE for MQL4

dietcoke wrote:
gaheitman wrote:
BTW, I've added the rest of the reserved words to the api file, which is why I got so many choices to begin with.

I haven't mentioned this yet, but I'm loving this editor!
George

George,

would you mind posting your mods?
Certainly. First off, I have hacked together a way to create an api file from source using the existing sidebar functionality.

You need to tell SciTE to use a secondary mql.api file. I named it _mql.api and it is in the same directory as the first. To do this, modify mql.properties --

This:

Code: Select all

api.$(file.patterns.mql)=$(SciteDefaultHome)\api\mql.api
becomes this:

Code: Select all

api.$(file.patterns.mql)=$(SciteDefaultHome)\api\mql.api;$(SciteDefaultHome)\api\_mql.api
The attached Sidebar.lua (uploaded as sidebar.txt since the board doesn't allow .lua) file adds an item to the context menu of the Functions/Bookmarks pane to "Save api". When selecting this, it will basically write the contents of that pane to the _mql.api file. Unfortunately, SciTE doesn't immediately re-read api files, you have to switch to a different file type (in another buffer) and then switch back. Working on that....

Context menu:
IMG_41.gif
After running "Save api" on MultiBob, here's the Calltip (after the autocomplete, of course, since I had the case wrong :>)

Calltip from MultiBob:
IMG_42.gif
I also changed the file mask to be *.mq4 so the directory view is immediately useful (for mql programming, that is).

EDIT: Updated mql.txt to include all constants.

George
All times are UTC Page 21 of 32