Immediate reciept of commands from TradingView using WebHooks.

blog

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:

52.89.214.238
34.212.75.30
54.218.53.128
52.32.178.7

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:

##Begin_Strategy
Active=-1
StrategyName=TradingView
Comment=
LastEditDate=2019-10-06 16:28
SignalType=Telegram
ChannelName=WebHookTV
ChannelKey=
AcceptCommands=NO
SilentNoCharts=NO
ReportToTelegram=NO
ReportTradesToTelegram=YES
SoundAlert=NO
SoundKind=TurnOn
KeepAlert=60
EmulatorMode=NO
CoinsWhiteList=
CoinsBlackList=
MinVolume=0
MaxVolume=10000k
MinHourlyVolume=0
MaxHourlyVolume=1000k
PenaltyTime=300
Delta_3h_Min=0
Delta_3h_Max=100.00
Delta_24h_Min=0
Delta_24h_Max=100.00
Delta2_Type=1h
Delta2_Min=0
Delta2_Max=100.00
Delta_BTC_Min=-5.00000000
Delta_BTC_Max=5.000
Delta_BTC_24_Min=-10.00000000
Delta_BTC_24_Max=10.000
Delta_BTC_5m_Min=0
Delta_BTC_5m_Max=10.000
Delta_Market_Min=-5.00000000
Delta_Market_Max=10.000
Delta_Market_24_Min=-10.00000000
Delta_Market_24_Max=10.000
UseBV_SV_Filter=NO
BV_SV_FilterRatio=1.0000
NextDetectPenalty=30
GlobalFilterPenalty=0
MoonIntRiskLevel=2
MoonIntStopLevel=4
DeltaSwitch=0
PriceStepMin=0
PriceStepMax=10.000
AutoBuy=YES
MaxActiveOrders=10
MaxOrdersPerMarket=1
AutoCancelBuy=20
AutoCancelLowerBuy=11k
BuyType=Buy
OrderSize=0.001000
buyPrice=-1.00000000
Use30SecOldASK=YES
TlgUseBuyDipWords=NO
TlgBuyDipPrice=0
OrdersCount=1
BuyPriceStep=-1.50000000
OrderSizeStep=25.00
CancelBuyStep=0
JoinSellKey=0
SellPrice=4.000
PriceDownTimer=0
PriceDownDelay=10
PriceDownPercent=0.2000
PriceDownRelative=NO
PriceDownAllowedDrop=0.1000
UseScalpingMode=NO
UseSignalStops=NO
UseStopLoss=NO
StopLossEMA=0
StopLossDelay=0
StopLoss=-3.00000000
StopLossSpread=0.4000
AllowedDrop=-15.00000000
UseSecondStop=NO
TimeToSwitch2Stop=60
PriceToSwitch2Stop=0
SecondStopLoss=-3.00000000
UseStopLoss3=NO
TimeToSwitchStop3=60
PriceToSwitchStop3=-10.00000000
StopLoss3=-2.00000000
AllowedDrop3=-14.00000000
UseTrailing=NO
TrailingPercent=-1.00000000
TrailingSpread=0.1000
TrailingEMA=0
UseTakeProfit=NO
TakeProfit=1.0000
UseBV_SV_Stop=NO
BV_SV_Kind=TradesCount
BV_SV_TradesN=100
BV_SV_Ratio=0.7500
BV_SV_TakeProfit=-1.00000000
##End_Strategy#

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.

Notifications troubleshooting.

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.
3.
Check the settings in the Auto Buy tab.
4. Check if the message in TradingView is correct.

 

More Posts

Read also:

blog

September 13th Discount

Dear users! Celebrating Programmer’s Day, on Friday September 13th we are announcing a huge discount on the PRO version of MoonBot! You will get…
blog

Trusted Management

Moon Bot version 3.74 has got tools helping to use the bot for trusted management. How it works: when you trade with your bot…
blog

MoonBot for Binance

The main nuance when working with the Binance exchange by API is the limits for operations per minute. When the limits are exceeded, the…
blog

MoonTrader ICO

Dear Users! Our team intends to implement a large-scale project aimed to transform MoonBot into a professional trading terminal MoonTrader and a system of…
blog

Pump Helper tool

Release 3.43 brings new feature – the “Pump Helper” tool. Use it to play pumps where the coin is given in a picture (so…
blog

Competitions

We are happy to announce that we are starting the practice of regular competitions, in which users of the free version of moon bot…
blog

Our Signals Channel

Moon bot’s premium channel As the Moon Bot develops, it becomes more complex, new features and options settings are added. New users come with…
Menu