from datetime import datetime
#from MetaTrader5 import *
import MetaTrader5
from pytz import timezone
import time
import os
import types
for i in dir(MetaTrader5): print (i)
C
MT5CopyRatesFrom
MT5CopyRatesFromPos
MT5CopyRatesRange
MT5CopyTicksFrom
MT5CopyTicksRange
MT5Initialize
MT5Rate
MT5Shutdown
MT5TerminalInfo
MT5Tick
MT5Version
MT5WaitForTerminal
MT5_COPY_TICKS_ALL
MT5_COPY_TICKS_INFO
MT5_COPY_TICKS_TRADE
MT5_TICK_FLAG_ASK
MT5_TICK_FLAG_BID
MT5_TICK_FLAG_BUY
MT5_TICK_FLAG_LAST
MT5_TICK_FLAG_SELL
MT5_TICK_FLAG_VOLUME
MT5_TIMEFRAME_D1
MT5_TIMEFRAME_H1
MT5_TIMEFRAME_H12
MT5_TIMEFRAME_H2
MT5_TIMEFRAME_H3
MT5_TIMEFRAME_H4
MT5_TIMEFRAME_H6
MT5_TIMEFRAME_H8
MT5_TIMEFRAME_M1
MT5_TIMEFRAME_M10
MT5_TIMEFRAME_M12
MT5_TIMEFRAME_M15
MT5_TIMEFRAME_M2
MT5_TIMEFRAME_M20
MT5_TIMEFRAME_M3
MT5_TIMEFRAME_M30
MT5_TIMEFRAME_M4
MT5_TIMEFRAME_M5
MT5_TIMEFRAME_M6
MT5_TIMEFRAME_MON1
MT5_TIMEFRAME_W1
__builtins__
__cached__
__doc__
__file__
__loader__
__name__
__package__
__path__
__spec__
from datetime import datetime
from MetaTrader5 import *
from pytz import timezone
import time
import os
import types
print(dir(yourmodule))
NameError: name 'MetaTrader5' is not defined
# timeframes
MT5_TIMEFRAME_M1 = 1
MT5_TIMEFRAME_M2 = 2
MT5_TIMEFRAME_M3 = 3
MT5_TIMEFRAME_M4 = 4
MT5_TIMEFRAME_M5 = 5
MT5_TIMEFRAME_M6 = 6
MT5_TIMEFRAME_M10 = 10
MT5_TIMEFRAME_M12 = 12
MT5_TIMEFRAME_M15 = 15
MT5_TIMEFRAME_M20 = 20
MT5_TIMEFRAME_M30 = 30
MT5_TIMEFRAME_H1 = 1 | 0x4000
MT5_TIMEFRAME_H2 = 2 | 0x4000
MT5_TIMEFRAME_H4 = 4 | 0x4000
MT5_TIMEFRAME_H3 = 3 | 0x4000
MT5_TIMEFRAME_H6 = 6 | 0x4000
MT5_TIMEFRAME_H8 = 8 | 0x4000
MT5_TIMEFRAME_H12 = 12 | 0x4000
MT5_TIMEFRAME_D1 = 24 | 0x4000
MT5_TIMEFRAME_W1 = 1 | 0x8000
MT5_TIMEFRAME_MON1 = 1 | 0xC000
# tick copy flags
MT5_COPY_TICKS_ALL = -1
MT5_COPY_TICKS_INFO = 1
MT5_COPY_TICKS_TRADE = 2
# tick flags
MT5_TICK_FLAG_BID = 0x02
MT5_TICK_FLAG_ASK = 0x04
MT5_TICK_FLAG_LAST = 0x08
MT5_TICK_FLAG_VOLUME = 0x10
MT5_TICK_FLAG_BUY = 0x20
MT5_TICK_FLAG_SELL = 0x40
# import C methods to our module
from .C import *
private void Button1_Click(object sender, EventArgs e)
{
MT5Initialize();
MT5WaitForTerminal();
LogList.AppendText(MT5TerminalInfo());
LogList.AppendText(MT5Version());
MT5Shutdown();
}
System.EntryPointNotFoundException: "Не удается найти точку входа "MT5Initialize" в DLL "C:\Users\SERGEY\Desktop\EVO\bin\Debug\mt5.pyd"."
...
using System.Runtime.InteropServices;
namespace EVO
{
public partial class Form1 : Form
{
[DllImport("C:\\Users\\SERGEY\\Desktop\\EVO\\bin\\Debug\\mt5.pyd", CharSet = CharSet.Auto)]
static extern void MT5Initialize(string path = "None");
...
import inotify.adapters
Traceback (most recent call last):
File "C:/Users/SERGEY/Desktop/MT5TEST.py", line 5, in
import inotify.adapters
File "C:\Users\SERGEY\AppData\Local\Programs\Python\Python37-32\lib\site-packages\inotify\adapters.py", line 11, in
import inotify.calls
File "C:\Users\SERGEY\AppData\Local\Programs\Python\Python37-32\lib\site-packages\inotify\calls.py", line 4, in
import inotify.library
File "C:\Users\SERGEY\AppData\Local\Programs\Python\Python37-32\lib\site-packages\inotify\library.py", line 8, in
instance = ctypes.cdll.LoadLibrary(_FILEPATH)
File "C:\Users\SERGEY\AppData\Local\Programs\Python\Python37-32\lib\ctypes\__init__.py", line 442, in LoadLibrary
return self._dlltype(name)
File "C:\Users\SERGEY\AppData\Local\Programs\Python\Python37-32\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Не найден указанный модуль