2024-10-28 06:36:10 +01:00
|
|
|
import logging
|
2024-12-01 00:15:45 +01:00
|
|
|
import asyncio
|
2024-10-28 06:36:10 +01:00
|
|
|
|
|
|
|
|
from aiomql.lib.bot import Bot
|
2024-12-01 00:15:45 +01:00
|
|
|
from aiomql.contrib.strategies import FingerTrap, Chaos
|
2024-10-28 06:36:10 +01:00
|
|
|
from aiomql.contrib.symbols import ForexSymbol
|
|
|
|
|
|
|
|
|
|
|
2024-11-16 09:26:10 +01:00
|
|
|
def sample_bot():
|
2024-11-11 05:56:08 +01:00
|
|
|
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
2024-11-04 00:32:51 +01:00
|
|
|
syms = ["Volatility 75 Index", "Volatility 100 Index", "Volatility 50 Index"]
|
2024-10-28 06:36:10 +01:00
|
|
|
symbols = [ForexSymbol(name=sym) for sym in syms]
|
2024-12-01 00:15:45 +01:00
|
|
|
strategies = [Chaos(symbol=symbol) for symbol in symbols]
|
2024-10-28 06:36:10 +01:00
|
|
|
bot = Bot()
|
2024-12-01 00:15:45 +01:00
|
|
|
bot.executor.timeout = 10
|
|
|
|
|
bot.add_coroutine(coroutine=sleep_run)
|
2024-11-04 00:32:51 +01:00
|
|
|
bot.add_strategies(strategies=strategies)
|
2024-10-28 06:36:10 +01:00
|
|
|
bot.execute()
|
|
|
|
|
|
|
|
|
|
|
2024-12-01 00:15:45 +01:00
|
|
|
async def sleep_run():
|
|
|
|
|
while True:
|
|
|
|
|
print("Sleeping for 5 seconds")
|
|
|
|
|
await asyncio.sleep(5)
|
|
|
|
|
print("Hello World")
|
|
|
|
|
|
2024-11-16 09:26:10 +01:00
|
|
|
sample_bot()
|