MQL5ã¨MQL4ã¨ã®éã
MQL4ã¦ã¼ã¶åãã«ãMQL5ã®æ°ã«ãªãä»æ§ãã¡ã¢ãã¦ããã¾ãã
ã¤ãã³ãå¦ç
MQL4ã§ã¯ã init(), start(), deinit() ã®3ã¤ã§å ¨ã¦å¦çããã¦ãã¾ããããMQL5ããã¯ãindicator,EA,Scriptã§å¯¾å¿ããã¤ãã³ãå¦çé¢æ°ãå¤ããã¾ãã
ã¤ãã³ã | indicator | EA | Script | |
---|---|---|---|---|
åæå(Init) | OnInit | OnInit | - | |
çµäº(Deinit) | OnDeinit | OnDeinit | - | |
å®è¡(Start) | OnStart | |||
ä¾¡æ ¼æ´æ°(Calculate) | OnCalculate | |||
Tickæ´æ°(NewTick) | OnTick | |||
ã¿ã¤ãã¼(Timer) | OnTimer | |||
売買æç«(Trade) | OnTrade | |||
æ¿æ´æ°(BookEvent) | OnBookEvent | |||
ãã£ã¼ãã¤ãã³ã(ChartEvent) | OnChartEvent |
ã»Scriptã«ã¯ãOnInit, OnDeinit ãããã¾ããã
ã»indicator ã¯ãstart() ã®ä»£ããã«OnCalculate ãå¼ã°ãã¾ãã
ã»EA ã¯ãstart() ã®ä»£ããã«OnTick ãå¼ã°ãã¾ãã
ã»EA ã«ã¯ããã®ä»ã®ã¤ãã³ããã¦ããçãã
ã»ãã£ã¼ãã¤ãã³ãã¯ããã¼ãã¦ã³ãã¯ãªãã¯ããã©ãã°ããªãã¸ã§ã¯ãè¨å®çµäºãã«ã¹ã¿ã ã¤ãã³ãçã
ã»indicator ããã¯ããªãã¸ã§ã¯ãæä½é¢æ°(ObjectCreate ä»)ããã£ã¼ãæä½é¢æ°(ChartOpen ä»)ã¯å¼ã¹ãªãã
ãï¼ã»ã»ã»ããããï¼ï¼ï¼ï¼ï¼
indicator ãããªãã¸ã§ã¯ããä½ããªãã£ã¦ã©ãããã®ï¼ï¼ ï¼ ã¨ããæãã§ãã
scriptã§ã©ãã«ããã¦...ã¨ãããã¨ããããã
å®ç¾©æ¸ã¿å¤æ°
å®ç¾©æ¸ã¿å¤æ°ã¯ã_(ã¢ã³ãã¼ãã¼)ããå§ã¾ãã¾ããMQL4ã§ã¯é¢æ°ã ã£ããã®ãå¤æ°ã§ãå¾ããã¾ãã
MQL4 | MQL5 |
---|---|
Digits | _Digits |
Point | _Point |
Bars | Bars() |
GetLastError() | _LastError |
Period() | _Period |
Symbos() | _Symbol |
_StopFlag | |
_UninitReason |
ã»Open[ ], High[ ], Low[ ], Close[ ], Volume[ ] , Time[ ]ã¯å»æ¢ã
ã»èªåã§é
åãç¨æâCopyOpen() ã§é
åã«ã³ãã¼âãã®é
åãOpen[ ]ã®ä»£ããã«ä½¿ãã¾ãã
ã»CopyOpen() 以å¤ã«ã¯ãCopyRates, CopyHigh, CopyLow, CopyClose, CopyTickVolume, CopyReadVolume, CopySpreadçãããã¾ãã
ãã®ä»
ã»ã¤ã³ã¸ã±ã¼ã¿ã®ãããã¡æ°ã¯8ããç¡å¶éã«å¢ãã¾ããã
ã»ã¤ã³ã¸ã±ã¼ã¿ã®æç»ã¿ã¤ãã¯6種é¡ãã18種é¡ã«å¢ãã¾ããã
ã»ã¤ã³ã¸ã±ã¼ã¿ã®ãããã¡ã«ã¯doubleå以å¤ã®ãã¼ã¿ãå
¥ãããã¾ãã
ã»DLL ã®ãã¼ãã¯ãEAã®ãã¼ãç´å¾ã«è¡ããã¾ãã(å¾æ¥ã¯ãé¢æ°å¼åºãæã§ããã)
ã»è¨ç®åªå
é ä½ã¯C++ æºæ ã§ãã
ã»æé»ã®åãã£ã¹ãã«æ³¨æã§ãã
ã»ãã¼ã«ã«å¤æ°ã¯ãèªåçã«åæåããã¾ããã(å¾æ¥ã¯ãèªåã§ã¼ããå
¥ã£ã¦ãã¾ãã)
ã»ãã¼ã«ã«é
åã¯ãèªåçã«ç ´æ£ããã¾ããï¼å¾æ¥ã¯ãå¤ãæ®ã£ã¦ãã¾ããã)
ã»ããªã¥ã¼ã ã¯ãTickããªã¥ã¼ã ã¨ãªã¢ã«ããªã¥ã¼ã ã«åºå¥ããã¾ããã
ã»ã¹ãã¬ããã¯ããã¹ããªã«ã«ãã¼ã¿ã¨ãã¦è¨é²ããã¾ãã
ã»åæåãæ§é ä½ãã¯ã©ã¹ã使ãã¾ãã
ã»å¤æ°ã®åã¯ã大å¹
ã«å¢ãã¾ããã
ã»å¾æ¥1ã¤ã®é¢æ°åã ã£ããã®ãããã¼ã¿ã®åã«ãã£ã¦3ã¤ã®é¢æ°åã«åããã¾ããã
ããä¾ãã°ObjectSet â ObjectSetString, ObjectSetInteger, ObjectSetDoubleã
ã»ãã£ã¼ãèªä½ãæä½ããé¢æ°ãç¨æããã¾ããã
ã¨ããããããã®ãããããªã»ã»ã»ã