Spezifikation
I need an MT4 EA with source code that does the following:
Send an alert from TradingView through a webhook which will be received through Telegram API and then received by MT4 and opens a trade.
The input panel of the bot should have the following inputs:
- Bot Token from Telegram
- Channel ID from Telegram
- Channel Name from Telegram
The webhook will send a message alert like this:
buy_EURUSD_Risk%_SLinPoints_TPinPoints_TP%_Breakeven0/1
If anything equals 0 it is ignored.
The formula to calculate lot size is the following:
Lot Size = 1 /(SL in Points / (Capital x Risk%))
This would assume an example account of sending an alert, calculating lot size, setting a stop loss, and setting a take profit:
Balance $1000
buy_EURUSD_4_150_100_50_1
Lot size = 0.27
EURUSD: 1.10150
Stop Loss Set at: 1.10000
Take Profit Set at: 1.10250 to close 0.14
If breakeven is set to 1, after the first TP hit, SL should be moved to Entry Price +- 0.00005. (+ for buy trade, - for sell trade)
It should also have the ability to send a “close alert” message:
close_%. In which case it would close only a specified % of the current open position. A close alert should also move SL to Entry Price +- 0.00005.
If there is a Buy Trade open, and a Sell Trade Alert happens, it must completely close the Buy Trade, leave a small delay so it can read the new balance and then process to calculate Lot Size the same way. Same thing for the opposite situation.