Skip to content

Instantly share code, notes, and snippets.

@dennislwm
Last active January 27, 2020 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennislwm/8cdb82f63c8b29828a538f9c437c2e9a to your computer and use it in GitHub Desktop.
Save dennislwm/8cdb82f63c8b29828a538f9c437c2e9a to your computer and use it in GitHub Desktop.
MT4-Telegram-Bot-Recon

Prerequisite

  • MT4 Demo Account

Challenge

Create a function that returns a chain of history and partial orders from a single ticket number

TelegramRecon API Specifications

Create the backend for TelegramRecon EA. The frontend is TelegramReconClient EA.


Telegram Routes

Accounts

  • /account

Orders

  • /ordertotal
  • /ordertrade
  • /orderticket

History

  • /historytotal
  • /historyticket

Non-Broker

  • /help
  • /start

Get the source code for the routes file.


Controllers

Accounts

  • string BotAccount(void)

Example:

Number=9573606
Currency=USD
Balance=10000
Equity=10000
Margin=0
FreeMargin=10000
Profit=0

Orders

  • string BotOrdersTotal(bool noPending=true)

Example:

Total=0

  • string BotOrdersTrade(bool noPending=true)

Example:

Count=2
Ticket=36390021
Symbol=EURGBP
Type=1
Lots=0.06
OpenPrice=0.89103
CurPrice=0.89019
StopLoss=0.9035
TakeProfit=0
OpenTime=2019.10.03 04:41
CloseTime=1970.01.01 00:00
PrevTicket=0
Ticket=36440410
Symbol=NZDUSD
Type=0
Lots=0.06
OpenPrice=0.62508
CurPrice=0.63124
StopLoss=0.62350000000001
TakeProfit=0
OpenTime=2019.10.02 06:22
CloseTime=1970.01.01 00:00
PrevTicket=36345548

  • string BotOrdersTicket(int ticket, bool noPending=true)

Ticket=36440410
Symbol=NZDUSD
Type=0
Lots=0.06
OpenPrice=0.62508
CurPrice=0.63124
StopLoss=0.62350000000001
TakeProfit=0
OpenTime=2019.10.02 06:22
CloseTime=1970.01.01 00:00
PrevTicket=36345548

History

  • string BotOrdersHistoryTotal(bool noPending=true)

Example:

Total=0

  • string BotHistoryTicket(int ticket, bool noPending=true)

Ticket
Symbol
Type
Lots
OpenPrice
ClosePrice
StopLoss
TakeProfit
OpenTime
CloseTime

Get the source code for the controllers file.

Known Issues

  1. Multiple backends, ie. TelegramRecon EA, can be attached to the same Bot. This will cause confusion for the frontend when querying the Bot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment