What are web-hooks?
Web-hooks allow sending POST-requests to specific URL-addresses every time a notification set by you in TradingView is triggered. This feature can be turned on when creating or editing the notifications in TradingView. Add the correct URL-address from the MoonBot settings and once a notification will be triggered, your command will be sent to MoonBot for execution.
This feature is only available for participants of the MoonTrader ICO.
Setting up the Client/Server.
To receive commands from TradingView, you should create a rule with a white-list of IP addresses for Windows Firewall.
1. Go to “Run” (or use the shortcut Win+R) type in wf.msc and hit ОК.
The “Windows Defender Firewall with Advanced Security” will appear on your screen. You can also get there by going to Start > Control Panel > System and Security > Windows Defender and Firewall > Advanced settings.
2. From the list on the left, chose “Inbound Rules”. To add a rule, click “New rule” from the panel on the right
3. After clicking on “New Rule” you should see the “New Inbound Rule Wizard” pop up. There, choose the “Custom” type and click “Next” at the bottom.
4. Leave everything by default in sections “Program” and “Protocol and Ports”, do not change anything there.
In the “Scope” section, set the “Which
remote IP addresses does this rule apply to?” to “These IP addresses” then click “Add …” on the right.
5. In the newly opened window, you must input the “IP addresses or subnet” then click OK.
You must put in all the following IP addresses one by one:
After adding the necessary values, click Next.
6. In the “Action” section, leave the default setting to “Allow the connection” and click Next.
7. The “Profile” section allows you to choose a profile, leave all the check-boxes marked and click Next.
8. On the final step you can set a “Name” for your rule and add an optional “Description”. You can now finalize the rule creation wizard by clicking Finish.
9. Now you will be able to see the newly created Rule in the “Inbound Rules” window.
Setting up MoonBot to receive WebHook commands.
Check the box Detect by WebHook in the Auto Buy tab .
Next to this check-box there is a URL address that should be used when setting up notifications in TradingView.
You should also change some settings for the Bot to read the tokens from the messages:
1. Check the box “Special filters”.
2. The “Keywords” check box is not mandatory but you can use it as a filter as well.
3. The check-box “Purchase tokens with Tag” is necessary for buying on messages in which the token is named ***BTC, for this you must type # before the token, for example: #ALGOBTC. Without this check-box, the Bot might purchase if the message will include just the token, for example: ALGO.
4. All other parameters are described on the website in the “Instructions” section and can be set according to your own preferences.
Let’s see some examples of messages and necessary settings.
first case, using keywords and tags:
second case, without keywords and tags:
There are various types of messages and settings, you can set this up based on your own preferences, the cases above are just for explanatory purposes.
We remind you that messages in the form of ALGOBTC the Bot will not buy, you must either delete ВТС or place the tag #, as described above.
Next you must set the Telegram strategy for interacting with regular signals in Telegram using regular messages or check the box AcceptCommands strategy to receive Remote commands from messages.
Below you will find an example strategy that you can create yourself by choosing SignalType: Telegram and ChannelName: WebHookTV
Or copy and paste into the Bot and then set the necessary parameters:
Setting up notifications in TradingView.
When creating notifications, check the box Web-hook URL in the Actions section and insert the URL copied from MoonBot, then edit the message to the required state.
The messages can contain Trusted Management commands that allow for more possibilities of controlling orders, to do this, check the box AcceptCommands in the strategy window. You’ll find more details about the types of commands here.
Check for the following message in the system log: WebHook signal: buy #ALGOLBTC <Key:>
If this message is not in the log:
1. Check the settings in the Firewall Rule.
2. Check if the check-box Detect by WebHook is marked in the Autobuy tab.
3. Check if the Web-hook URL used in TradingView, copied from the AutoBuy tab in the Bot is correct.
If you see this message in the log:
1. Check if the strategy settings are correct.
2. Check if the strategy and the Auto Detect are on.
Check the settings in the Auto Buy tab.
4. Check if the message in TradingView is correct.