Initial commit
This commit is contained in:
69
src/main.py
Normal file
69
src/main.py
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
import time
|
||||||
|
import asyncio
|
||||||
|
|
||||||
|
from aiogram import Bot, Dispatcher
|
||||||
|
from aiogram.filters import Command
|
||||||
|
from aiogram.types import Message
|
||||||
|
from aiogram.client.default import DefaultBotProperties
|
||||||
|
from aiogram.enums import ParseMode
|
||||||
|
|
||||||
|
import credentials
|
||||||
|
import options
|
||||||
|
import strings
|
||||||
|
|
||||||
|
|
||||||
|
async def strategy(params):
|
||||||
|
print(params)
|
||||||
|
time.sleep(5)
|
||||||
|
print('cute')
|
||||||
|
|
||||||
|
|
||||||
|
# Telegram
|
||||||
|
|
||||||
|
# Входные поля для трейдинг-бота:
|
||||||
|
# Верхняя граница ордеров
|
||||||
|
# Нижняя граница ордеров
|
||||||
|
# Верхняя граница для брейка
|
||||||
|
# Нижняя граница для брейка
|
||||||
|
# Шаг сетки
|
||||||
|
# Дельта для тейка
|
||||||
|
# Дельта для стопа
|
||||||
|
# Размер позиции на каждом уровне
|
||||||
|
|
||||||
|
dp = Dispatcher()
|
||||||
|
bot = Bot(
|
||||||
|
token=credentials.bot_token,
|
||||||
|
default=DefaultBotProperties(parse_mode=ParseMode.HTML),
|
||||||
|
)
|
||||||
|
|
||||||
|
# async def sendMessage(text):
|
||||||
|
# await bot.send_message(text, )
|
||||||
|
|
||||||
|
@dp.message(Command("start"))
|
||||||
|
async def commandStart(message: Message) -> None:
|
||||||
|
# chat_id = message.from_user.id
|
||||||
|
await message.answer(strings.startCommand)
|
||||||
|
|
||||||
|
@dp.message(Command("stop"))
|
||||||
|
async def commandStop(message: Message) -> None:
|
||||||
|
await message.answer(strings.stopCommand + '\n' + strings.stopStrategy)
|
||||||
|
|
||||||
|
@dp.message(Command("help"))
|
||||||
|
async def commandHelp(message: Message) -> None:
|
||||||
|
await message.answer(strings.helpCommand)
|
||||||
|
|
||||||
|
@dp.message()
|
||||||
|
async def getParams(message: Message) -> None:
|
||||||
|
params = message.text
|
||||||
|
await message.answer(strings.gotParams + '\n' + strings.startStrategy)
|
||||||
|
await strategy(params)
|
||||||
|
|
||||||
|
|
||||||
|
# Main
|
||||||
|
|
||||||
|
async def main() -> None:
|
||||||
|
await dp.start_polling(bot)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print('Started bot!')
|
||||||
|
asyncio.run(main())
|
||||||
20
src/strings.py
Normal file
20
src/strings.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Strategy
|
||||||
|
|
||||||
|
startStrategy = "Стратегия запущена!"
|
||||||
|
|
||||||
|
stopStrategy = "Стратегия остановлена!"
|
||||||
|
|
||||||
|
|
||||||
|
# Telegram
|
||||||
|
|
||||||
|
startBot = "Бот запущен"
|
||||||
|
|
||||||
|
stopBot = "Бот остановлен"
|
||||||
|
|
||||||
|
startCommand = "Введите параметры:"
|
||||||
|
|
||||||
|
stopCommand = ""
|
||||||
|
|
||||||
|
helpCommand = "При старте стратегии требуется задать параметры в следующем формате:\nбудет расписано в последующих версиях"
|
||||||
|
|
||||||
|
gotParams = "Параметры заданы!"
|
||||||
Reference in New Issue
Block a user