avenwedde avatar

Pythonic Tutorial Part 12-16

avenwedde

Published: 27 Dec 2019 › Updated: 27 Dec 2019Pythonic Tutorial Part 12-16

Pythonic Tutorial Part 12-16

alt

Pythonic on GitHub
Pythonic Tutorial Part 1 - 6
Pythonic Tutorial Part 7 - 11

12. Send E-Mail Element

alt
Send E-Mail element in the element bar


alt
Send E-Mail Element

The E-Mail element allows you to send a mail programmatically. Keep in mind that your mail provider must support this (on gmail you need to enable Less secure app access. The E-Mail element is restricted to secure connections only.

You can specify the subject and message text based on the input. The input must be a dictionary (formatted like in the screenshot). Alternatively, the input can be used as the message text or as an attachment (string or binary).

13. REST Element

alt
REST element in the element bar


alt
REST Element

The REST element does a simple HTTP (GET) query. This element can only process JSON string which are then converted to a Python dictionary.

E.g. https://www.bitstamp.net/api/ticker/


alt
REST element with debug output enabled

14. Binance Scheduler

alt
Binance Scheduler element in the element bar


alt
Binance Scheduler Element

The Binance Scheduler ekement synchronizes subsequent elements with the time of the Binance server. Regardless of your local system time, the Binance Scheduler ensures that you get always the latest marked data.

Scenario:
,,Real" Binance time 15:52, time on your machine: 15:59. If you would have setup a standard scheduler to query marked data every full hour, you would query 53 minutes old data on 16:00. The latest marked data would be available on the Binance serve when on your local machine it is 16:07.

To prevent such a scenario, you should use the Binance Scheduler element to synchronize subsequent elements with the Binance time. You can also apply an offset (e.g. +10s) to ensure that the latest data is available on the server when you start your query.

15. Binance OHLC Query

alt
Binance OHLC Query element in the element bar


alt
Binance OHLC Query Element

With the Binance OHLC Query element you can download market data from the Binance server. You have to specify the currency pair and the desired interval. The output is a Pandas Dataframe with named columns (screenshot).

16. Binance Order Element

alt
Binance Order element in the element bar


alt
Binance Order Element

The Binance Order element lets you place an order. Use it only if you are 100% sure that your configuration will work as expected.

Prices, quantities and types can be configured depending of the order type. Input values have precedence. It is also worth to take a look on the source code of this element.

To create a Binance API key, follow these instructions.

Leave Pythonic Tutorial Part 12-16 to:

Written by

Read more #python posts


Best Posts From avenwedde

We have not curated any of avenwedde's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From avenwedde