mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-08-24 01:08:07 +00:00
v4
This commit is contained in:
@@ -33,7 +33,7 @@ class TestMetaTrader:
|
||||
res = await self.mt.last_error()
|
||||
assert isinstance(res, tuple)
|
||||
assert res[0] == 1
|
||||
assert res[1] == 'Success'
|
||||
assert res[1] == "Success"
|
||||
|
||||
async def test_version(self):
|
||||
res = await self.mt.version()
|
||||
@@ -111,13 +111,19 @@ class TestMetaTrader:
|
||||
assert res.shape[0] == 10
|
||||
|
||||
async def test_copy_ticks_from(self):
|
||||
res = await self.mt.copy_ticks_from(self.symbol, self.start, 10, self.mt.COPY_TICKS_ALL)
|
||||
res = await self.mt.copy_ticks_from(
|
||||
self.symbol, self.start, 10, self.mt.COPY_TICKS_ALL
|
||||
)
|
||||
assert res is not None
|
||||
assert res.shape[0] == 10
|
||||
|
||||
async def test_copy_ticks_range(self):
|
||||
res = await self.mt.copy_ticks_range(self.symbol, self.start, self.end, self.mt.COPY_TICKS_ALL)
|
||||
res2 = self.mt5.copy_ticks_range(self.symbol, self.start, self.end, self.mt5.COPY_TICKS_ALL)
|
||||
res = await self.mt.copy_ticks_range(
|
||||
self.symbol, self.start, self.end, self.mt.COPY_TICKS_ALL
|
||||
)
|
||||
res2 = self.mt5.copy_ticks_range(
|
||||
self.symbol, self.start, self.end, self.mt5.COPY_TICKS_ALL
|
||||
)
|
||||
assert res is not None
|
||||
assert res.shape[0] == res2.shape[0]
|
||||
|
||||
@@ -132,18 +138,20 @@ class TestMetaTrader:
|
||||
assert len(res) == 0
|
||||
|
||||
async def test_order_calc_margin(self, sell_order):
|
||||
price = sell_order['price']
|
||||
volume = sell_order['volume']
|
||||
type_ = sell_order['type']
|
||||
price = sell_order["price"]
|
||||
volume = sell_order["volume"]
|
||||
type_ = sell_order["type"]
|
||||
res = await self.mt.order_calc_margin(type_, self.symbol, volume, price)
|
||||
assert isinstance(res, float)
|
||||
|
||||
async def test_order_calc_profit(self, buy_order):
|
||||
volume = buy_order['volume']
|
||||
price_open = buy_order['price']
|
||||
price_close = buy_order['tp']
|
||||
type_ = buy_order['type']
|
||||
res = await self.mt.order_calc_profit(type_, self.symbol, volume, price_open, price_close)
|
||||
volume = buy_order["volume"]
|
||||
price_open = buy_order["price"]
|
||||
price_close = buy_order["tp"]
|
||||
type_ = buy_order["type"]
|
||||
res = await self.mt.order_calc_profit(
|
||||
type_, self.symbol, volume, price_open, price_close
|
||||
)
|
||||
assert isinstance(res, float)
|
||||
|
||||
async def test_order_check(self, buy_order):
|
||||
|
||||
Reference in New Issue
Block a user