<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ProgrammerMoney.com</title>
    <description>The latest articles on DEV Community by ProgrammerMoney.com (@programmermoney).</description>
    <link>https://dev.to/programmermoney</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F696147%2F231282f0-e8da-4561-9379-2e744f2c9ab8.jpg</url>
      <title>DEV Community: ProgrammerMoney.com</title>
      <link>https://dev.to/programmermoney</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/programmermoney"/>
    <language>en</language>
    <item>
      <title>Algo-Trading Journey: Randomness Causes Support Levels</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Fri, 01 Nov 2024 11:35:16 +0000</pubDate>
      <link>https://dev.to/programmermoney/algo-trading-journey-randomness-causes-support-levels-108b</link>
      <guid>https://dev.to/programmermoney/algo-trading-journey-randomness-causes-support-levels-108b</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" alt="algo-trading bot" width="500" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(this is part 7 of the &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; series)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PROOF: Support and resistance levels are not created by supply and demand. 😲 Instead, they emerge from randomness itself. 🤯💥📈&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Patterns Are Deceiving You
&lt;/h2&gt;

&lt;p&gt;Even in ancient Greece, people were able to &lt;strong&gt;precisely calculate&lt;/strong&gt; when the Sun would rise and set.&lt;/p&gt;

&lt;p&gt;However...&lt;/p&gt;

&lt;p&gt;Their interpretation of &lt;strong&gt;WHY&lt;/strong&gt; this happens was... questionable, LOL.&lt;/p&gt;

&lt;p&gt;Apparently, the god Appollo was carrying the Sun in his chariot across the sky. (and was extremely punctual) 😂😆&lt;/p&gt;

&lt;p&gt;CONCLUSION: you can be excellent in recognizing patterns, and still be absolutely terrible in explaining (and understanding) them.&lt;/p&gt;

&lt;p&gt;BUT... if you read this entire article, you will learn something about the market barely anyone else understands... so stick around... this will be fun 😉🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Support &amp;amp; Resistance Levels
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomun2qjwkvfby711tc0e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomun2qjwkvfby711tc0e.png" alt="support and resistance levels" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above is a Bitcoin price chart spanning more than 3 years.&lt;/p&gt;

&lt;p&gt;I drew two of the biggest support and resistance levels during this period.&lt;/p&gt;

&lt;p&gt;Now, you may think there is no way this has anything to do with randomness.&lt;/p&gt;

&lt;p&gt;Especially on such a long timeframe.&lt;/p&gt;

&lt;p&gt;It is "clearly" the result of overall market supply and demand.&lt;/p&gt;

&lt;p&gt;BUT...&lt;/p&gt;

&lt;p&gt;You would be wrong 😲&lt;/p&gt;

&lt;p&gt;How can I be so sure?&lt;/p&gt;

&lt;p&gt;Because I can prove it to you using very (very) simple math.&lt;/p&gt;

&lt;p&gt;And you can't argue with math... 1 + 1 is 2. &lt;/p&gt;

&lt;h2&gt;
  
  
  Market "Atoms"
&lt;/h2&gt;

&lt;p&gt;Let's make the simplest market exchange imaginable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The smallest possible price change can be ±1&lt;/li&gt;
&lt;li&gt;The smallest possible candle will be 4 price points (4 trades)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, let's see what this looks like in practice...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight d"&gt;&lt;code&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can gather all these price changes into candles (group by 4)...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight d"&gt;&lt;code&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, here is a list of ALL possible candle values for each of the 4 trades:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;T1&lt;/th&gt;
&lt;th&gt;T2&lt;/th&gt;
&lt;th&gt;T3&lt;/th&gt;
&lt;th&gt;T4&lt;/th&gt;
&lt;th&gt;SUM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;+1&lt;/td&gt;
&lt;td&gt;-4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Notice anything interesting in the &lt;em&gt;SUM&lt;/em&gt; column?&lt;/p&gt;

&lt;p&gt;How about... no matter what you do, or what the price action does, you will &lt;strong&gt;NEVER&lt;/strong&gt; get to values ±1 or ±3.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(there is 0% statistical chance)&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;SUM&lt;/th&gt;
&lt;th&gt;ODDS&lt;/th&gt;
&lt;th&gt;PROBABILITY&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;+4&lt;/td&gt;
&lt;td&gt;1/16&lt;/td&gt;
&lt;td&gt;6.25%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+2&lt;/td&gt;
&lt;td&gt;4/16&lt;/td&gt;
&lt;td&gt;25.00%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;6/16&lt;/td&gt;
&lt;td&gt;37.50%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-2&lt;/td&gt;
&lt;td&gt;4/16&lt;/td&gt;
&lt;td&gt;25.00%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-4&lt;/td&gt;
&lt;td&gt;1/16&lt;/td&gt;
&lt;td&gt;6.25%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The candle price just "jumps" to ±2 or ±4.&lt;/p&gt;

&lt;p&gt;And then just "sits" there 37.5% of the time.&lt;/p&gt;

&lt;p&gt;Some might call this support and resistance levels. 😲💥🤯😱&lt;/p&gt;

&lt;h2&gt;
  
  
  Simulation
&lt;/h2&gt;

&lt;p&gt;But don't take my word for it... let's do a simulation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fky4vggjuhpihp95fhhwn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fky4vggjuhpihp95fhhwn.png" alt="100 random points simulation" width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are the first 100 points in a random simulation.&lt;/p&gt;

&lt;p&gt;Now, if we just presented this price data to some market "expert", he would "clearly" see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;market forces in action&lt;/li&gt;
&lt;li&gt;strong support and resistance levels&lt;/li&gt;
&lt;li&gt;fake breakout around points 45-55&lt;/li&gt;
&lt;li&gt;"obvious" price collapse below the support level&lt;/li&gt;
&lt;li&gt;price is now trending down and is expected to go down because "the market has spoken"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But let's not forget... there is no market here... just randomness.&lt;/p&gt;

&lt;p&gt;So, let's see what happens in the next 900 points:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finauk1oy4x2qrktrz2bc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finauk1oy4x2qrktrz2bc.png" alt="1000 random market points" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It turns out our "market expert" was correct... the price really did continue to fall for the next 100 points or so.&lt;/p&gt;

&lt;p&gt;After that, it tried to break out to the upside again. This time, slightly exceding the previous high.&lt;/p&gt;

&lt;p&gt;But unfortunately it was another fakeout and it solidified the down trend with &lt;strong&gt;&lt;em&gt;double top&lt;/em&gt;&lt;/strong&gt; formation which is usually a strong bearish sign.&lt;/p&gt;

&lt;p&gt;And, over the next 700 points, the price continued its downward long-term trend.&lt;/p&gt;

&lt;p&gt;Also notice how the price respected the &lt;strong&gt;&lt;em&gt;downward converging trend lines&lt;/em&gt;&lt;/strong&gt; (which is another market indicator) and touched them several times.&lt;/p&gt;

&lt;p&gt;And I could go on and on...&lt;/p&gt;

&lt;h2&gt;
  
  
  Markets Are Fractal
&lt;/h2&gt;

&lt;p&gt;The absolute truth in this example is that there is no "market".&lt;/p&gt;

&lt;p&gt;In fact, I could even give you the code that generated this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight d"&gt;&lt;code&gt;&lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;rnd&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Random&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;marketValue&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nb"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;csvArr&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s"&gt;"candle, value"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"0, 0"&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;randomNumber&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rnd&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;marketValue&lt;/span&gt; &lt;span class="p"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;randomNumber&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;csvArr&lt;/span&gt; &lt;span class="p"&gt;~=&lt;/span&gt; 
        &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; 
        &lt;span class="s"&gt;", "&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; 
        &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;marketValue&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;saveData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;csvArr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Despite all of this, our "market expert" would continue to see market forces in this chart:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;he would see long-term demand decrease&lt;/li&gt;
&lt;li&gt;the fight between buyers and sellers&lt;/li&gt;
&lt;li&gt;people putting stop-loss orders at certain price levels&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But there is nothing. This is nothing more than a display of a coin toss experiment.&lt;/p&gt;

&lt;p&gt;A 50:50 chance of getting +1 or -1.&lt;/p&gt;

&lt;p&gt;And this is why price charts look similar regardless of the timeframe you're looking at them.&lt;/p&gt;

&lt;p&gt;And since randomness is fractal, so are the pricing charts.&lt;/p&gt;

&lt;p&gt;And now, you'll never be fooled by "market experts" on things that a simple coin toss can explain. 👍&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;I plan to post my progress here on &lt;strong&gt;dev.to&lt;/strong&gt; because I find it fun... and I enjoy it.&lt;/p&gt;

&lt;p&gt;If you want to join me on this journey, then I suggest you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;follow&lt;/strong&gt; my profile for more updates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bookmark&lt;/strong&gt; this article for future reference&lt;/li&gt;
&lt;li&gt;and &lt;strong&gt;like&lt;/strong&gt; this post, so more people can see it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's go and conquer the market :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. here are some cool resources:&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Best Programming Language For Finance&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;2. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;(FREE) AI For Finance Tutorial&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;3. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Starter Code For Bot Building&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>dlang</category>
      <category>javascript</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Algo-Trading Journey: Programming Language Choice</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Fri, 25 Oct 2024 10:16:48 +0000</pubDate>
      <link>https://dev.to/programmermoney/algo-trading-journey-programming-language-choice-4mad</link>
      <guid>https://dev.to/programmermoney/algo-trading-journey-programming-language-choice-4mad</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" alt="algo-trading bot" width="500" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(this is part 6 of the &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; series)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The biggest red flag 🚩 in a language is when you can't use it to do what you want, and you absolutely MUST use external libraries (written in different languages).&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Popular Deception
&lt;/h2&gt;

&lt;p&gt;This reminds me of a joke where one fish asks another, "How's water?" 🐟 🐠 and the other responds, "What is water?" 😅&lt;/p&gt;

&lt;p&gt;The point is that when something is so prevalent and all around you, it's actually hard to see it. Or even notice it.&lt;/p&gt;

&lt;p&gt;The same is true for languages like Python when it comes to data science.&lt;/p&gt;

&lt;p&gt;It is the most popular language, and everyone just assumes you need to use libraries like &lt;code&gt;numpy&lt;/code&gt; or &lt;code&gt;pandas&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But no one stops for one single second and asks... why?&lt;/p&gt;

&lt;h3&gt;
  
  
  LEARNING CURVE
&lt;/h3&gt;

&lt;p&gt;How much easier (and simpler) would it be if you could just loop through the data using the &lt;code&gt;for&lt;/code&gt; loop?&lt;/p&gt;

&lt;p&gt;But you can't do that in Python because it's 80x slower than compiled languages (or some crazy big number like that).&lt;/p&gt;

&lt;p&gt;On the other hand, compiled languages are very fast but also very "brittle".&lt;/p&gt;

&lt;p&gt;Everything needs to be very precisely defined, and they're (usually) not very good for &lt;strong&gt;prototyping&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  SIMPLE AS PYTHON, FAST AS C/C++
&lt;/h3&gt;

&lt;p&gt;As impossible as this task seemed to be... after I spent a &lt;strong&gt;decade&lt;/strong&gt; in software development, I managed to find a language that is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;(extremely) easy to learn&lt;/li&gt;
&lt;li&gt;simple as Python&lt;/li&gt;
&lt;li&gt;fast as C/C++&lt;/li&gt;
&lt;li&gt;is compiled&lt;/li&gt;
&lt;li&gt;but can &lt;strong&gt;run as a script&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;stood the test of time (not new at all)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;and is overall the biggest undiscovered gem!&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here, you can download a full report on &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;The Best Programming Language For Finance&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beware of the Demo
&lt;/h2&gt;

&lt;p&gt;This is how they hook you.&lt;/p&gt;

&lt;p&gt;It works (quite literally) the same as fishing bait. It looks good until you take a bite... and then... there's no going back. 😲&lt;/p&gt;

&lt;p&gt;Popularity is based on the greatest building speed when going from scratch.&lt;/p&gt;

&lt;p&gt;BUT... this scenario covers only 0.1% of the entire lifetime of the project&lt;br&gt;
... (maybe even less).&lt;/p&gt;

&lt;p&gt;That's why I choose to focus on the productivity that impacts the rest 99.9% of the project.&lt;/p&gt;
&lt;h3&gt;
  
  
  FALSE PRODUCTIVITY ASSUMPTIONS
&lt;/h3&gt;

&lt;p&gt;When you see a small part of the project built quickly, you immediately assume the entire project will be built faster.&lt;/p&gt;

&lt;p&gt;And this couldn't be further from the truth.&lt;/p&gt;

&lt;p&gt;That's why &lt;a href="https://dev.to/programmermoney/algo-trading-journey-framework-hell-1bjf"&gt;frameworks&lt;/a&gt; are popular.&lt;/p&gt;

&lt;p&gt;You're sold on the idea you can do 90% of what you need in a fraction of the time...&lt;/p&gt;

&lt;p&gt;...but then you pay for the rest of the 10% in full (and with interest).&lt;/p&gt;

&lt;p&gt;And over the entire lifetime of the project, you end up spending 200-300% more time "coercing" the framework to do what you want it to do.&lt;/p&gt;

&lt;p&gt;When in reality, you could have just not used the framework at all and gotten 2-3x more long-term productivity.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(this is a very steep price to pay for the first month of productivity euphoria)&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Holistic Approach
&lt;/h2&gt;

&lt;p&gt;Using the same language for prototyping and production reduces context switching.&lt;/p&gt;

&lt;p&gt;Being able to do the data manipulation with the language itself (without external libraries) is incredibly refreshing and productive.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(not to mention, you don't have to learn all those extra frameworks)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Having the language be able to switch between being very type strict and very relaxed is powerful.&lt;/p&gt;

&lt;p&gt;Even more powerful is the ability to work as a high-level language, but also having an option to switch to low assembly-level control (with a single line of code).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight d"&gt;&lt;code&gt;&lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;evenArr&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;!(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👆 Looks almost like JavaScript (but it's not)... and it looks so simple and intuitive... and yet... it runs at near-C speed. 🤯&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, THAT is the stuff a good programming language for finance (and anything else for that matter) is made of.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🎤 #micdrop&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;I plan to post my progress here on &lt;strong&gt;dev.to&lt;/strong&gt; because I find it fun... and I enjoy it.&lt;/p&gt;

&lt;p&gt;If you want to join me on this journey, then I suggest you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;follow&lt;/strong&gt; my profile for more updates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bookmark&lt;/strong&gt; this article for future reference&lt;/li&gt;
&lt;li&gt;and &lt;strong&gt;like&lt;/strong&gt; this post, so more people can see it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's go and conquer the market :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. here are some cool resources:&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Best Programming Language For Finance&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;2. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;(FREE) AI For Finance Tutorial&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;3. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Starter Code For Bot Building&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>dlang</category>
      <category>javascript</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Algo-Trading Journey: Building vs. Buying Bots</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Wed, 23 Oct 2024 11:58:48 +0000</pubDate>
      <link>https://dev.to/programmermoney/algo-trading-journey-building-vs-buying-bots-1j6l</link>
      <guid>https://dev.to/programmermoney/algo-trading-journey-building-vs-buying-bots-1j6l</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" alt="algo-trading bot" width="500" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(this is part 5 of the &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; series)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This article demonstrates that it is MATHEMATICALLY IMPOSSIBLE to buy a bot that is profitable, and ALL that sell them are scammers.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ideal Scenario
&lt;/h2&gt;

&lt;p&gt;Let's say someone 100% honest built a trading bot that works 100% of the time.&lt;/p&gt;

&lt;p&gt;Now, this person has decided to sell this bot.&lt;/p&gt;

&lt;p&gt;Should you buy it?&lt;/p&gt;

&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because as soon as the bot was up for sale, it stopped working.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because of liquidity...&lt;/p&gt;

&lt;h2&gt;
  
  
  Liquidity
&lt;/h2&gt;

&lt;p&gt;Even if the bot really works, after a lot of people buy it, it will stop working.&lt;/p&gt;

&lt;p&gt;Because every strategy has limited liquidity available.&lt;/p&gt;

&lt;p&gt;It's like a water well ⛲️&lt;/p&gt;

&lt;p&gt;You can't supply an entire world with one water well.&lt;/p&gt;

&lt;p&gt;The same is true with trading bots. The closest ones to the exchange servers will be executed first, and everyone else will just lose money.&lt;/p&gt;

&lt;p&gt;And note: this is in the best-case scenario where the bot works 100% of the time.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(we will not even go into why a person would want to sell such a bot instead of getting all this liquidity for himself)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Building is the ONLY option!
&lt;/h2&gt;

&lt;p&gt;Be careful where you deploy the bot and with whom you share the code.&lt;/p&gt;

&lt;p&gt;There are a lot of (FREE) platforms that provide you with everything you need to start building your bot.&lt;/p&gt;

&lt;p&gt;BUT...&lt;/p&gt;

&lt;p&gt;They all require you to upload/share your code with them.&lt;/p&gt;

&lt;p&gt;And you will never know whether they used your code or not. But you will know your bot doesn't work.&lt;/p&gt;

&lt;p&gt;REMEMBER: your code/algorithm is your &lt;strong&gt;only&lt;/strong&gt; market advantage! As soon as you share it with someone, consider it lost 😲&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not build it from scratch?
&lt;/h2&gt;

&lt;p&gt;Those ("FREE") platforms provide you with everything you need BEFORE you even start building the bot logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;connecting to the exchange APIs&lt;/li&gt;
&lt;li&gt;getting and saving the data&lt;/li&gt;
&lt;li&gt;backtesting your strategies&lt;/li&gt;
&lt;li&gt;calculating ROI (and other KPIs)&lt;/li&gt;
&lt;li&gt;displaying charts&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building all of this yourself would take weeks (or months) before you write a single line of your algo-trading logic.&lt;/p&gt;

&lt;p&gt;I know this because I had to do it myself.&lt;/p&gt;

&lt;p&gt;Because there is no way I would allow someone to steal my code after I invest days, weeks, or months trying to find an edge (a solid trading strategy).&lt;/p&gt;

&lt;h2&gt;
  
  
  Starter Code
&lt;/h2&gt;

&lt;p&gt;Your alternative is to download this &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;starter code&lt;/a&gt; that I built (from scratch) using the best programming language for finance.&lt;/p&gt;

&lt;p&gt;It has all the necessary parts you need to start building today. And begin working on things that matter (like the bot logic).&lt;/p&gt;

&lt;p&gt;NOTE: the starter code does NOT include any trading logic -&amp;gt; it only has everything you need to get started.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(like I said, anyone who sells finished trading bots is a scammer)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After you download it - it's yours.&lt;/p&gt;

&lt;p&gt;You will COMPLETELY own it and control it.&lt;/p&gt;

&lt;p&gt;And you will be able to develop your algo-trading bots on top of it. (and no one will have access to your secret logic, not even me)&lt;/p&gt;

&lt;p&gt;Good luck 👍&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;I plan to post my progress here on &lt;strong&gt;dev.to&lt;/strong&gt; because I find it fun... and I enjoy it.&lt;/p&gt;

&lt;p&gt;If you want to join me on this journey, then I suggest you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;follow&lt;/strong&gt; my profile for more updates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bookmark&lt;/strong&gt; this article for future reference&lt;/li&gt;
&lt;li&gt;and &lt;strong&gt;like&lt;/strong&gt; this post, so more people can see it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's go and conquer the market :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. here are some cool resources:&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Best Programming Language For Finance&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;2. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;(FREE) AI For Finance Tutorial&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;3. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Starter Code For Bot Building&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>dlang</category>
      <category>javascript</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Algo-Trading Journey: Framework Hell</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Thu, 17 Oct 2024 19:46:06 +0000</pubDate>
      <link>https://dev.to/programmermoney/algo-trading-journey-framework-hell-1bjf</link>
      <guid>https://dev.to/programmermoney/algo-trading-journey-framework-hell-1bjf</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" alt="algo-trading bot" width="500" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(this is part 4 of the &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; series)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frameworks are like drugs that give you immense pleasure the first month, only to suffer for years to come.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Clean Code &amp;amp; Options
&lt;/h2&gt;

&lt;p&gt;Options are one of the most traded asset classes, and they aren't even a "real thing".&lt;/p&gt;

&lt;p&gt;They're a derivative... think of them as more like insurance.&lt;/p&gt;

&lt;p&gt;So why do people buy options?&lt;/p&gt;

&lt;p&gt;Because they want... &lt;em&gt;options&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The same is true with your project or code. You want to have the ability (option) to change it and extend it (easily).&lt;/p&gt;

&lt;p&gt;You want it to be clean and decoupled.&lt;/p&gt;

&lt;p&gt;But what is the first thing people usually do?&lt;/p&gt;

&lt;p&gt;Before writing a single line of code?&lt;/p&gt;

&lt;p&gt;They couple it with a bunch of frameworks that tightly tie your code to them.&lt;/p&gt;

&lt;p&gt;And then... there is no escape.&lt;/p&gt;

&lt;h2&gt;
  
  
  Productivity Myth
&lt;/h2&gt;

&lt;p&gt;Yes, but what about all the extra productivity?&lt;/p&gt;

&lt;p&gt;Well, let's analyze it...&lt;/p&gt;

&lt;p&gt;First of all, frameworks want to be popular. This means they want to have a very wide appeal.&lt;/p&gt;

&lt;p&gt;Nothing wrong with that, except a wide appeal means a wide variety of features.&lt;/p&gt;

&lt;p&gt;Features you don't really need. Plus, it's a nightmare to add the ones you do need, but frameworks don't have.&lt;/p&gt;

&lt;p&gt;So you spend 10% of your time to get 90% of the functionality.&lt;/p&gt;

&lt;p&gt;And you're happy... no denying that.&lt;/p&gt;

&lt;p&gt;Then, you spend 90% of the time setting up the other 9%.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(the last 1% never gets done)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But that's not all...&lt;/p&gt;

&lt;p&gt;You spend another 90% of the time to make additional "10%" changes.&lt;/p&gt;

&lt;p&gt;And another 90%, and another, and another...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And THAT is your productivity.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You're exchanging a month of euphoria for a lifetime of pain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security
&lt;/h2&gt;

&lt;p&gt;Let's be honest... there is very little interest in hacking software that only 3 people use.&lt;/p&gt;

&lt;p&gt;But the more popular the software, the bigger the target on its back.&lt;/p&gt;

&lt;p&gt;Obviously, the best frameworks are the popular ones.&lt;/p&gt;

&lt;p&gt;So when an exploit happens, you feel bad... it's even worse when this exploit uses part of the code in this framework that you don't even use.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(remember those extra unnecessary features)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, that's a proper slap in the face.&lt;/p&gt;

&lt;h2&gt;
  
  
  Software is a business!
&lt;/h2&gt;

&lt;p&gt;I remember a time when frontend development only required one small library, and you were good to go.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(this was jQuery, and most of its functionality is now part of JavaScript ES6)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I also remember working on a fairly complex web app where I was able to be productive from day 1 (maybe 2) as a junior developer with &lt;strong&gt;barely any&lt;/strong&gt; experience.&lt;/p&gt;

&lt;p&gt;Try to do this today with modern React, Vue, Angular (or npm, webpack, babel, or whatever the newest thing is).&lt;/p&gt;

&lt;p&gt;And speaking of Angular... what do you think about the apps written with the v.1. of this framework? Where can you even find people who are familiar with it?&lt;/p&gt;

&lt;p&gt;Short answer - you can't.&lt;/p&gt;

&lt;p&gt;I bet the owners of those apps are not very happy people today.&lt;/p&gt;

&lt;p&gt;And what about the jQuery one I mentioned earlier?&lt;/p&gt;

&lt;p&gt;I just went and checked (because this was 10 years ago), and the app/website still runs perfectly.&lt;/p&gt;

&lt;p&gt;And the owners can still find FE developers who know almost nothing and still get good productivity out of them.&lt;/p&gt;

&lt;p&gt;Now, that's a good business!&lt;/p&gt;

&lt;h2&gt;
  
  
  Frameworks Hate Junior Developers
&lt;/h2&gt;

&lt;p&gt;If you're wondering why there are no jobs for juniors - part of the reason is that you need an insane amount of knowledge before you can do anything.&lt;/p&gt;

&lt;p&gt;Basically, Mids are the new Juniors.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(I'm speaking mostly about the frontend)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Finance Game
&lt;/h2&gt;

&lt;p&gt;Now, let's leave the easy world of web development, where things are somewhat predictable.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(no matter what, people will want to see pictures, text, and buttons)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And let's enter the world of financial modeling and algo-trading bot building.&lt;/p&gt;

&lt;p&gt;When you start a project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you have no idea what the requirements will be&lt;/li&gt;
&lt;li&gt;or where your research will lead you&lt;/li&gt;
&lt;li&gt;and what unforeseen routes will you have to take&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your code needs to (easily) withstand all of it.&lt;/p&gt;

&lt;p&gt;You need to fully own it and control it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is no room for a 1% compromise with the frameworks.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1% per day is the difference between losing all your money and becoming a billionaire.&lt;/p&gt;

&lt;p&gt;Your (frameworks) cannot (and must not) stand in your way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build vs. Change Speed
&lt;/h2&gt;

&lt;p&gt;I invite you to see the world with different eyes.&lt;/p&gt;

&lt;p&gt;People always focus on "how quick can I build something?".&lt;/p&gt;

&lt;p&gt;Instead of "how quickly can I change something?".&lt;/p&gt;

&lt;p&gt;Because remember:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You will build your software only once, but you will keep changing it forever.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, focus on optimizing the "change speed" instead of the build speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;I plan to post my progress here on &lt;strong&gt;dev.to&lt;/strong&gt; because I find it fun... and I enjoy it.&lt;/p&gt;

&lt;p&gt;If you want to join me on this journey, then I suggest you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;follow&lt;/strong&gt; my profile for more updates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bookmark&lt;/strong&gt; this article for future reference&lt;/li&gt;
&lt;li&gt;and &lt;strong&gt;like&lt;/strong&gt; this post, so more people can see it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's go and conquer the market :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. here are some cool resources:&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Best Programming Language For Finance&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;2. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;(FREE) AI For Finance Tutorial&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;3. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Starter Code For Bot Building&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>dlang</category>
      <category>javascript</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Algo-Trading Journey: Rich vs. Poor Strategy</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Wed, 16 Oct 2024 11:22:00 +0000</pubDate>
      <link>https://dev.to/programmermoney/algo-trading-journey-rich-vs-poor-strategy-2njc</link>
      <guid>https://dev.to/programmermoney/algo-trading-journey-rich-vs-poor-strategy-2njc</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" alt="algo-trading bot" width="500" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(this is part 3 of the &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; series)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In an economic downturn, both rich and poor are equally hit... BUT... the rich can fire their expenses, and the poor cannot.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Economic Modelling
&lt;/h2&gt;

&lt;p&gt;Best models come from deep insight and research.&lt;/p&gt;

&lt;p&gt;This means your algo/code is only the amplifier of you and not a replacement of you.&lt;/p&gt;

&lt;p&gt;Also, the biggest opportunities and profits come from the biggest shifts (either crashes or booms).&lt;/p&gt;

&lt;p&gt;Therefore, it's important to understand the fundamental relationships in the economy.&lt;/p&gt;

&lt;p&gt;Especially the ones that are not very intuitive and/or spark deep emotions. Because those are the ones most likely to be misunderstood, and hence, there's your opportunity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rich vs. Poor Dynamic
&lt;/h2&gt;

&lt;p&gt;This is my favorite quote:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Assumption is the mother of all f-ups :)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;People just assume that the rich handle the recession better because they have money. And sure, that helps...&lt;/p&gt;

&lt;p&gt;...BUT...&lt;/p&gt;

&lt;p&gt;...the rich are even more exposed to the changes in the economy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;they have bigger obligations &amp;amp; expenses&lt;/li&gt;
&lt;li&gt;revenue immediately drops as customers spend less&lt;/li&gt;
&lt;li&gt;clients cancel their contracts&lt;/li&gt;
&lt;li&gt;and they are left with this huge overhead&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Plus, this overhead is unsolvable.&lt;/p&gt;

&lt;p&gt;It's not like the rich can get a second or third job and make up for the lost millions in revenue.&lt;/p&gt;

&lt;p&gt;And even if the funding was provided from personal accounts, this too would melt quickly. And the rich would &lt;strong&gt;quickly&lt;/strong&gt; become poor.&lt;/p&gt;

&lt;p&gt;The stack really seems stacked against the rich.&lt;/p&gt;

&lt;p&gt;So how come (despite all of this) they always come on top?&lt;/p&gt;

&lt;h2&gt;
  
  
  Rich Superpower
&lt;/h2&gt;

&lt;p&gt;The rich have one superpower: they can fire their expenses, i.e. YOU.&lt;/p&gt;

&lt;p&gt;And you, on the other hand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;can't fire your mortgage&lt;/li&gt;
&lt;li&gt;can't fire your car payments&lt;/li&gt;
&lt;li&gt;can't fire your credit cards&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, in a way, the full weight of the recession is carried by the working class.&lt;/p&gt;

&lt;p&gt;This is kinda ironic because&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;when the times are good, most profits go to the businesses&lt;/li&gt;
&lt;li&gt;and when the times are bad, most losses go to the workers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why is this important?
&lt;/h2&gt;

&lt;p&gt;As a market participant (trader), your (and my) job is not to protest or try to change how things are.&lt;/p&gt;

&lt;p&gt;Instead, it's to use market realities to your own advantage.&lt;/p&gt;

&lt;p&gt;For example...&lt;/p&gt;

&lt;p&gt;Once you &lt;strong&gt;accept&lt;/strong&gt; this reality, you can make informed investment decisions.&lt;/p&gt;

&lt;p&gt;If you were to invest in companies or sectors that sell to the rich, you know their revenues will not fall. Because the rich were not affected.&lt;/p&gt;

&lt;p&gt;On the other hand, if you invest in businesses that sell to the poor, you know their revenues will suffer.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;There are always exceptions to this rule, e.g., alcohol sales during recessions. Which is sad because, at a time when people need their mental faculties the most, they choose to numb their minds and fall into problems even further.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Long story short: you need to do your research for every investment decision and stack these deep insights into an unstoppable profit machine.&lt;/p&gt;

&lt;p&gt;Let this be the first in your stack :)&lt;/p&gt;

&lt;h2&gt;
  
  
  Poor Strategy
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;This is not related to algo-trading, but I figured I could put it in since I'm on this topic.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The poor can have at least 1-month buffer in cash (before the recession). So whatever happens, there's at least some buffer where it's not pure panic 1 day after getting fired or something.&lt;/p&gt;

&lt;p&gt;The second thing is to have some kind of side income that is independent of their job.&lt;/p&gt;

&lt;p&gt;Even if that income is 20% of your full salary will make a &lt;strong&gt;great difference&lt;/strong&gt; once you lose your job.&lt;/p&gt;

&lt;p&gt;This was actually one of the reasons I went into algo trading. Because even in the IT sector, it's not all roses and sunshine. And getting a job is hard these days.&lt;/p&gt;

&lt;p&gt;So the question is, when are you going to do something about it?&lt;/p&gt;

&lt;p&gt;Are you going to try to start a business once you're fired? Or build something while the times are calm and prepare for the storm?&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;I plan to post my progress here on &lt;strong&gt;dev.to&lt;/strong&gt; because I find it fun... and I enjoy it.&lt;/p&gt;

&lt;p&gt;If you want to join me on this journey, then I suggest you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;follow&lt;/strong&gt; my profile for more updates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bookmark&lt;/strong&gt; this article for future reference&lt;/li&gt;
&lt;li&gt;and &lt;strong&gt;like&lt;/strong&gt; this post, so more people can see it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's go and conquer the market :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. here are some cool resources:&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Best Programming Language For Finance&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;2. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;(FREE) AI For Finance Tutorial&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;3. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Starter Code For Bot Building&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>dlang</category>
      <category>javascript</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Algo-Trading Journey: Rule-Based System</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Tue, 15 Oct 2024 07:33:55 +0000</pubDate>
      <link>https://dev.to/programmermoney/algo-trading-journey-rule-based-system-404g</link>
      <guid>https://dev.to/programmermoney/algo-trading-journey-rule-based-system-404g</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" alt="algo-trading bot" width="500" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(this is part 2 of the &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; series)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The biggest advantage of a rule-based system is that it can be backtested and verified that it works (or doesn't work) BEFORE blowing up your account and losing all your money. 💸&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Trading With Knowledge And Intuition
&lt;/h2&gt;

&lt;p&gt;If intuition was so great, 90% of retail traders wouldn't be losing money.&lt;/p&gt;

&lt;p&gt;Even better question: to whom are they losing money?&lt;/p&gt;

&lt;p&gt;To institutions.&lt;/p&gt;

&lt;p&gt;And institutions have thousands of developers building algorithms designed to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;perform under pressure (because algo feels no pressure)&lt;/li&gt;
&lt;li&gt;exploit trading behaviors (like panic trading)&lt;/li&gt;
&lt;li&gt;detect patterns that repeat over and over&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, your "intuition" is very hard to test.&lt;/p&gt;

&lt;p&gt;Who knows what you would do in some situation 2 years ago:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what would be your state of mind&lt;/li&gt;
&lt;li&gt;what news would you read at that time&lt;/li&gt;
&lt;li&gt;what would draw your attention&lt;/li&gt;
&lt;li&gt;who influenced you at that time the most&lt;/li&gt;
&lt;li&gt;and so on and so forth...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, without testing, you have NOTHING.&lt;/p&gt;

&lt;p&gt;Well, nothing except the &lt;strong&gt;&lt;em&gt;hope&lt;/em&gt;&lt;/strong&gt; you won't lose all your money. 🤦&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance Consistency
&lt;/h2&gt;

&lt;p&gt;How many people find success trading on their demo account only to start consistently losing on a real account?&lt;/p&gt;

&lt;p&gt;Too many to count.&lt;/p&gt;

&lt;p&gt;Emotions impact behavior (this is beyond obvious).&lt;/p&gt;

&lt;p&gt;So even if you have good performance... even if you're very profitable on a real account... what happens when...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you have one bad day when you're sick&lt;/li&gt;
&lt;li&gt;or you had a fight with your spouse&lt;/li&gt;
&lt;li&gt;or got into a minor car accident where your brand-new car was severely scratched&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...what happens then?&lt;/p&gt;

&lt;p&gt;Do you wipe out all the profits from the last 12 months?&lt;/p&gt;

&lt;p&gt;Or worse?&lt;/p&gt;

&lt;p&gt;My conclusion is this: allowing emotions to touch your trading account can only end in disaster.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;I plan to post my progress here on &lt;strong&gt;dev.to&lt;/strong&gt; because I find it fun... and I enjoy it.&lt;/p&gt;

&lt;p&gt;If you want to join me on this journey, then I suggest you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;follow&lt;/strong&gt; my profile for more updates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bookmark&lt;/strong&gt; this article for future reference&lt;/li&gt;
&lt;li&gt;and &lt;strong&gt;like&lt;/strong&gt; this post, so more people can see it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's go and conquer the market :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. here are some cool resources:&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Best Programming Language For Finance&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;2. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;(FREE) AI For Finance Tutorial&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;3. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Starter Code For Bot Building&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>dlang</category>
      <category>javascript</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Algo-Trading Journey: All Articles</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Tue, 27 Aug 2024 07:44:34 +0000</pubDate>
      <link>https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0</link>
      <guid>https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplm5a6ik3908h9w9xitf.gif" alt="algo-trading bot" width="500" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;-&amp;gt; no part of this project was written by AI&lt;/em&gt;&lt;br&gt;
&lt;em&gt;-&amp;gt; neither text nor code&lt;/em&gt;&lt;br&gt;
&lt;em&gt;-&amp;gt; 100% pure original human insights&lt;/em&gt;&lt;br&gt;
&lt;em&gt;-&amp;gt; #noai -&amp;gt; enjoy :)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;=&amp;gt; Follow, subscribe, bookmark... (whatever keeps you from losing this info)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Why I Build Algo-Trading Bots?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;2. &lt;a href="https://dev.to/programmermoney/algo-trading-journey-rule-based-system-404g"&gt;Why Rule-Based System Wins?&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;3. &lt;a href="https://dev.to/programmermoney/algo-trading-journey-rich-vs-poor-strategy-2njc"&gt;Rich vs. Poor Strategies&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;4. &lt;a href="https://dev.to/programmermoney/algo-trading-journey-framework-hell-1bjf"&gt;Framework Hell&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;5. &lt;a href="https://dev.to/programmermoney/algo-trading-journey-building-vs-buying-bots-1j6l"&gt;Building vs. Buying Bots&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;6. &lt;a href="https://dev.to/programmermoney/algo-trading-journey-programming-language-choice-4mad"&gt;Programming Language Choice&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;7. &lt;a href="https://dev.to/programmermoney/algo-trading-journey-randomness-causes-support-levels-108b"&gt;How Support Levels Emerge From Randomness?&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;8. Coming soon...&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;9. ...&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a id="why-build"&gt;&lt;/a&gt; Why I Build Algo-Trading Bots?
&lt;/h2&gt;

&lt;p&gt;Today, you can see thousands of people being fired over a short Zoom call. This means &lt;strong&gt;job security is officially dead&lt;/strong&gt; ☠️&lt;/p&gt;

&lt;p&gt;And you need to have a backup plan for your career (and, frankly, your life).&lt;/p&gt;

&lt;p&gt;There are only three things that can help you with that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;personal savings&lt;/li&gt;
&lt;li&gt;more/better skills&lt;/li&gt;
&lt;li&gt;extra revenue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Savings&lt;/strong&gt; buy you (limited) time until you figure something out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skills&lt;/strong&gt; make you easily employable.&lt;/p&gt;

&lt;p&gt;And &lt;strong&gt;revenue&lt;/strong&gt; buys you (permanent) freedom.&lt;/p&gt;

&lt;h2&gt;
  
  
  Skills
&lt;/h2&gt;

&lt;p&gt;All success comes from skills.&lt;/p&gt;

&lt;p&gt;And the best part is - no one can ever take them from you.&lt;/p&gt;

&lt;p&gt;Skills are the only real thing in this world you truly possess.&lt;/p&gt;

&lt;p&gt;No thief can steal them, and no government can seize them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Programming Skills
&lt;/h3&gt;

&lt;p&gt;If you're a programmer, you already have one of the best skills in the world.&lt;/p&gt;

&lt;p&gt;All you have to do is widen and deepen them.&lt;/p&gt;

&lt;p&gt;For example, you may be a good programmer...&lt;/p&gt;

&lt;p&gt;...but...&lt;/p&gt;

&lt;p&gt;How much better would you be if you knew about &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;the best programming language&lt;/a&gt; in the world.&lt;/p&gt;

&lt;p&gt;...or...&lt;/p&gt;

&lt;p&gt;What if you knew more about finance, or AI, or both?&lt;/p&gt;

&lt;p&gt;What if you merged all those skills and took this &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;(FREE) AI For Finance Tutorial&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;Opportunities are all around us.&lt;/p&gt;

&lt;p&gt;The question is - are you gonna take them?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Chose Algo-Trading Bots?
&lt;/h2&gt;

&lt;p&gt;Because of simple realization... markets will always be here.&lt;/p&gt;

&lt;p&gt;There is &lt;strong&gt;always&lt;/strong&gt; going to be someone who will want to buy or sell something.&lt;/p&gt;

&lt;p&gt;In trading, the biggest weakness is emotions. Therefore, the easiest way to gain an advantage is to &lt;strong&gt;build something without emotions&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And since I know how to code (skills), I have an advantage over all those wannabe day traders.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I Got Started?
&lt;/h3&gt;

&lt;p&gt;Initially, I started with Python. But I quickly realized I could not use it for something serious.&lt;/p&gt;

&lt;p&gt;Not that businesses built around web apps are not serious, but precision and reliability are never that important:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;backend app crashes -&amp;gt; Amazon AWS server puts it back up&lt;/li&gt;
&lt;li&gt;web app error -&amp;gt; refresh the browser&lt;/li&gt;
&lt;li&gt;mobile app freezes -&amp;gt; just exit &amp;amp; restart manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My point is, most of the time, Python is "good enough".&lt;/p&gt;

&lt;p&gt;But not here, not when it comes to handling money.&lt;br&gt;
(especially my money lol) 😅&lt;/p&gt;

&lt;p&gt;So, after a lot of research, I found &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;an ideal programming language&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Long story short, with this language, I can be confident it will &lt;strong&gt;reliably run&lt;/strong&gt; my bots even 50 years from now.&lt;/p&gt;

&lt;p&gt;At the same time, it is &lt;strong&gt;very expressive&lt;/strong&gt;, so I can do quick &lt;strong&gt;prototyping&lt;/strong&gt; without the need to switch to a "simpler" language.&lt;/p&gt;

&lt;h3&gt;
  
  
  First Problems
&lt;/h3&gt;

&lt;p&gt;Before I could write a single line of cool algo-bot logic, I needed a way to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;get the data&lt;/li&gt;
&lt;li&gt;store the data&lt;/li&gt;
&lt;li&gt;setup API communication with the market exchange&lt;/li&gt;
&lt;li&gt;implement backtest logic (to quickly test my bots)&lt;/li&gt;
&lt;li&gt;create visual charts&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In short, there was a &lt;strong&gt;bunch of boring stuff&lt;/strong&gt; before I even started coding the fun algo-bot logic.&lt;/p&gt;

&lt;p&gt;And no one wants to do that.&lt;/p&gt;

&lt;p&gt;So these were my options...&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;u&gt;1) Use Online Platforms&lt;/u&gt;
&lt;/h4&gt;

&lt;p&gt;All those platforms are &lt;strong&gt;free&lt;/strong&gt;, and that's the &lt;strong&gt;biggest problem&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because they all require me to upload my code, my algo-bot logic, to their website.&lt;/p&gt;

&lt;p&gt;This means... if you find some profitable strategy... there is no way you can prevent them from using it.&lt;/p&gt;

&lt;p&gt;And since...&lt;br&gt;
1) there is no such thing as &lt;strong&gt;infinite liquidity&lt;/strong&gt; for any strategy&lt;br&gt;
2) and those platforms have way bigger pockets than you do&lt;/p&gt;

&lt;p&gt;...you could end up thinking your strategy no longer works. But in reality, they deployed your code and &lt;strong&gt;sucked up all the liquidity&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Congratulations, you just worked insanely hard for nothing. 🤦&lt;/p&gt;

&lt;p&gt;Realize this... keeping your strategy private/secret is your &lt;strong&gt;only advantage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So, obviously, I decided to keep &lt;strong&gt;full control&lt;/strong&gt; over my code.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;u&gt;2) Build My Own "Framework"&lt;/u&gt;
&lt;/h4&gt;

&lt;p&gt;After a long and painful process, I finally managed to finish it.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;u&gt;3) Download My Starter Code&lt;/u&gt;
&lt;/h4&gt;

&lt;p&gt;Fortunately, you have a third option, and that is to &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;use my starter code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is no "secret algo-bot logic" inside&lt;/strong&gt;, but you have everything you need to start developing your bot today.&lt;/p&gt;

&lt;p&gt;Plus, you keep full control over your code.&lt;/p&gt;

&lt;p&gt;You could literally start your own algo-trading hedge fund, and no one would have access to your bot logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;I plan to post my progress here on &lt;strong&gt;dev.to&lt;/strong&gt; because I find it fun... and I enjoy it.&lt;/p&gt;

&lt;p&gt;If you want to join me on this journey, then I suggest you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;follow my profile for more updates&lt;/li&gt;
&lt;li&gt;bookmark this article for future reference&lt;/li&gt;
&lt;li&gt;and like this post, so more people can see it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's go and conquer the market :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. here are some cool resources:&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Best Programming Language For Finance&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;2. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;(FREE) AI For Finance Tutorial&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;3. &lt;a href="https://programmermoney.com" rel="noopener noreferrer"&gt;Starter Code For Bot Building&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>learning</category>
      <category>career</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>Call Multiple Functions onclick - [SOLVED]</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Sun, 12 Sep 2021 18:08:53 +0000</pubDate>
      <link>https://dev.to/programmermoney/call-multiple-functions-onclick-solved-eaf</link>
      <guid>https://dev.to/programmermoney/call-multiple-functions-onclick-solved-eaf</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR Summary
&lt;/h2&gt;

&lt;p&gt;Calling multiple functions with &lt;strong&gt;&lt;em&gt;onclick&lt;/em&gt;&lt;/strong&gt; event is very simple (and actually obvious once you hear it).&lt;/p&gt;

&lt;p&gt;So the key is to call one function but inside you can call as many other functions you want. Something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;aggregateFunc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nf"&gt;second&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's it.&lt;/p&gt;

&lt;h2&gt;
  
  
  More Details
&lt;/h2&gt;

&lt;p&gt;If you want the full code for calling multiple functions on &lt;strong&gt;&lt;em&gt;onclick&lt;/em&gt;&lt;/strong&gt; event then you can copy the code below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;bisque&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="no"&gt;orangered&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;orange&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"aggregateFunc()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  Call Multiple Functions
&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;first&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;second&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;second&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;aggregateFunc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;second&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And this is all there is to calling multiple functions with &lt;strong&gt;&lt;em&gt;onclick&lt;/em&gt;&lt;/strong&gt; event.&lt;/p&gt;

&lt;p&gt;Until next time,&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. check out my &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; articles&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Checkbox Size CSS - [SOLVED]</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Sun, 12 Sep 2021 17:28:33 +0000</pubDate>
      <link>https://dev.to/programmermoney/checkbox-size-css-solved-2944</link>
      <guid>https://dev.to/programmermoney/checkbox-size-css-solved-2944</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR Summary
&lt;/h2&gt;

&lt;p&gt;When changing the checkbox size in CSS there are two things you need to do:&lt;/p&gt;

&lt;p&gt;1) setting &lt;strong&gt;&lt;em&gt;width&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;height&lt;/em&gt;&lt;/strong&gt; on the &lt;strong&gt;&lt;em&gt;input&lt;/em&gt;&lt;/strong&gt; element&lt;/p&gt;

&lt;p&gt;But when you change the checkbox size then you have a problem because it looks out of place.&lt;/p&gt;

&lt;p&gt;2) The way to fix it is with &lt;strong&gt;&lt;em&gt;top&lt;/em&gt;&lt;/strong&gt; property along with &lt;strong&gt;&lt;em&gt;position: relative;&lt;/em&gt;&lt;/strong&gt;. This is the key to positioning it properly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nf"&gt;#big-input&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's it.&lt;/p&gt;

&lt;h2&gt;
  
  
  More details
&lt;/h2&gt;

&lt;p&gt;If you want the full code for the screenshot example on the top, here is the code that was used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;aquamarine&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;#big-input&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;#small-input&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-2px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"checkbox"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"big-input"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Big checkbox........&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"checkbox"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"normal"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Normal checkbox&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"checkbox"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"small-input"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Small checkbox..&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's all there is to setting checkbox size with CSS.&lt;/p&gt;

&lt;p&gt;Until next time,&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. check out my &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; articles&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>H3 Font Size</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Sun, 12 Sep 2021 16:37:27 +0000</pubDate>
      <link>https://dev.to/programmermoney/h3-font-size-39am</link>
      <guid>https://dev.to/programmermoney/h3-font-size-39am</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR Summary
&lt;/h2&gt;

&lt;p&gt;Checking the &lt;strong&gt;&lt;em&gt;h3&lt;/em&gt;&lt;/strong&gt; font size in the browser's inspect code we get that default size is &lt;strong&gt;&lt;em&gt;1.17em&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1z4pbo04ktvr92wgve7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1z4pbo04ktvr92wgve7.png" alt="h3 font size" width="800" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But how much is that in pixels? According one of many tools you can find online we get the number &lt;strong&gt;&lt;em&gt;18.72px&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxb6pbmw190pi0ygaajt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxb6pbmw190pi0ygaajt.png" alt="em to pixels" width="742" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course if you wanted to change the default &lt;strong&gt;&lt;em&gt;h3&lt;/em&gt;&lt;/strong&gt; font size you can do it easily in CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h3&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's it.&lt;/p&gt;

&lt;p&gt;Until next time,&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. check out my &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; articles&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How To Check If jQuery Is Loaded?</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Fri, 10 Sep 2021 10:39:48 +0000</pubDate>
      <link>https://dev.to/programmermoney/how-to-check-if-jquery-is-loaded-2n</link>
      <guid>https://dev.to/programmermoney/how-to-check-if-jquery-is-loaded-2n</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR Summary
&lt;/h2&gt;

&lt;p&gt;Easiest way to check if jQuery is loaded is by trying to use it.&lt;/p&gt;

&lt;p&gt;However if this check is going to be part of some other logic (not just one-off test you do during development), then your entire code will break (throw an error).&lt;/p&gt;

&lt;p&gt;So to prevent this you need to wrap it up with &lt;code&gt;try-catch&lt;/code&gt; blocks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#mydiv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;WORKING!!!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mydiv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;BROKEN!!!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's it.&lt;/p&gt;

&lt;h2&gt;
  
  
  More Details
&lt;/h2&gt;

&lt;p&gt;Obviously there could be some exceptions (although very rare) to the above example.&lt;/p&gt;

&lt;p&gt;First of all let me provide you with the full code that was used to generate the image on the top:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;CyberBotMachines&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"style.css"&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script
      &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://code.jquery.com/jquery-3.6.0.min.js"&lt;/span&gt;
      &lt;span class="na"&gt;integrity=&lt;/span&gt;&lt;span class="s"&gt;"sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="&lt;/span&gt;
      &lt;span class="na"&gt;crossorigin=&lt;/span&gt;&lt;span class="s"&gt;"anonymous"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
        &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;royalblue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
        &lt;span class="nl"&gt;padding-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
        &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"mydiv"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;TESTING jQuery ...&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
      &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#mydiv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;WORKING!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mydiv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;BROKEN!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"script.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that will result in the screen like this:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmw11jgi21k7awulp57n0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmw11jgi21k7awulp57n0.png" alt="how to check if jquery is loaded success" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Regarding the exceptions I mentioned earlier, it is possible that some other library is also using the same handle &lt;code&gt;$&lt;/code&gt; as jQuery.&lt;/p&gt;

&lt;p&gt;And that's why we couldn't use simpler solution like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;working&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;not working&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(also this throws an error if &lt;code&gt;$&lt;/code&gt; is not declared so your entire code breaks, or you have to wrap this in &lt;code&gt;try-catch&lt;/code&gt; as well)&lt;/p&gt;

&lt;p&gt;But it is far less likely some other library will define variable &lt;code&gt;jQuery&lt;/code&gt; by accident. And another option you have is to use this piece of code below to check if jQuery is loaded. And also this code will not throw an error if jQuery is not loaded.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jQuery&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jQuery is loaded&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jQuery is not loaded&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that is all there is to checking whether jQuery is loaded or not.&lt;/p&gt;

&lt;p&gt;Until next time,&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. check out my &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; articles&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>jQuery Clear innerHTML</title>
      <dc:creator>ProgrammerMoney.com</dc:creator>
      <pubDate>Wed, 08 Sep 2021 08:27:53 +0000</pubDate>
      <link>https://dev.to/programmermoney/jquery-clear-innerhtml-2g2j</link>
      <guid>https://dev.to/programmermoney/jquery-clear-innerhtml-2g2j</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR Summary
&lt;/h2&gt;

&lt;p&gt;Most important thing you need to remember when trying to clear &lt;em&gt;innerHTML&lt;/em&gt; with jQuery is that you &lt;strong&gt;do not&lt;/strong&gt; touch &lt;em&gt;innerHTML&lt;/em&gt; at all.&lt;/p&gt;

&lt;p&gt;What you need to do is use &lt;code&gt;.html()&lt;/code&gt; function that is already available in jQuery.&lt;/p&gt;

&lt;p&gt;Here is the code example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"myclass"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;HTML one&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"myclass"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;HTML two&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"myclass"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;HTML three&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="c1"&gt;// this is how you can read HTML&lt;/span&gt;
  &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#container&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;html&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="c1"&gt;// this is how you delete HTML&lt;/span&gt;
  &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#container&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;html&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that is all you need to know about clearing &lt;em&gt;innerHTML&lt;/em&gt; with jQuery.&lt;/p&gt;

&lt;p&gt;Until next time,&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Will&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. check out my &lt;a href="https://dev.to/programmermoney/algo-trading-bots-how-why-i-build-them-4mc0"&gt;Algo-Trading Journey&lt;/a&gt; articles&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
