1 //+------------------------------------------------------------------+
\r
2 //| ExportFunctions.mq4 |
\r
3 //| Copyright © 2005, MetaQuotes Software Corp. |
\r
4 //| http://www.metaquotes.net/ |
\r
5 //+------------------------------------------------------------------+
\r
7 #property copyright "Copyright © 2005, MetaQuotes Software Corp."
\r
8 #property link "http://www.metaquotes.net/"
\r
9 #include <sampledll.mqh>
\r
13 #define TIME_INDEX 0
\r
14 #define OPEN_INDEX 1
\r
16 #define HIGH_INDEX 3
\r
17 #define CLOSE_INDEX 4
\r
18 #define VOLUME_INDEX 5
\r
21 //+------------------------------------------------------------------+
\r
22 //| expert initialization function |
\r
23 //+------------------------------------------------------------------+
\r
28 double ret,some_value=10.5;
\r
31 string strarray[6]={ "first", "second", "third", "fourth", "fifth" };
\r
33 //---- simple dll-functions call
\r
34 cnt=GetIntValue(some_value);
\r
35 Print("Returned value is ",cnt);
\r
36 ret=GetDoubleValue(some_value);
\r
37 Print("Returned value is ",ret);
\r
38 sret=GetStringValue("some string");
\r
39 Print("Returned value is ",sret);
\r
42 cnt=SortStringArray(strarray,ArraySize(strarray));
\r
43 for(int i=0; i<cnt; i++) Print(i," - ",strarray[i]);
\r
44 cnt=ProcessStringArray(strarray,ArraySize(strarray));
\r
45 for(i=0; i<cnt; i++) Print(i," - ",strarray[i]);
\r
53 //+------------------------------------------------------------------+
\r
54 //| array functions call |
\r
55 //+------------------------------------------------------------------+
\r
59 double arr[5]={1.5, 2.6, 3.7, 4.8, 5.9 };
\r
62 //---- get first item from passed array
\r
63 price=GetArrayItemValue(arr,5,0);
\r
64 Print("Returned from arr[0] ",price);
\r
66 //---- change second item in the passed array
\r
67 if(SetArrayItemValue(arr,5,1,1234.5)==true)
\r
68 Print("Changed to ",arr[1]);
\r
70 //---- get current close
\r
71 ArrayCopyRates(rates);
\r
72 price=GetRatesItemValue(rates,Bars,0,CLOSE_INDEX);
\r
73 Print("Returned from Close ",price);
\r
78 //+------------------------------------------------------------------+
\r