Forex
Google
www.rentasignal.com Metatrader Signals Marketplace

Go Back   Forex Trading > Downloads > Tools and utilities

Notices


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 11-20-2005, 01:18 AM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Thumbs up MT4 Files Functions Replacement.

Hi folks,

A lot of people asked me and metaquotes forum about file handling functions.
I think MT4 have a lot of bugs in those functions.
1- They don't work in backtesting
2- They don't write outside "MetaTrader 4\experts\files" path.

Today I opened my Visual C++ and wrote a file handling dll for MT4, I hope you enjoy it, and its source code, and tell me your .

Setup:
1- Extract the "mtguru1.dll" to "MetaTrader 4\experts\libraries" path.
2- Extract "FilesDemo.mq4" to "MetaTrader 4\experts\indicators" path and compile it.
3- Extract "gFiles.mqh" to "MetaTrader 4\experts\include".
4- Load FilesDemo from your Indicators - don't forget to enbable "Allow DLL Import"
5- Enjoy.
Attached Files
File Type: zip mtguru1.zip (94.8 KB, 1483 views)
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm

Last edited by codersguru; 11-25-2005 at 01:26 PM. Reason: gFiles.mqh
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 11-21-2005, 12:22 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Unhappy Feedback

Hi folks,

Any feedback please ?
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 11-21-2005, 01:39 PM
Junior Member
 
Join Date: Oct 2005
Posts: 12
fivewhy is on a distinguished road
Well, I haven't tested it. But if it works..that is AWESOME!!
I checked out the demo .mq4 file, and it is so simple and elegant. Good work.

The only issue I have is what to do about new lines.
How do I use gFile to write a new line?

Last edited by fivewhy; 11-21-2005 at 01:58 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 11-21-2005, 02:09 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Thumbs up Thank!

Quote:
Originally Posted by fivewhy
Well, I haven't tested it. But if it works..that is AWESOME!!
I checked out the demo .mq4 file, and it is so simple and elegant. Good work.

The only issue I have is what to do about new lines.
How do I use gFile to write a new line?
fivewhy,

Thank you very much for your comment.
I think the new line printing issue needs some work from me, Thanks for the notice.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 11-21-2005, 08:48 PM
Beluck's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 201
Beluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud of
well done , but file functions (as well as many other) may be used directly from windows API dlls.

example of file copy function import:

#import "Kernel32.dll"
bool CopyFileA (string source_file, string destination_file, bool if_exist);

with DLLs you can do a lot of things, like SQL database access and so on.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 11-21-2005, 08:58 PM
Junior Member
 
Join Date: Oct 2005
Posts: 12
fivewhy is on a distinguished road
where can I find a list of all functions available in kernel32.dll (and other windows .dll's)?

Edit: Found it. See attched.
Attached Files
File Type: txt kernel32.txt (305.8 KB, 653 views)

Last edited by fivewhy; 11-21-2005 at 09:21 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 11-21-2005, 10:27 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Question That's right, but?

Quote:
Originally Posted by Beluck
well done , but file functions (as well as many other) may be used directly from windows API dlls.

example of file copy function import:

#import "Kernel32.dll"
bool CopyFileA (string source_file, string destination_file, bool if_exist);

with DLLs you can do a lot of things, like SQL database access and so on.
Beluck,
That's right , but could you give me .mql demo shows me how to use the kernel32 functions CreateFile, OpenFile,WriteFile and ReadFile in MQL4

Code:
HANDLE CreateFile(
  LPCTSTR lpFileName,
  DWORD dwDesiredAccess,
  DWORD dwShareMode,
  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  DWORD dwCreationDisposition,
  DWORD dwFlagsAndAttributes,
  HANDLE hTemplateFile
);

HFILE OpenFile(
  LPCSTR lpFileName,
  LPOFSTRUCT lpReOpenBuff,
  UINT uStyle
);

BOOL WriteFile(
  HANDLE hFile,
  LPCVOID lpBuffer,
  DWORD nNumberOfBytesToWrite,
  LPDWORD lpNumberOfBytesWritten,
  LPOVERLAPPED lpOverlapped
);

BOOL ReadFile(
  HANDLE hFile,
  LPVOID lpBuffer,
  DWORD nNumberOfBytesToRead,
  LPDWORD lpNumberOfBytesRead,
  LPOVERLAPPED lpOverlapped
);
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 11-25-2005, 10:21 AM
Junior Member
 
Join Date: Nov 2005
Posts: 5
sx ted is on a distinguished road
ted

alerts.mqh not part of mtguru1.zip, could not run FilesDemo? Thanking you in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #9 (permalink)  
Old 11-25-2005, 01:25 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
gFiles.mqh

Quote:
Originally Posted by sx ted
alerts.mqh not part of mtguru1.zip, could not run FilesDemo? Thanking you in advance.
sx ted,

I'm sorry, I meant "gFiles.mqh"

To run FilesDemo:

1- Extract the "mtguru1.dll" to "MetaTrader 4\experts\libraries" path.
2- Extract "FilesDemo.mq4" to "MetaTrader 4\experts\indicators" path and compile it.
3- Extract "gFiles.mqh" to "MetaTrader 4\experts\include".
4- Load FilesDemo from your Indicators - don't forget to enbable "Allow DLL Import"
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #10 (permalink)  
Old 11-25-2005, 03:07 PM
Junior Member
 
Join Date: Nov 2005
Posts: 5
sx ted is on a distinguished road
ted

CodersGuru, thank u super, have u got equivalent of FileTell()
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
awesome, metatrader kernel32.dll, MT4 FILES, mtguru1.dll, mtguru1.zip

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Functions intelligent_14 Questions 6 07-11-2006 08:37 PM
Unusual Functions intelligent_14 Questions 3 06-23-2006 11:20 PM
Appendix 2 - Trading functions codersguru Lessons 8 12-26-2005 01:46 PM
Lesson 7 - Functions codersguru Lessons 2 11-02-2005 03:32 PM


All times are GMT. The time now is 11:45 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.