You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-4
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
# The What
12
12
13
13
Tradingview-webhooks-bot (TVWB) is a small, Python-based framework that allows you to extend or implement your own logic
14
-
using data from [Tradingview's webhooks](https://www.tradingview.com/support/solutions/43000529348-about-webhooks/).
14
+
using data from [Tradingview's webhooks](https://www.tradingview.com/support/solutions/43000529348-about-webhooks/). TVWB is not a trading library, it's a framework for building your own trading logic.
15
15
16
16
# The How
17
17
@@ -20,8 +20,11 @@ TVWB uses [Flask](https://flask.palletsprojects.com/en/2.2.x/) to handle the web
20
20
21
21
# Quickstart
22
22
23
-
* Installation
24
-
* Serving the App
23
+
If you an experienced Python developer, you can skip the Installation and Serving the app Sections.
24
+
They cover installing with pip and serving a flask app.
*[Serving the App](https://github.com/robswc/tradingview-webhooks-bot/wiki/Hosting)
25
28
26
29
**Ensure you're in the `src` directory.**
27
30
@@ -67,4 +70,37 @@ class NewAction(Action):
67
70
68
71
```bash
69
72
python3 tvwb.py start
70
-
```
73
+
```
74
+
75
+
### Sending a webhook
76
+
77
+
Navigate to `http://localhost:5000`. Ensure you see the `WebhookReceived` Event. Click "details" to expand the event box.
78
+
Find the "Key" field and note the value. This is the key you will use to send a webhook to the app. Copy the JSON data below,
79
+
replacing "YOUR_KEY_HERE" with the key you copied.
80
+
81
+
```json
82
+
{
83
+
"key": "YOUR_KEY_HERE",
84
+
"message": "I'm a webhook!"
85
+
}
86
+
```
87
+
88
+
The `key` field is required, as it both authenticates the webhook and tells the app which event to fire. Besides that, you can
89
+
send any data you want. The data will be available to your action via the `validate_data()` method. (see above, editing action)
90
+
91
+
On tradingview, create a new webhook with the above JSON data and send it to `http://ipaddr:5000/webhook`. You should see the data from the webhook printed to the console.
92
+
93
+
### FAQs
94
+
95
+
#### So how do I actually trade?
96
+
97
+
To actually submit trades, you will have to use a library like [ccxt](https://github.com/ccxt/ccxt) for crypto currency. For other brokers, usually there are
98
+
SDKs or APIs available. The general workflow would look something like: webhook signal -> tvwb (use ccxt here) -> broker. Your trade submission would take place within the `run` method of a custom action.
99
+
100
+
#### The tvwb.py shell
101
+
102
+
You can use the `tvwb.py shell` command to open a python shell with the app context. This allows you to interact with the app without having to enter `python3 tvwb.py` every time.
103
+
104
+
#### How do I get more help?
105
+
106
+
At the moment, the wiki is under construction. However, you may still find some good info on there. For additional assistance you can DM me on [Twitter](https://twitter.com/robswc) or join the [Discord](https://discord.gg/wrjuSaZCFh). I will try my best to get back to you!
0 commit comments