Secondly,I create a mqh file "includetest1.mqh" to import test1.ex4
includetest1.mqh saved in include folder
codes as below
//+------------------------------------------------------------------+ //| includetest1.mq4 | //| Copyright ?2010, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright ?2010, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #import "test1.ex4" void DrawRectangle(string name); #import
Thirdly, I create an indictor to call the function void DrawRectangle(string name) defined in test1.ex4
//+------------------------------------------------------------------+ //| studycalltest1.mq4 | //| Copyright ?2010, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright ?2010, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_chart_window #include <includetest1.mqh> int init() { return(0); } int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- DrawRectangle("daily retangle"); //---- return(0); } //+------------------------------------------------------------------+
Don't install in program files... on Vista/Win7
WHRoeder:
Don't install in program files... on Vista/Win7
Don't install in program files... on Vista/Win7
XP
sergery:
2011.06.25 16:56:12 Cannot open file 'D:\Program Files\MetaTrader - Alpari UK\experts\test1.ex4' on the EURUSD,M15
Does the file actually exist?
2011.06.25 16:56:12 Cannot open file 'D:\Program Files\MetaTrader - Alpari UK\experts\test1.ex4' on the EURUSD,M15
WHRoeder:
Does the file actually exist?
Does the file actually exist?
Thanks you,WHRoeder.
I found the error, the below code should be added in test1.mq4
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I want to study call .ex4 file in library folder. but i failed, please help,thank you !
first I create a library file test1.mq4 as below
test1.ex4 in library folder