Category Other  Published on 03/08/2023

Receive Alerts via Webhook Example

An update for this algorithm is currently pending moderation. Please revisit this page shortly to access the algorithm's latest version.
Description

Here's an example of how we can set up a bot act as a server to receive signals locally with Webhooks Notifications (i.e., TradingView, Zapier or others) 

You might have to set up ports, but I recommend using Ngrok to save you the trouble. (Link ngrok)

Once you've downloaded it you can type on cmd:

ngrok.exe http http://localhost:3000 --host-header=rewrite

This would give you a link you can use for the webhook, here's a sample message you could send using Postman:

curl --location '<your ngrok link>' \
--header 'Content-Type: text/plain; charset=utf-8' \
--data ‘EURUSD Buy Signal’

Then you could place an order based on this message.

You should have only one instance of this bot running.

Please let me know if you have questions.

Support my work on ko-fi to create more tools:
https://ko-fi.com/waxycodes




Waxy's avatar
Waxy

Joined on 12.05.2015

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: SampleServerForWebhooks.algo
  • Rating: 5
  • Installs: 574
  • Modified: 03/08/2023 21:41
Comments
Log in to add a comment.
ctrader.guru's avatar
ctrader.guru · 2 months ago

This cBot is even better https://www.reddit.com/r/cTraderGuru/comments/1g0etby/how_to_copy_by_alerts_signals_from_tradingview_to/

CW
Cwebhook · 11 months ago

ignore my previous comment, I missed the purpose of ngrok when first reading the description.

CW
Cwebhook · 11 months ago

If I try to set my Tradingview webhook url to http://localhost:3000 it says it can't be set to anythign other than port 80, is it possible to send data locally from Tradingview?

SU
Sunaj · 1 year ago

Thanks a lot for fast feedback on this - things are building now (might be worth putting the SDK requirements in description above?). Coffee is on me via https://ko-fi.com/waxycodes 👍

Waxy's avatar
Waxy · 1 year ago

I'm not sure, I think it sounds like you're using the default compiler in cTrader, would you please try with downloading .net 6 and setting it up as your default.

SU
Sunaj · 1 year ago

Hi Waxy, this looks like promising demo of a sample server to receive notifications with. However, after installing my attempts at building the cBot is met with following error message: 

"Build failed (1 error): Error CSI 566: Error reading resource 'SampleServerForwebh00ks.Properties_ Resources.resources' — 'Could not find the resource “System.Resources.NetStandard.SR.resources” among the resources "" embedded in the assembly "System.Resources.NetStandard.StrongName", nor among the resources in any satellite assemblies for the specified culture. Perhaps the resources were embedded with an incorrect name:'

No idea how to start debugging since I'm new to the platform, any hints to be had? Your time is appreciated.

Thanks, Sunaj