Just made an IDE for MQL4

Post Reply
User avatar
alex_forex
Trader
Posts: 438
Joined: Tue Nov 15, 2011 5:46 pm
Location: F R A N C E

Re: Just made an IDE for MQL4

Post by alex_forex »

Awesome job w633 !! :o

Thanks for that ;)

Regards
Alex
f-trader
Trader
Posts: 27
Joined: Sat Feb 25, 2012 4:08 pm

Re: Just made an IDE for MQL4

Post by f-trader »

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.
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Just made an IDE for MQL4

Post by gaheitman »

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
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Slight Changes

Post by gaheitman »

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
You do not have the required permissions to view the files attached to this post.
dietcoke
Trader
Posts: 162
Joined: Tue Nov 15, 2011 9:59 pm

Re: Just made an IDE for MQL4

Post by dietcoke »

Does anyone know how the autocomplete is configured? I'd like it to be able to see imported and included functions if possible.
Image
w633
Trader
Posts: 82
Joined: Sat Mar 10, 2012 1:49 pm

Re: Just made an IDE for MQL4

Post by w633 »

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".
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Just made an IDE for MQL4

Post by gaheitman »

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
You do not have the required permissions to view the files attached to this post.
dietcoke
Trader
Posts: 162
Joined: Tue Nov 15, 2011 9:59 pm

Re: Just made an IDE for MQL4

Post by dietcoke »

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?
Image
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Just made an IDE for MQL4

Post by SteveHopwood »

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

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Just made an IDE for MQL4

Post by gaheitman »

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
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Coders Hangout”