<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stephan A on Medium]]></title>
        <description><![CDATA[Stories by Stephan A on Medium]]></description>
        <link>https://medium.com/@s.avenwedde?source=rss-4f46d0d65dac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*AXa6UwK5NJlDuN8C</url>
            <title>Stories by Stephan A on Medium</title>
            <link>https://medium.com/@s.avenwedde?source=rss-4f46d0d65dac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 15:22:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@s.avenwedde/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Pythonic Tutorial 17–18]]></title>
            <link>https://medium.com/@s.avenwedde/pythonic-tutorial-17-18-a666f2242789?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/a666f2242789</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Fri, 27 Dec 2019 20:03:13 GMT</pubDate>
            <atom:updated>2019-12-27T20:03:13.993Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ue4y98Yc02H-r9aFwOoUmg.png" /></figure><p><a href="https://github.com/hANSIc99/Pythonic">Pythonic on GitHub</a></p><p><a href="https://medium.com/@s.avenwedde/pythonic-tutorial-part-1-6-fd00144788e3">Pythonic Tutorial Part 1–6</a></p><p><a href="https://medium.com/@s.avenwedde/pythonic-tutorial-part-7-11-444203836fbe">Pythonic Tutorial Part 7–11</a></p><p><a href="https://medium.com/@s.avenwedde/pythonic-tutorial-12-16-918fdab5a1d6">Pythonic Tutorial Part 12–16</a></p><h3>17. Support Vector Machine</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*OOEMfV2RkDxXEpJiG-eIWw.png" /><figcaption>SVM element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*kC7jQuM2nOVOmINTEjoZGQ.png" /><figcaption>Support Vektor Machine</figcaption></figure><p>The <em>Support Vector Machine</em> element let’s you do a binary classification of the input data. The input must be a tuple of sample data and (binary) features ([0,1,1, 0, …]). Based on the selected ratio, the data is broken up into training and evaluation data. The output of this element is a <a href="https://en.wikipedia.org/wiki/Contingency_table">contingency table</a>.</p><p>To improve the prediction, the input data should be centered and/or scaled.</p><p>You can define a file path (absolute or relative to $HOME) where the resulting model is saved (it’s a pickled <a href="https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html">Scikit Learn SVC</a>).</p><p><a href="https://scikit-learn.org/stable/modules/svm.html">Scikit Learn Support Vector Machin</a>e</p><h3>18. Support Vector Machine Prediction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/123/1*gAqN-hnz3Nn6dmiNz6-3tQ.png" /><figcaption>SVM Prediction element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*RXpdYQVqCuHeUZ110VQRNA.png" /><figcaption>Support Vector Machine Prediction</figcaption></figure><p>This element dies the prediction of input data based on a model. You can specify the absolute or relative (to $HOME) file path of the model. If you pass in a list, you can select that only the last value within this list gets predicted. This will reduce the CPU utilization if you want to pass in OHLC data regularly.</p><p>The output of this element is a Python list of <br>binary classification ([0, 0, 1, 0, 1, 1] — with just one element when <em>Predict only last value</em> is activated.)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a666f2242789" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pythonic Tutorial 12–16]]></title>
            <link>https://medium.com/@s.avenwedde/pythonic-tutorial-12-16-918fdab5a1d6?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/918fdab5a1d6</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Fri, 27 Dec 2019 19:56:02 GMT</pubDate>
            <atom:updated>2019-12-27T19:56:02.077Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ue4y98Yc02H-r9aFwOoUmg.png" /></figure><p><a href="https://github.com/hANSIc99/Pythonic">Pythonic on GitHub</a></p><p><a href="https://medium.com/@s.avenwedde/pythonic-tutorial-part-1-6-fd00144788e3">Pythonic Tutorial Part 1–6</a></p><p><a href="https://medium.com/@s.avenwedde/pythonic-tutorial-part-7-11-444203836fbe">Pythonic Tutorial Part 7–11</a></p><h3>12. Send E-Mail Element</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*rXHsaZvy4ebPMrqhHdAqdA.png" /><figcaption>Send E-Mail element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*qI0bhOy_2UXFhPVbOePVZg.png" /><figcaption>Send E-Mail Element</figcaption></figure><p>The <em>E-Mail</em> element allows you to send a mail programmatically. Keep in mind that you mail provider must support this (on gmail you need to enable <a href="https://support.google.com/accounts/answer/6010255?hl=en">Less secure app access</a>). The E-Mail element is restricted to secure connections only.</p><p>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).</p><h3>13. REST Element</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/119/1*3B6EcTKsxkHdUopVGWlvcg.png" /><figcaption>REST element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*6B0jYAs2-U2fE17lc-KhiQ.png" /><figcaption>REST Element</figcaption></figure><p>The REST element does a simple HTTP (GET) query. This element can only process JSON strings which are converted to a Python dictionary.</p><p>E.g. <a href="https://www.bitstamp.net/api/ticker/">https://www.bitstamp.net/api/ticker/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*c8FpgeqnJUjLuNtkuOIFfw.png" /><figcaption>REST element with debug output enabled</figcaption></figure><h3>14. Binance Scheduler</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/122/1*xGrjLXHG1XXfbjeDfGAZEA.png" /><figcaption>Binance Scheduler element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*W9Hbuz8qZbbJbXqa4MJU5Q.png" /><figcaption>Binance Scheduler Element</figcaption></figure><p>The <em>Binance Scheduler</em> element synchronized 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.</p><p>Scenario: <br>,,Real” Binance time 15:52, time on your machine: 15:59. If you would have setup a standard scheduler to query market data every full hour, you would query 53 minutes old data on 16:00. The latest marked data would be available on the Binance server when on your local machine it its 16:07.</p><p>To prevent such a scenario, you should use the Binance Scheduler element to synchronize subsequent element with the Binance time. You can also apply an offset (e.g. +10 s) e.g. to ensure that the latest data is available on the server when you start your query.</p><h3>15. Binance OHLC Query</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/121/1*ZwGQAORPDTj6ssoOBpm1pw.png" /><figcaption>Binance OHLC Query element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*-49DA-G2d5Sm2ZQu24twTg.png" /><figcaption>Binance OHLC Query Element</figcaption></figure><p>With the Binance OHLC Query element you can download market data from the Binance server. You have to specify the currency pair and the interval. The output is a <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html">Pandas Dataframe</a> with named columns (screenshot).</p><h3>16. Binance Order Element</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/126/1*0I_gmbiZU8fObr6TobOw5A.png" /><figcaption>Binance Order element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*sY0iHLmo69cQ9xFrj1yXOQ.png" /><figcaption>Binance Order Element</figcaption></figure><p>The Binance Order Element lets you place an order. Use it only if you are 100% sure that your configuration will work as expected.</p><p>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 <a href="https://github.com/hANSIc99/Pythonic/blob/master/src/Pythonic/elements/binance_order_func.py">source code</a> of this element.</p><p>To create an Binance API key, follow <a href="https://www.binance.com/en/support/articles/360002502072">those</a> instructions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=918fdab5a1d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pythonic Tutorial Part 7–11]]></title>
            <link>https://medium.com/@s.avenwedde/pythonic-tutorial-part-7-11-444203836fbe?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/444203836fbe</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Thu, 26 Dec 2019 18:45:07 GMT</pubDate>
            <atom:updated>2019-12-26T18:45:07.057Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ea9w8lHorBMc6CTL.png" /></figure><p><a href="https://github.com/hANSIc99/Pythonic">Pythonic on GitHub</a></p><p><a href="https://medium.com/@s.avenwedde/pythonic-tutorial-part-1-6-fd00144788e3">Pythonic Tutorial Part 1–6</a></p><h3>7. Branch Element</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/104/1*s96_GiNUbQrxIaaIFJ2acQ.png" /><figcaption>Branch element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*ySm_Yn0se-OcHSJseXm2ZA.png" /><figcaption>Branch Element</figcaption></figure><p>The <em>Branch</em> element allows you to split the execution path depending on the input. If it evaluates to <em>True, </em>the element below will be triggered. If it evaluates to <em>False</em>, the right side execution path will be triggered.</p><p>You can reverse this behavior by activating the checkbox ,,<em>Negate query”</em>.</p><h3>8. Return Element</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/118/1*3pFrpACuFbpr-5Ch6mRcYw.png" /><figcaption>Return element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*EOPIHzudB4yztY7ITjyfNQ.png" /><figcaption>Return Element</figcaption></figure><p>The <em>Return </em>element allows you to jump to an arbitrary element on one of the grids. The current input will be transferred. The <em>Return </em>element marks the end of the execution tree.</p><p><strong>Attention</strong>: The deletion of the element which was the former jump target of the <em>Return </em>element will cause an exception.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*KnCw7x9GMIBICK-J286YqQ.png" /></figure><h3>9. Process Branch Element</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*lpAFkbTrvURVBKE6LseJXQ.png" /><figcaption>Process Branch element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*DjxpNaG_hoMtJA0rxguG9w.png" /><figcaption>Process Branch Element</figcaption></figure><p>One of the benefits of Pythonic is the fact that every element executes in it’s own process. With the <em>Process Branch</em> element you simply start a parallel execution path which results in multiprocessing subsequent elements.</p><h3>10. Technical Analysis Element</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/115/1*EhDUSyN8bv4Nat5EO3GUMA.png" /><figcaption>TA element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*EhFXm7BficgxK3W47Y5bOg.png" /><figcaption>Technical Analysis Element</figcaption></figure><p>As the name suggests, the <em>Technical Analysis</em> element calculates trading indicators based on <a href="https://en.wikipedia.org/wiki/Open-high-low-close_chart">OHLC</a> input data. This element expects a <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html">Pandas Dataframe</a> with named columns [‘open’, ‘high’, ‘low’, ‘close’] as input. You can use the Binance OHLC query to fetch OHLC data in the correct format. The <em>Technical Analysis </em>element will extend a column to the input dataframe with the configured indicator.</p><p>You should also look up the sources on <a href="https://github.com/hANSIc99/Pythonic/blob/master/src/Pythonic/elements/basic_ta_func.py">GitHub </a>— the source code is quite simple and may give you a better understanding of how this element works.</p><h3>11. Stack Element</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/116/1*nmvJS8yC6GcU-mHzgo88KQ.png" /><figcaption>Stack element in the element bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*fvhltzQvunxC_IIyvrYdQg.png" /><figcaption>Stack Element</figcaption></figure><p>The <em>Stack </em>element enables you to save the output of a previous element persistent on the HDD. You have to select a file which the <em>Stack </em>element can operate on. You can decide whether the input gets inserted, appended or if it’s just use to trigger the stack for pulling data. You can also define a maximal stack size which causes an automatically deletion of stack elements if the element count exceeds.</p><p>You can operate on the same file from several <em>Stack </em>elements, but be careful: A parallel file access will cause an exception.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=444203836fbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pythonic Tutorial Part 1–6]]></title>
            <link>https://medium.com/@s.avenwedde/pythonic-tutorial-part-1-6-fd00144788e3?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd00144788e3</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Sun, 22 Dec 2019 12:00:39 GMT</pubDate>
            <atom:updated>2019-12-22T12:00:39.538Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ue4y98Yc02H-r9aFwOoUmg.png" /></figure><h3>Introduction</h3><p>In this series I will guide through the several functionalities of the graphical programming tool for Python —<a href="https://github.com/hANSIc99/Pythonic"> Pythonic</a>.</p><p>Intended as an easy to use open source programming framework for crypto trading bots, it’s well tested basic functionality can be applied to various other applications as well.</p><p>If your application requires smart logging capabilities, a reliable scheduling system, connectivity options and a scalable multiprocessing concept, then Pythonic is the right choice.</p><h3>1. Installation</h3><p>Pythonic is based on <a href="https://www.python.org/">Python 3</a> and is available over Pythons standard package manager <a href="https://pypi.org/project/Pythonic/">Pip</a>. Regardless of the operating system, you can install Pythonic with the following steps:</p><ol><li>Download and install <a href="https://www.python.org/downloads/">Python 3</a> (recommended ≥ 3.5)</li><li>Open a terminal <br>Windows: WinKey + R =&gt; cmd<br>Linux (Gnome shell): Strg + Alt + T</li><li>Run <strong><em>pip install Pythonic</em></strong></li></ol><p>The command will automatically collect all decencies of Pythonic. This process could take a while. If the installation was successful, you should see a message like this on the screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*QfOPo1sdtRf_AQegPXQpDA.png" /><figcaption>Pip installation successful (Pythonic v0.16)</figcaption></figure><p>4. Open a terminal and simply type <em>Pythonic</em></p><p>5. You should now recognize that a new windows has opened:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KfuYwh9byaxdS7rkIr7eww.png" /><figcaption>Pythonic 0.16 on Gnome 3</figcaption></figure><h3>2. Concept</h3><p>The programming area consist of 5 <em>grids </em>which can be populated with <em>elements</em>. The unit of 5 <em>grids </em>together is called a <em>workflow</em>. You can populate a grid with various <em>elements</em> by <strong>drag and drop</strong> them from the element bar to one of the placeholders (the ,,X”-elements at the end of the execution tree). You can choose elements from the fields <strong>Basic</strong>, <strong>Binance</strong>, <strong>Connectivity</strong> and <strong>Machine Learning.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*mWJR2nWG3mZ9gP5RTenwiA.png" /><figcaption>Basic elements</figcaption></figure><p><strong>Each element is a atomic program which is executed in its own process.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*IC4Fb4EtclDTZ-odEASjaw.png" /><figcaption>Two elements inside Grid 1</figcaption></figure><p>The execution flow is processed always from the <em>top to bottom</em> and from l<em>eft to right</em>. (Of course there is a jump-to element available)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*5KHbyGq4U97pSOgIFY7BoQ.png" /><figcaption>Execution flow.</figcaption></figure><p>Each element has an <strong>input </strong>and an <strong>output</strong>. When an element is triggered, the <strong>output </strong>of the former element is passed as the <strong>input </strong>to the current element. After execution, the result is passed as the <strong>output </strong>to a subsequent element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*9EqmuWL-pwwWKlAOyIaQiQ.png" /><figcaption>Input / Output parameter of each element</figcaption></figure><p>The input and output can be of any Python type. Some elements expect a certain input type to work properly.</p><p>If you forgot to place an element to your execution flow, you can drag and drop an already setup element to the parking place (only the last element of a execution tree can be dropped).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*UY-dq_9vxGaDoI-HR0wOPQ.png" /><figcaption>Parking space</figcaption></figure><p>From the parking place, the element can be placed somewhere else in one of the grids — the configuration isn’t lost!</p><h3>3. Toolbar</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/161/1*4jNg8Esl5lITOugXfXyw8g.png" /><figcaption>File IO</figcaption></figure><p>From left to right:</p><ul><li>New workflow</li><li>Open workflow</li><li>Save workflow</li><li>Save workflow as ..</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/154/1*gUPJ_sUVqgoPK__OmJCYLg.png" /><figcaption>Execution control</figcaption></figure><p>From left to right:</p><ul><li><strong><em>Start debug: </em></strong>Start the execution on all grids with a delay between the elements (adjustable under File-&gt; Settings, default: 500ms)</li><li><strong><em>Run</em></strong>: Start normal execution on all grids (without delay)</li><li><strong><em>Stop execution</em></strong> on all grids (becomes effective on the transition between elements)</li><li><strong><em>Kill running timers and child processes</em></strong>: As the name suggests, kill immediately all background processes such as timers etc…</li></ul><p>Also each element has its own toolbar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/62/1*4issi3hSKlBCxPWyeHJh-A.png" /><figcaption>Element toolbar</figcaption></figure><p>From top to bottom:</p><ul><li>Open element configuration</li><li>Enable debug output: After the element was processed successfully, open a new window which shows the output of the element and pause the execution till you click on the “<em>Ok</em>” button.</li><li>Delete the element (caution: configuration is then lost!)</li></ul><h3>4. Logging</h3><p>Pythonic has an easy to use logging feature: You can configure each element to create a log message when it is processed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/109/1*Ab3t081bsnlz1PKD2ohV1A.png" /><figcaption>Option for logging</figcaption></figure><p>The related log files are saved inside the users home directory under the following path scheme:</p><blockquote>~/Pythonic_&lt;Year&gt;/&lt;Month&gt;/log_&lt;Date&gt;.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*2gQqcL9ZC3HZctnC4fk_3w.png" /><figcaption>Log files inside users home directory</figcaption></figure><p>This scheme makes an easy recovery of log files possible, provides traceability and ensures that log files are not overwritten. When you start Pythonic, a new log file for the current day is created (if not already present). This happens also during the transition of two days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*Ruus7Azs6ndDCeoX6BgohQ.png" /><figcaption>Log file created by Pythonic</figcaption></figure><p>The implementation of how to create a log message within a Basic Operation element can be seen in <em>6. Basic Operation.</em></p><h3>5. Basic Scheduler</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*xcnMpONY-znyNJcP3xQnuA.png" /><figcaption>Basic Scheduler</figcaption></figure><p>The Basic Scheduler is always the first element in each grid. The output of this element is always <strong><em>t</em></strong>he Python type <strong><em>None</em></strong>. In the default settings, it does simply trigger the subsequent element without repetition.</p><p>If you need this element later in the execution tree, you can find it under Basic tab of the element bar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/118/1*hdXzhYAr5pzKLgOr5HAFyg.png" /><figcaption>Basic Scheduler</figcaption></figure><p>This element lets you define when and how often subsequent elements are triggered.</p><p>When the frame color after the initial execution stays yellow, a background timer is still active which will trigger according to the configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*QH0f3vKHAD18rLl-e4JY9w.png" /></figure><h3>6. Basic Operation</h3><p>The <em>Basic Operation </em>element lets you execute arbitrary Python code. <br>You can import every Python library which is currently installed in your system.</p><p>The following predefined variables are available:</p><ul><li>input…………..Access the input of the previously element</li><li>output…………Data which is passed to the subsequent element</li><li>log_txt…………User defined log message when <em>Log output</em> es enabled</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*Vwbmj4epyslm9CzchERe1w.png" /><figcaption>Basic Operation log message</figcaption></figure><p>Due to the fact that the standard code input lacks features like syntax highlighting and auto-completion, you can also setup your favorite editor by activating the checkbox ”<em>Use custom editor?”.</em></p><h4>Windows:</h4><ul><li>Visual Studio Code:<br><strong><em>&lt;Path-to-VS-Code-installation-directory&gt;\code.exe $FILENAME</em></strong></li><li>Notepad++<br><strong><em>&lt;Path-to-Notepad++-directory&gt;\notepad++.exe $FILENAME</em></strong></li></ul><p>Example:<br><em>D:”\Program Files (x86)”\”Microsoft VS Code”\code.exe $FILENAME</em></p><h4>Linux:</h4><ul><li>Vim: (GNOME-Terminal ≥ 3.27.1 required)<br><em>gnome-terminal — wait -e “vim $FILENAME”</em></li><li>Visual Studio Code:<br><em>code -w $FILENAME</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd00144788e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DIY: IoT energy logger]]></title>
            <link>https://medium.com/@s.avenwedde/diy-iot-energy-logger-669fbc80cc76?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/669fbc80cc76</guid>
            <category><![CDATA[node-red]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[energy]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[diy]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Mon, 19 Aug 2019 07:17:56 GMT</pubDate>
            <atom:updated>2019-08-19T07:17:56.132Z</atom:updated>
            <content:encoded><![CDATA[<p>Due to the fact that my home is complete heated by electricity (water- and domestic heating), I decided to monitor the energy consumption to get a feel for where to safe some money (here in Germany ~ <strong>0.28 €/kWh</strong> !)</p><p>In the past I worked for a company which sold energy monitoring systems and my task was to connect existing metering devices to the software part. Luckily, almost every metering device you can find has an s0-Interface — so as mine electricity meter at home (which is owned by the grid operator).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*azmYWmXprtT5Ca8aJIcqaA.jpeg" /><figcaption>Actaris ACE3000 Type 110 (s0-Connectorsbehind the marked cover)</figcaption></figure><h3>Design</h3><p>A reliable energy monitoring solution for private purpose should meet the following requirements:</p><ul><li>Logging of a s0-Signal</li><li>24/7-operation</li><li>Energy-saving operation</li><li>Visualization of consumption data</li><li>Long-term recording of consumption data</li><li>WLAN-capable</li><li>(affordable)</li></ul><p>I chose the Siemens SIMATIC IOT2020 as my hardware platform because it meets the requirements almost perfectly. Here are some facts:</p><ul><li>Industrial equipment <em>(&gt;&gt; 24/7-operation)</em></li><li>400 MHz Intel Quark x86-CPU <em>(&gt;&gt; energy saving operation)</em></li><li>Freely configureable Linux-based OS <em>(&gt;&gt; Visualization of consumption data)</em></li><li>512 MB Ram</li><li>Harddrive: Micro SD-card <em>(&gt;&gt; Long-term recording of consumption data)</em></li><li>USB-Connectors <em>(&gt;&gt; for Wifi-Dongle)</em></li><li>Extensible by an I/O-shield <em>(&gt;&gt; s0-Logging)</em></li><li>(Some) Inputs are ISR capable <em>(&gt;&gt; s0-Logging)</em></li><li>TTL UART for programming</li><li>Robust housing <em>(24/7-operation)</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*cuyIx6fzNghBsba9kGfbZg.jpeg" /><figcaption>Siemens SIMATIC 2040 (2040 -&gt; additional COM-ports) + I/O Shield</figcaption></figure><p>The Siemens SIMATIC IOT2020 comes without an SD card and therefore without an operating system. A current Yocto-based Linux OS-image and instructions how to flash the SD-card can be found in the related <a href="https://support.industry.siemens.com/tf/ww/en/posts/new-example-image-version-online/189090/?page=0&amp;pageSize=10">Siemens forum</a>.</p><p>Beside the hardware platform, you ale need some accessory. The following material list shows the minimal configuration of necessary components. I also placed a link to a distributor where you could buy this stuff (I don’t get payed for this!) and get a feeling about the costs.</p><h4>Material list</h4><ul><li><a href="https://de.rs-online.com/web/p/products/1244037">Siemens SIMATIC IOT2020 unit</a></li><li><a href="https://de.rs-online.com/web/p/products/1354133">Siemens I/O-Shield for SIMATIC IOT2000 series</a></li><li><a href="https://de.rs-online.com/web/p/micro-sd-karten/7582584/">Micro SD-Card (min. 2 GB)</a></li><li><a href="https://www.amazon.de/300Mbit-WLAN-Adapter-Hochleistungs-Antennen-Dual-Band/dp/B00LLIOT34">CSL 300MBIT USB-WLAN adapter</a></li><li><a href="https://de.rs-online.com/web/p/products/8153133">24 V power supply (TDK-Lambda DRB50–24–1)(2A)*</a></li><li><a href="https://de.rs-online.com/web/p/din-schienenklemmen-ohne-sicherung/0425190/">5 terminal blocks (Weidmueller WDU 2.5)</a></li><li><a href="https://de.rs-online.com/web/p/din-schienenklemmen-zubehor/0202574/">2x terminal cross-connecting brideges (Weidmueller WQV)</a></li><li><a href="https://de.rs-online.com/web/p/din-schienen/2835729/">DIN rail (~ 300 mm)</a></li><li><a href="https://de.rs-online.com/web/p/widerstande-durchsteckmontage/2142673/">220 Ω / 3 W resistor</a></li><li>Some wiring</li></ul><p>* The SIMATIC IOT 2020 has a maximum current of 1.4 A. For the s0-current we need additional 0.1 A (24 V / 220 Ω). I already owned this power supply: You could also use a cheaper one with less power.</p><p>First, lets take a look on the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LFshGlyS2blkY8rczJvgrg.jpeg" /><figcaption>Mounted &amp; hooked up energy logger</figcaption></figure><p>Unfortunately, I didn’t had enough space at the rear wall of the cabinet, therefore the DIN rail with the mounted parts lies on the ground.</p><p>The s0-interfaces is wired as shown below: The s0-interface is a current interface: When the electricity meter triggers, a current of 0.1 A starts flowing between<strong> s0+</strong> and <strong>s0-</strong>. On <strong>DI0</strong>, the voltage rises up to 24 V and triggers an interrupt. When the electricity meter disconnects <strong>s0+ </strong>and <strong>s0-</strong>, <strong>DI0</strong> is grounded over the resistor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*CBFyF5Yz15bo4oqdImzwKQ.png" /><figcaption>Wiring diagram</figcaption></figure><p>The whole procedure happens 1000 times per kWh (depending on the electricity meter).</p><p>I made a C-program which registered an interrupt service routine on the DI0 input which counts upwards in the memory. Once a minute, the values from memory are written to a SQLite database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*0eFj5mAhFiyKcI_yjucX0g.png" /><figcaption>Architecture</figcaption></figure><p>The data is visualized using Node-RED: Over a Web-GUI, several overviews like the daily consumption dashboard below can be accessed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMJqJ93DUj3q50YHt87sYw.png" /><figcaption>Node-RED based GUI (shown: daily overview)</figcaption></figure><p>For the daily overview, I calculate the hourly costs based on the consumption data (big bar chart). On the top left you can see the actual power, below is the daily consumption (energy and costs).</p><p>You can see two peaks here:</p><ul><li>9.00–10.00 Daddy took a shower</li><li>19.00–20.00 Children took a bath</li></ul><h3>Conclusion</h3><p>The whole system is now running for one year at my home — free of errors with 100% up time.</p><p>Beside of the use as energy logger, this hardware setup is also suitable for many other use cases. Especially the USB ports makes this piece of hardware universal applicable.</p><p>The free configurable Linux systems is nothing for beginners: You have to configure the whole system from the command line — there is no GUI. When this is no obstacle for you, you get a reliable and flexible system with the ability to link interrupt service routines to the I/O level.</p><p>Also important to note is that the I/O shield runs on standard control voltage (24 V) which grants you the ability to extend the functionality with the whole range of standardized components (relays, sensors, actors, …).</p><p>The CE conform housing (even with the applied I/O shield) clarifies that this is not a toy or development board — together with the right accessories it will run for decades.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=669fbc80cc76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Email your own IP address with Pythonic]]></title>
            <link>https://medium.com/@s.avenwedde/email-your-own-ip-address-with-pythonic-5cd5be7280f3?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cd5be7280f3</guid>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Thu, 20 Jun 2019 19:18:29 GMT</pubDate>
            <atom:updated>2019-06-20T19:18:29.056Z</atom:updated>
            <content:encoded><![CDATA[<p>In Germany, it is usual that your internet provider changes your IP-address every 24 hours. That’s because your internet provider want you to subscribe to a more expensive tariff if you want a static IP-address. I’m quite sure that a similar model can be found in other countries too.</p><p>Knowing your IP address at home when you’re on the road can be very useful when you want to access your <strong>home-server</strong>, <strong>NAS</strong> or any kind of <strong>IoT</strong> device which is connected to your local (W)LAN.</p><p>In this tutorial I will show you how to set up <a href="https://github.com/hANSIc99/Pythonic">Pythonic</a> to get get an automated E-Mail when your internet provider has changed your IP-address.</p><p>To get the IP address that your DSL router is currently assigned to, we use the service of <a href="https://www.ipify.org/">ipify</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*vpEU7VrXGiCPWD2mJn9ArQ.png" /><figcaption><a href="https://www.ipify.org/">ipify.org</a></figcaption></figure><p>We will use the IPv4 REST query. When you open the address in your browser:</p><blockquote><a href="https://api.ipify.org/?format=json">https://api.ipify.org?format=json</a></blockquote><p>You will receive a string in <a href="https://json.org/">JSON</a> format:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*_nJclDSc7BBouTpWrf30_Q.png" /><figcaption>Firefox Quantum 64.0</figcaption></figure><p>The output tells me that my DSL router is available at<em> 217.247.158.10</em> from the internet.</p><p>Now we setup <a href="https://github.com/hANSIc99/Pythonic">Pythonic</a> to do the same query automatically:</p><p>Place a HTML (GET) element right after the starting timer element and copy the ipify URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*alE76DsqdivmgvoH0ZryPg.png" /><figcaption>Step 1: Call ipify API within Pythonic</figcaption></figure><p>We want to compare the currently received IP-address with an address which we received earlier. Therefore, we use the stack element to save data persistent on the hard-drive. The maximum number of list-elements in this case is 2, because we only want to compare 2 IP-addresses with each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*DsQ-CISPexwfUTUK_7KlSw.png" /><figcaption>Step 2: Configuring the Stack element</figcaption></figure><p>After executing in quick succession you can see, that the stack will fill with two dict-elements containing the same IP-address after the keyword <em>ip</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*5VlTikbQIFmnJXZhoztRHA.png" /><figcaption>Step 3: Checking the stack element</figcaption></figure><p>Because we pass the whole stack to the subsequent element <br>(see step 2: <em>All out</em>), we are able to compare the current IP address (which is at position 0, because we selected <em>insert</em> at step 2) with the old IP-address, which is at position 1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*xH9-I0BreegmpgTVx-ajJQ.png" /><figcaption>Step 4: comparing IP-addresses</figcaption></figure><p>We compare the current IP-address with the old one. In the case they are equal, we output an empty string, if they are not equal, we output the current IP-address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*ZLeCt4rLNwMRPNa2HyTSjw.png" /><figcaption>Step 5: Branch configuration</figcaption></figure><p>Now we can add a branch element and connect an E-Mail element to the <em>Yes</em>-branch of it. When the incoming string is not equal to an empty one, then follow the <em>Yes</em>-branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*enGUV3xA19S6M66eOWYuXQ.png" /><figcaption>Step 6: Configuring the E-Mail</figcaption></figure><p>With the raw IP-Address text as input, we configure the E-Mail element to use the the address after the self defined text.</p><p>The E-Mail now will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*CaMEAHYY1rw-pHjgNW7Duw.png" /><figcaption>E-Mail by Pythonic</figcaption></figure><p>In the final step, we configure the very first element in terms of the interval in which the entire code is executed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*k1ky3hwqZ8jfIKzdqFA5Pg.png" /><figcaption>Step 7: Configuring the scheduler</figcaption></figure><p>In my opinion, once an hour is sufficient. I would not recommend querying in a high frequence (like 1/s), maybe your IP-address is then getting banned from the service.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cd5be7280f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Twin Cam 88 — Nockenwellenlager + hydraulische Steuerkettenspannder]]></title>
            <link>https://medium.com/@s.avenwedde/twin-cam-88-nockenwellenlager-hydraulische-steuerkettenspannder-141e2b659d55?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/141e2b659d55</guid>
            <category><![CDATA[harley-davidson]]></category>
            <category><![CDATA[motorcycle]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Mon, 29 Apr 2019 10:54:58 GMT</pubDate>
            <atom:updated>2019-04-29T10:54:58.866Z</atom:updated>
            <content:encoded><![CDATA[<h3>Twin Cam 88 — Nockenwellenlager + hydraulische Steuerkettenspannder</h3><p>Bei den ersten Baureihen des Twin Cam Motors mit 88 Cubic Inch ist es leider keine Seltenheit, dass die inneren Nockenwellenlager sowie die mit Federkraft arbeitenden Steuerkettenspanner frühzeitig verschleißen.</p><p>Da beide Schwachstellen leicht einen enormen Motorschaden nach sich ziehen können, habe ich mich dazu entschlossen das Thema bei meiner Road King (Baujahr 2001) bei Kilometerstand 37.000 vorsorglich anzugehen.</p><p>Harley Davidson hat sich der Problematik mit dem mechanischen Steuerkettenspannern bereits angenommen und bei nachfolgenden Modellen hydraulische Steuerkettenspanner verbaut. Diese haben den Vorteil, dass die Kraft, die der Kettenspanner auf die Steuerkette ausübt, vom Öldruck und damit von der Motordrehzahl abhängt.</p><p>Als Nachrüst Lösung für die frühen Twin Cam Motoren gibt es ein Upgrade Kit von Screamin’ Eagle.</p><p>Das Kit besteht aus einer neuen Nockenwellen-Halteplatte, hydraulischen Steuerkettenspannern und einer leistungsfähigeren Ölpumpe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*abylMD_L0AaOG3rld3lHFA.jpeg" /><figcaption>Screamin’ Eagle Upgrade Kit</figcaption></figure><p>Außerdem werde ich die inneren Nockenwellenlager durch verstärkte Varianten ersetzen.</p><p>Folgende Arbeiten werden durchgeführt:</p><ul><li>Erneuerung aller Dichtungen und O-Ringe (zwingend Erforderlich!)<br>-&gt; Genuine James Gaskets Camshaft Twin Cam</li><li>Austausch der mechanischen Steuerkettenspanner gegen hydraulische <br>(wechsel der Nockenwellen-Halteplatte)</li><li>Austausch der Ölpumpe</li><li>Austausch Nockenwellen-Innenlager durch verstärkte Lager (Torrington)</li><li>Aufwand: 1 Arbeitstag</li></ul><p>Für die geplanten Arbeiten ist es ausreichend, wenn die Maschine auf dem Seitenständer steht.</p><p>Wer schon etwas Schraubererfahrung bei Arbeiten am Motor hat kann die aufgeführten arbeiten selbst übernehmen. <strong>Anfängern rate ich dringlichst davon ab: Macht Ihr einen Fehler beim zusammenbau ist die Wahrscheinlichkeit enorm hoch das Ihr euren Motor komplett zerstört.</strong></p><h3>Schritt 1: Öl ablassen</h3><p>Wie bei allen Arbeiten an den Innereien des Motors muss das Öl erst einmal abgelassen werden. Nachdem der Motor ordentlich warm warm gefahren wurde, Öltank-Stutzen entfernen (damit das Öl besser ausläuft) und Ölablassschraube herausdrehen.</p><p>Vorher natürlich ein geeignetes Gefäß unter dem Motor stellen. Die Ölmenge beträgt ca 4,3 Liter.</p><h3>Schritt 2: Abbau der Auspuffanlage</h3><p>Eigentlich ist es ausreichend, den Krümmer des vorderen Zylinder abzubauen da dieser bei meiner 2001er Road King den Zugang zu dem Nockenwellengehäuse verhindert. Da dieser sich aber nicht alleine demontieren lässt, musste ich zusätzlich die Auspufftöpfe abnehmen und den Krümmer des hinteren Zylinders lösen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bGNEgBIPXoJRkjAGRVLh4A.jpeg" /><figcaption>Twin Cam 88 mit geöffnetem Nockenwellengehäuse</figcaption></figure><h3>Schritt 3: Tank lösen</h3><p>Der Tank besitzt einen Verbindungsschlauch am vorderen Ende um die beiden Tankhälften miteinander zu verbinden. Der Verbindungsschlauch ist unter der oberen Rahmenstrebe durchgeführt, daher lässt sich der Tank nicht komplett demontieren ohne vorher den Verbindungsschlauch zu entfernen. Will man den Tank trotzdem komplette herunter nehmen, muss der komplette Sprit abgelassen werden.</p><p>Für die geplanten arbeiten ist es aber ausreichend, den Tank zu lösen und ihn ein wenig anzuheben sodass sich die Schrauben des Ventildeckels lösen lassen.</p><p>Nachdem der Tank gelöst wurde, konnte ich einfach eine Dose zwischen Tank und Rahmen schieben. Sieht zwar nicht professionell aus, erfüllt aber seinen Zweck.</p><p>Vorher nicht vergessen den Benzinschlauch zu lösen (Schnellkupplungen auf der linken Tankseite).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3oQQ_RmpW3Ei0IYplMKr8w.jpeg" /><figcaption>Anheben des Tanks</figcaption></figure><h3>Schritt 3: Ventildeckel und Kipphebel demontieren</h3><p>Zu beginn hatte ich versucht die Nockenwellen wieder einzubauen ohne die Kipphebel + Stößelstangen + Hydrostößel zu demontieren. Da der Wiedereinbau der Nockenwellen so aber praktisch unmöglich ist, werden diese Teile des des Ventiltriebs am besten an dieser Stelle entfernt.</p><p>Die Kipphebel sollten dann entfernt werden, wenn Ein- und Auslassventil geschlossen sind und somit die Kipphebel nicht belastet werden (z.B. beim Kompressionstakt). Um die Kurbelwelle in die richtige Position zu drehen, müssen die Zündkerzen entfernt worden sein und der Leerlauf eingelegt sein. Die Kurbelwelle lässt sich dann bei schon geöffneten Nockenwellengehäuse am unteren Zahnrad direkt drehen.</p><p>Das öffnen und schließen der Ventile kann an der Position der Stößelstangen oben am Zylinderkopf beobachtet werden.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gQKsKxKOsRaUS_bNb4oG7Q.jpeg" /><figcaption>Abmontieren der Kipphebel</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NbLjOpeyyUQfnHCbPGck9A.jpeg" /><figcaption>Zylinderkopf Twin Cam 88</figcaption></figure><p>Die Funktion des Membran-Dingens in der Mitte des Kipphebelblocks erschließt sich mir zwar nicht ganz, nichtsdestotrotz wird dieses Teil auch erneuert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tfZcnjYCp6IZPSC9tC6iKg.jpeg" /><figcaption>Membran Zylinderkopf Twin Cam 88</figcaption></figure><p>Und so sieht es im Neuzustand aus:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EXZSvCZAeM6RsyP3rGjkCQ.jpeg" /></figure><h3>Schritt 4: Stößelstangen demontieren</h3><p>Um die Stößelstangen herauszunehmen, müssen zunächst die Stößelstangen-Abdeckungen entfernt werden. In vielen YouTube Videos / Anleitungen die sich im Internet finden ist zu sehen, dass es dafür ein Spezialwerkzeug von Harley gibt.</p><p>Genauso gut geht es mit einem Stück einfachen Installationskabel, 1 Adrig (starr, 1,5 mm²) welches um die Stößelstangen-Abdeckung herumgeführt wird.</p><p>Somit lässt sich der Kolben der Abdeckung einfach herunterdrücken um dann das obere Element der Abdeckung mit einer Zange (Kombi- oder Spitzzange) entnehmen. Das ganze ist innerhalb von 2 Minuten erledigt und das auch noch ganz ohne umliegende Oberflächen zu zerkratzen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nxzmRLDuBhga-o3X9aGXSQ.jpeg" /><figcaption>Entfernung der Stößelstangen Abdeckung</figcaption></figure><h3>Schritt 5: Ausbau des Nockenwellenantriebs</h3><p>Hierzu müssen die beiden Schrauben auf den Kettenrädern gelöst werden. Dazu reicht es aus, auf die Schrauben mit Drehmomentstößen einzuwirken (z.B. mit einem Druckluftschrauber oder vorsichtig mit Schraubenschlüssel + Gummihammer).</p><p>Sind die Schrauben gelöst, muss der Kettenspanner (unten links) entspannt werden. Auch dafür gibt es Spezialwerkzeug. Da ich aber ohnehin auf hydraulische Spanner umrüste, habe ich mir nur wenig mühe gegeben den Steuerkettenspanner zerstörungsfrei zu entspannen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bvrTe16zRVvjZuPE_1cGiQ.jpeg" /><figcaption>Nockenwellenantrieb Twin Cam 88</figcaption></figure><h3>Schritt 6: Ausbau der Nockenwellen + Halteplatte</h3><p>Nachdem die umliegenden Schrauben der Halteplatte gelöst sind, lassen sich Nockenwelle + Halteplatte + Ölpumpe aus dem Gehäuse abziehen.</p><p>Auf der Rückseite der Halteplatte ist eine weitere Steuerkette angebracht welche die Nockenwelle des vorderen Zylinders antreibt. Auch diese hat einen Steuerkettenspanner welcher sich aber einfach mit einem Stift in einer entspannten Position fixieren lässt.</p><p>Anschließend muss noch der Wellensicherungsring der rechten Nockenwelle entfernt werden und die Nockenwellen können herausgezogen werden.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qAy0MlLi4N7P2CMOdsahJA.jpeg" /><figcaption>Nockenwellen-Halteplatte mit Ölpumpe</figcaption></figure><p>Jetzt ist der Blick auf die inneren Nockenwellenlager frei:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qt7AyTdeWLHX8V-GhosiiA.jpeg" /><figcaption>Nockenwellengehäuse Twin Cam 88</figcaption></figure><p>An dem Bild oben ist schön zu sehen warum die Stößelstangen + Hydrostößel unbedingt ausgebaut werden müssen: die Hydrostößel rutschen einfach nach unten in das Gehäuse und behindern so den Einbau der Nockenwelle.</p><h3>Schritt 7: Entfernung der Hydrostößel-Gehäuse</h3><p>Die Schwierigkeit bei diesem Schritt besteht darin, die Schrauben direkt vor den Zylindern zu lösen.</p><p>Der Harley Ingenieur, der diesen Teil konstruiert hat, wurde hoffentlich schon entlassen: Zwischen Schraube und Kühlrippen ist gerade so viel Platz das ein Bit in den Innensechskant des Schraubenkopfes einsetzten werden kann. Das Bit lässt sich dann mit einem 1/4 “ Schraubenschlüssel packen. Somit lässt sich die Schraube zumindest um ein paar Umdrehungen lösen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DLEM1WHKBQxdHvN_BT1etg.jpeg" /></figure><p>Nach 2–3 Umdrehungen muss man das Bit wieder entfernen da sonst der Abstand zur Kühlrippe zu gering wird und sich das Bit nicht mehr herausziehen lässt. Die letzten Umdrehungen habe ich dann mit einer Spitzzange vorgenommen. Da ohnehin die Schraubenköpfe mit Chromkappen versehen werden sind leichte Kratzspuren am Schraubenkopf tolerierbar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NosOSzUtwybj3Acu2sPu-g.jpeg" /><figcaption>Entfernung der Hydrostößel-Führung</figcaption></figure><h3>Schritt 8: Tausch der Nockenwelleninnenlager</h3><p>In diesem Schritt geht ohne Spezialwerkzeug gar nichts. Zum ausziehen der alten Lager kommt ein Innenlager Abzieher zum Einsatz, welcher haargenau für diese Lager passt.</p><p>Der Kopf des Innenlager Abziehers ist leicht größer als der Innendurchmesser der Lager. Deswegen muss dieser mit leichten Schlägen eines Gummihammers eingetrieben werden. Ist der Kopf in Position, wird ein Bolzen durch das Innere des Auszieher-Kopfes geschoben sodass der Kopf im Durchmesser nicht mehr zurückfedern kann. Jetzt kann das Lager durch anziehen der Mutter herausgezogen werden.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ID9ltnPfVmOkXFulk449g.jpeg" /><figcaption>Nockenwelleninnenlager + Abzieher</figcaption></figure><p>Das Einsetzten der neuen, verstärkten Lager erfolgt auf ähnliche Weise mit Hilfe einer Montageplatte. Die Montageplatte wird an das Motorgehäuse geschraubt. Durch eindrehen einer Gewindestange wird das Lager in den Sitzt gepresst.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HIem5sbyqZezlFK0WEkiuA.jpeg" /></figure><h3>Schritt 9: Vorbereitung der neuen Nockenwellen Halteplatte</h3><p>Das Screamin’ Eagle Upgrade Kit wird <strong>ohne </strong>Nockenwellenlager geliefert: d.h. man muss entweder die alten Lager aus der Halteplatte auspressen um diese dann in der Screamin’ Eagle platte wieder einzusetzen — oder man erneuert die Außenlager gleich mit.</p><p>Zwar sind die Außenlager der Nockenwelle keine Schwachstelle bei diesem Motor, doch besonders beim auspressen eines Lagers kann dieses leicht beschädigt werden. Die beiden Außenlager müssten durch Krafteinwirkung am Innenring ausgepresst werden was starke Kräfte in axialer Richtung verursachen würde. Die Lager sind dafür nicht konzipiert, deswegen kommen hier auch neue Lager zum Einsatz.</p><p>Die Nockenwelle der hinteren Zylinders ist außenseitig in einem Wälzlager gelagert. Da der Innenring des Wälzlagers auf der Nockenwelle verpresst ist und somit schwer zu entfernen, habe ich die Maße beider Innenringe verglichen. Da beide Maße identisch sind konnte ich den Lagerinnenring des alten Wälzlagers auf der Nockenwelle belassen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BbOxonSL0hRRB8ZB5C4K2A.jpeg" /><figcaption>Nockenwellen Außenlager Screamin’ Eagle Halteplatte</figcaption></figure><p>Wichtig: Einen neuen Wellensicherungsring mit passenden Werkzeug einsetzen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L0T2ezYWO5o4lpcj9z_7pw.jpeg" /></figure><p>Im Anschluss kann die Ölpumpe auf der Halteplatte befestigt werden. Dabei gibt es drei Punkte es zu beachten:</p><ul><li>Schraubenkleber verwenden</li><li>Ölpumpe muss mit Hilfe von Zentrierschrauben auf er Halteplatte zentriert werden</li><li>Vor dem Einbau: Ölpumpe zerlegen und ölen</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*kt21Ax2urK3LM_lWWX4pHA.jpeg" /><figcaption>Zentrierschrauben</figcaption></figure><p>Zuerst wird die Ölpumpe mit den Zentrierschrauben an 2 diagonal gegenüberliegenden Gewindebohrungen auf der Halteplatte festgeschraubt und somit zentriert. Dann wird die Ölpumpe mit 2 normalen Schrauben in der jetzigen Position festgezogen (Schraubenkleber verwenden!). Zum Schluss werden die Zentrierschrauben entfernt und auch hier die normalen Schrauben eingesetzt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-exFe3Qe7Wu_PA19US1vcw.jpeg" /><figcaption>Screamin’ Eagle Nockenwellen-Halteplatte</figcaption></figure><p>Ganz wichtig: Immer auf das Timing achten (die Punkt Markierungen müssen sich gegenüber stehen):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BbOxonSL0hRRB8ZB5C4K2A.jpeg" /><figcaption>Markierungen auf den Nockenwellen beachten</figcaption></figure><h3>Schritt 10: Wiedereinbau</h3><p>Dem Screamin’ Eagle Kit liegt eine Rollenkette samt Kettenräder für den Nockenwellenantrieb bei. Beim dessen Montage muss ein Distanzstück auf die Nockenwelle gesetzt werden damit die Kette gerade läuft.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zmhO8Z0Ueat9MxnXzuEQQ.jpeg" /><figcaption>Nockenwellenantrieb Sreamin’ Eagle mit Rollenkette</figcaption></figure><p>Anschließend können die Hydrostößel + Stößelstangen wieder eingesetzt werden.</p><p><strong>Achtung: Die Stößelstangen der Auslassventile sind etwas Länger als die der Einlassventile!</strong></p><p>Bei der Montage der Kipphebel ist wieder einiges zu beachten:</p><p>Die Kurbelwelle wieder so weit drehen, bis beide Ventile geschlossen sind (z.B. Kompressionstakt). Wenn der Nockenwellengehäuse-Deckel schon angebracht ist, lässt sich die Kurbelwelle durch bewegen des Hinterrads bei eingelegtem 5 Gang drehen (sofern die Maschine aufgebockt ist).</p><p>Die Hydrostößel sind durch eine Feder vorgespannt. Wird durch das Anziehen des Kipphebelblockes Druck auf die Stößel ausgeübt, dauert es eine weile bis diese nachgeben und die korrekte Länge annehmen.</p><p>Das bedeutet, das beim Anziehen des Kipphebelblockes Geduld<em> </em>gefragt ist. Bei diesem Schritt sollte lieber etwas mehr Zeit einkalkuliert werden. Für das Vorgehen bedeutet das: Schrauben 1 -2 Umdrehungen anziehen wenn Druck auf den Hydrostößel da ist (lässt sich dadurch erkennen, dass die Ventilfeder leicht zusammengedrückt wird) und anschließend 15 min warten bis der Hydrostößel Zeit hatte das überschüssige Öl heraus zu drücken. Der ganze Vorgang muss so 2–3 mal wiederholt werden bis der Kipphebelblock fest mit dem Zylinderkopf verschraubt ist.</p><p>Wenn sich die Stößelstangen im Sitz drehen lassen, haben die Hydrostößel die richtige Länge erreicht (Idealerweise wird die Stößelstangenabdeckung erst nach Montage des Kipphebelblockes montiert). Zu dem ganzen Prozedere findet man was unter dem Stichwort ,,lifter bleeding”. Gibt man den Hydrostößeln nicht genug Zeit zum ,,bleeden”, verbiegen sich die Stößelstangen wenn der Motor zu früh gedreht wird.</p><p>Ist alles eingebaut, kann jetzt wieder Öl in den Öltank eingefüllt werden. Ich habe zusätzlich etwas Öl (~ 300 ml) unter Zuhilfenahme eines selbst gebauten Trichters seitlich in das Nockenwellengehäuse eingefüllt:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8tt8YLHX9utuBFob0gl7sQ.jpeg" /></figure><p>Jetzt kann man ein wenig Orgeln und kontrollieren ob die Öldruckanzeige erlischt (hat bei mir ~ 1 Minute gedauert):</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FN4Jy-1r083Q%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DN4Jy-1r083Q&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FN4Jy-1r083Q%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/dca1e7525741b6a81894698604ddaf16/href">https://medium.com/media/dca1e7525741b6a81894698604ddaf16/href</a></iframe><p>Man sollte übrigens keinen Tornado aus Öl an den Kipphebeln erwarten. Das Öl, welches die Kipphebel schmiert, wandert durch die Hydrostößel und Stößelstangen nach oben und wird dann durch die Kipphebelwellen gepresst. Im Leerlauf dauert es einige Minuten bis etwas Öl an den Kipphebeln ankommt.</p><p>Jetzt noch die restlichen Teile dran bauen und dann kann wieder gefahren werden!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=141e2b659d55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Business Model: Mining]]></title>
            <link>https://medium.com/@s.avenwedde/business-model-mining-c79561124957?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/c79561124957</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[mining]]></category>
            <category><![CDATA[monero]]></category>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[apps]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Tue, 19 Mar 2019 08:18:40 GMT</pubDate>
            <atom:updated>2019-03-19T08:18:40.010Z</atom:updated>
            <content:encoded><![CDATA[<p>How one could use the blockchain technology to finance your app? In this article we will discover different mining technologies from a commercial perspective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VvI6brYtUrmJrliU.jpg" /><figcaption>Photo by <a href="https://www.flickr.com/photos/moia/">Marko Ahtisaari</a></figcaption></figure><p>The conventional way financing an app by advertisement on the screen or by creating a motion profile and selling the Geo data is annoying for the user. The recent cases of <a href="https://medium.com/@normbond/how-to-block-websites-from-hijacking-your-cpu-and-mining-cryptocurrency-37c7a4d64b87">crypto hijacking</a> showed us a new way of creating value by using the CPU power of the victims system. As a consequence, Microsoft updated the Windows Defender, which is now capable of detecting the <a href="https://cryptonotestarter.org/">CryptoNote</a> <a href="https://en.bitcoin.it/wiki/Proof_of_work">PoW</a> algorithm. This algorithm was often smuggled onto the victims system to mine privacy coin <a href="https://www.getmonero.org/">Monero</a>. But can we use this technique for a regular business model? Lets take a look:</p><p>Lets take some assumptions: Mining must take place under the following conditions:</p><ul><li>Mobile devices</li><li>Limited CPU/GPU performance</li><li>Time limited usage of the app</li></ul><p>The only hard currency we have is the time of the users . But can we take profit from it with the blockchain technology?</p><p>When the hardware setup is fixed, the more time you spend on mining, the more revenue you collect. This can be used as an incentive to keep the user at your app by rewarding him with some in app/ingame bonuses. This is nothing new when you think about that an advertiser usually want the users attention.</p><p>On the basis of our assumptions, the following consensus algorithms seem to be suitable for our use case:</p><ol><li><a href="https://en.wikipedia.org/wiki/Proof-of-space">Proof of Capacity</a></li><li><a href="https://tokens-economy.gitbook.io/consensus/chain-based-proof-of-capacity-space/proof-of-retrievability-por">Proof of Retrievability</a></li><li><a href="https://en.wikipedia.org/wiki/Proof-of-stake">Proof of Stake</a></li></ol><p>However, for my application, <a href="https://github.com/hANSIc99/Pythonic">Pythonic,</a> I choosed a classical <a href="https://en.wikipedia.org/wiki/Proof-of-work_system">Proof of Work</a> algorithm. Of course this wont work on mobile devices but due to I developed <a href="https://github.com/hANSIc99/Pythonic">Pythonic</a> for desktop deployment, this fact is less important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*G1-lYoX6H7UUue95.jpg" /><figcaption>Photo by <a href="https://pixabay.com/users/picography-361976/">Picography</a></figcaption></figure><p>I also decided to pick <a href="https://www.getmonero.org/">Moneros</a> consensus algorithms (<a href="https://cryptonotestarter.org/">CryptoNote</a>) which is designed to run best on ordinary CPU&#39;s. <a href="https://www.getmonero.org/">Monero</a> already hardforked in the past due to the rise of uncommon hash rate increases which could be caused by the use of ASICs. The idea behind the privacy coin <a href="https://www.getmonero.org/">Monero</a> also covers the decentralization of the mining power, thus it is most advantageous when everybody has the capability to participate with realistic chances of finding the next block when using their own standard PC hardware. That’s why <a href="https://cryptonotestarter.org/">CryptoNote</a> runs best on ordinary CPU&#39;s and you can expect decent results even without an ASIC. There is also a good <a href="https://medium.com/@ecurrencyhodler/was-moneros-pow-change-a-success-81cfeaa08aae">article</a> which covers the reason for the hardfork.</p><p>So as not to exhaust the CPU of the user unnecessarily, I did some test with my notebook to check how many CPU time I can spend for mining without any constraints at ordinary usage:</p><p>The Intel Core i7–2670QM @ 2.20 GHz of my notebook is an 8 year old CPU with 8 logical cores. For the mining software, I picked <a href="https://github.com/fireice-uk/xmr-stak">XMR-Stak</a> because you can get pre-compiled binaries for almost every platform, which speedup test significantly.</p><p>When the algorithm is executed on one core only, the normal usage is not affected and the CPU fan is not getting loud.</p><p><a href="https://github.com/hANSIc99/Pythonic">Pythonic</a> is intended as a tool to setup mining bots so we can assume that it is run 24/7.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6FMp1op8xqXunbtkVbRT8w.png" /><figcaption>Pythonic v0.6</figcaption></figure><p>In sum, we have:</p><ul><li>Intel Core i7-2670QM @ 2.20 GHz</li><li>Mining on 1 core</li><li>25 H/s</li><li>24/7 operation</li></ul><p>According to <a href="https://www.cryptocompare.com/">CryptoCompare,</a> we can expect a revenue of <br>193.9 * 10^(-6) XMR/day. The actual price level of XMR is at <br>53.50 USD/XMR. So at the end of the month you get 0.31 $ per user.</p><p>In practical terms, this means it will need 16,130 user who are running <a href="https://github.com/hANSIc99/Pythonic">Pythonic</a> in 24/7 operation to generate a revenue of 5k$/month.</p><p>Well, that sounds not very promising and its getting worse:<br>As I stated above, Microsoft updated the Windows Defender. If you want to run <a href="https://github.com/fireice-uk/xmr-stak">XMR-Stak</a> on Windows, you have to add an exception for the installation folder. And who wants to deactivate its virus scanner for an application which usually runs fine with ordinary user rights? All in all this gives an application a dubious touch on Windows based systems.</p><p><strong>Conclusion</strong></p><p>For the moment we can summarize that mining takes an subordinated role as a business model for financing an app. But its definitely worth keeping an eye on this topic in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c79561124957" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 things you should know about hackathons]]></title>
            <link>https://medium.com/@s.avenwedde/3-things-you-should-know-about-hackathons-6a124e56223f?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a124e56223f</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[competition]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Fri, 15 Mar 2019 08:29:35 GMT</pubDate>
            <atom:updated>2019-03-15T08:29:35.197Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have a good idea for an app, piece of software or an invention you want to propagate you may start thinking about participating to an programming competition, often called a <strong>Hackathon</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*THDIwsjeexH6TjgR.jpg" /><figcaption>Source: <a href="https://www.flickr.com/photos/techcrunch/">TechCrunch</a></figcaption></figure><p>I also had such an idea and planned to participate to an hackathon. Due to the fact that my idea affected some areas of my employer, I discussed my plan with the legal department. Fortunately, the lawyers warned me deeply about a participation — not only for the sake of protecting the rights of my (and their) employer, also for selling my idea for free. They kindly made an analysis of the legal conditions under which the contribution has to be made.</p><p>Like myself, I assume most of you wont be able to correctly understand legal related texts. To give you an understanding of the problems which comes with a contribution to an hackathon, I have choosen conditions of participation of a random picked hackathon which I found on the web. At this point I won’t say which one it was exactly, but if you do a bit of research you will find out that many hackathons follow similar rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uJMJuEpb9Tqf0Q_q.jpg" /><figcaption>Source: <a href="https://www.flickr.com/photos/christiaancolen/">Christiaan Colen</a></figcaption></figure><p>The interesting part begins with:</p><p><em>“Other than what is set forth below, we are not claiming any ownership rights to your entry.”</em></p><p>Which sounds OK when you read it the first time. But maybe it is worth reading the subsequent sentences:</p><p><em>“However, by submitting your entry, you agree to ALL of the following statements:”</em></p><p>Aha… Lets take a closer look:</p><p>A few more sentences further we find the following passage:</p><p><em>“You understand and acknowledge that the sponsor(s) may have developed or commissioned materials similar or identical to your submission and you waive any claims you may have resulting from any similarities to your entry.”</em></p><p>This means that you …</p><ol><li><strong>Grant Unrestricted usage rights for the sponsors </strong>— because you are not able to prove that your idea is brand-new when you first introduce it in the scope of a hackathon</li><li><strong>Surrendering of all your rights</strong>— when one of the sponsors launches a similar product.</li><li><strong>Contribute to unknown Sponsors</strong> — the hackathon I picked, a list of sponsors couldn&#39;t be found. This leads to the conclusion that a “sponsor” could be created out of nothing when a contribution looks promising.</li></ol><p>Note that not every hackathon has such an adverse set of rules. When you have a good idea which you want to propagate you should look twice before you contribute your idea to an competition. You also should think about where high financial rewards are coming from —<strong> nobody gives away money for free</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a124e56223f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In 7 steps to your own trading bot]]></title>
            <link>https://medium.com/@s.avenwedde/in-7-steps-to-your-own-trading-bot-36458435172b?source=rss-4f46d0d65dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/36458435172b</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[binance]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Stephan A]]></dc:creator>
            <pubDate>Wed, 30 Jan 2019 20:36:16 GMT</pubDate>
            <atom:updated>2019-01-30T20:36:16.652Z</atom:updated>
            <content:encoded><![CDATA[<p>I already introduced <a href="https://medium.com/@s.avenwedde/algo-trading-dataflow-programming-with-python-ic-fcea0b529c2e">Pythonic</a> in a previous article here on Medium. You can find the installation instruction on <a href="https://github.com/hANSIc99/Pythonic">GitHub</a>. In this article, I want to show the intended usage of Pythonic by creating a trading-bot which monitors the marked prices and executes orders independently.</p><p>Currently, only trading on <a href="https://www.binance.com/">Binance</a> is possible. But I’m in the mood that further interfaces to other stock exchanges will follow.</p><h4>1. Preparation</h4><p>We will create a trading algorithm which makes its decision based on the moving averages of a cryptocurrency pair. We will choose TRON/BTC for our example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bRgT12HHQPy8uYuC83f8UA.png" /><figcaption>TRON/BTC candlestick chart, 1h, 20.01.2019–29.01.2019</figcaption></figure><p>On the candlestick chart above you can see the price development of <a href="https://tron.network/">TRON</a> against Bitcoin in one hour intervals between the 20 and 29 of January 2019.</p><p>On the chart there are already <a href="https://www.investopedia.com/terms/m/movingaverage.asp">moving averages</a> courses with a time period of 99 hours (the pink line) and 25 hours (the purple line). The moving average with a period of 7 hours (yellow line) won’t be considered in this example. At the place where the more volatile line (MA 25) crossed the less volatile line (MA 99) we should have placed our buy order (marked with the red circle).</p><h4>2. Synchronization</h4><p>Before we download the <a href="https://www.investopedia.com/terms/o/ohlcchart.asp">OHLC</a> data from the <a href="https://www.binance.com/">Binance</a> server, we have to think about time synchronization. An example: We want to trade based on 1 hour data. The clock on our PC shows us it is 15:40, in reality it is 15:38 which is also the time of the <a href="https://www.binance.com/">Binance</a> server. When we pass 16 o’clock on our PC, in reality it is 15:58 on the <a href="https://www.binance.com/">Binance</a> server. As a result, we download 58 minute old OHLC data and are always almost 1 hour behind. For this reason we need a proper time synchronization.</p><p>To avoid such kind of problems, Pythonics has an implemented time synchronization element which queries the server time from the Binance server and activates a subsequent element when the set period has expired:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ptL1MCF-hPXLeRxUKK8gA.png" /><figcaption>Binance scheduler settings in Pythonic</figcaption></figure><p>I made the experience, that if we try synchronize to the exact transition time between the periods, the new OHLC data is not yet available on the server. Therefore, we have the possibility to add an time offset which can be used to add an extra delay before we start to query the OHLC data. As you can see in the picture above, I added an extra delay of 10 seconds.</p><h4>3. Data acquisition</h4><p>When we hit the border between the periods, we want to download the OHLC data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZ79i8vMOeKnKw7aYLKEWA.png" /><figcaption>Binance OHLC query settings in Pythonic</figcaption></figure><p>The element queries the Binance server and will pass the OHLC data as a <a href="https://pandas.pydata.org/">Pandas</a> dataframe to subsequent elements.</p><h4>4. Technical analysis</h4><p>The OHLC data doesn’t contain any indicators. We have to setup the desired moving averages by placing two technical analysis elements successively. One with a time period of 99 and the other with 25 (screenshot):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*spnZts6Rq6ECtPrXbo6uzA.png" /><figcaption>MA technical analysis settings in Pythonic</figcaption></figure><p>The technical analysis elements will add two columns to our <a href="https://pandas.pydata.org/">Pandas</a> dataframe named <em>ma-99</em> and <em>ma-25.</em></p><h4>5. Decision making</h4><p>Now we have all information together which we need wether to place an order or not. To formulate our trading condition, we use the basic operation element which executes usual Python code.</p><p>With the variable <em>input</em>, we access the data of previous elements. The variable <em>output</em> lets us pass data to subsequent elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1nrDb3E7zxzwhF5ZvHmkfA.png" /><figcaption>Moving average trading condition in Pythonic basic operation element</figcaption></figure><p>When the <em>output</em> value is set to <em>1</em>, we want to execute a buy order, otherwise we want to proceed the procedure next period (next hour).</p><p>Unfortunately, there is no intelli sense or automatic syntax check, so I recommend to check your code on <a href="https://pythonbuddy.com/">PythonBuddy</a>.</p><p>We can now add a branch element which splits the execution based on whether it gets a <em>0</em> or <em>1</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*saVEvK4_QULAC09y32HH0A.png" /><figcaption>Settings of the branch element in Pythoinic</figcaption></figure><h4>6. Placing orders</h4><p>In case of a positive decision, the former execution path will continue and we can place an order by dropping the related element to the right position on the workspace:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NuwDdJ7EOFApFxCHlyV7OQ.png" /><figcaption>Binance order element settings in Pythonic</figcaption></figure><p>The API- and secret-key can be created within your <a href="https://www.binance.com/">Binance</a> account. The other end of the branch can be left empty.</p><h4>7. Scheduling</h4><p>One last thing: When you now click on the Run button in the menubar, the whole procedure is performed only once. After we have passed the branch element and placed an order or not, we want to repeat the whole procedure in the next period. To achieve this, we go to the settings of the very first element and activate a basic 1 hour timer which triggers the synchronization element:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFwGNfsRWyVCo8Li9pgANg.png" /><figcaption>Basic scheduler settings in Pythonic</figcaption></figure><p>If we now click on the start button, a background timer is kept running by the first element which expires constantly after one hour to keep our trading bot alive.</p><h4>Summary</h4><p>The example above showed how to setup a quite simple version of a trading bot. I made the experience, that the simple techniques often achieve the better results. But you have to make you own experience in improving trading algorithms.</p><p>Pythonic is my first approach to create a graphycal programming tool geared to trading. If you have any suggestion for improving the functionality, feel free to leave a comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36458435172b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>