<story><title>More challenging projects every programmer should try</title><url>https://web.eecs.utk.edu/~azh/blog/morechallengingprojects.html</url></story><parent_chain><item><author>pjc50</author><text>I worked on a unique HFT system which was capable of starting the response packet before the incoming packet&amp;#x27;s final byte had arrived. Negative latency. If it mispredicted the future, it would simply scramble the trailer and cause the packet to fail UDP checksum.&lt;p&gt;It didn&amp;#x27;t make money in the real world because the quality of decision that could be made at that speed wasn&amp;#x27;t good enough.</text></item><item><author>henning</author><text>As someone who has played with writing trading bots but never traded them with real money, some advice: if your results seem too good to be true, they probably are. Your trading bot may be doing unrealistic things or its results may not be reliable if the following are true:&lt;p&gt;- You are trading in a market with low liquidity or one that is controlled by a small number of market participants. I&amp;#x27;m not an expert but I think this would apply more to markets like penny stocks and less to big markets like forex for major currency pairs&lt;p&gt;- You are not taking transaction costs into account or not doing so properly&lt;p&gt;- Your bot makes a low number of trades, making the results close or equivalent to lucky coin flips&lt;p&gt;- Your bot is simply making trades that cannot be executed, or may be doing simulated trades of something that is not actually tradable.  This applies to a large number of research papers that assume you can just buy and trade the S&amp;amp;P 500 itself. You can trade ETFs that are tied to an index but an index is not a tradable instrument in of itself. Once you realize this, a lot of papers seem very weird&lt;p&gt;- You are not modelling other aspects of the trading process realistically, such as assuming the bot has infinite funds to trade, allowing it to take unlimited losses and continue trading when in reality you&amp;#x27;d be hit with a margin call and your trading would be stopped&lt;p&gt;- Your code is committing any number of data snooping errors where the bot is asked to trade at time A (say the open of a trading session) but has access to future data (say the closing price of that day, future data that would not actually exist in a live environment)&lt;p&gt;- Depending on what you believe about how market conditions change over time, your bot may have worked in the past but would not work if used today. I.e., the market may have adapted to whatever edge your bot may have discovered&lt;p&gt;There are probably lots more pitfalls I don&amp;#x27;t even know about since I&amp;#x27;m not an actual trader.&lt;p&gt;I&amp;#x27;m not discouraging anyone from playing around or trying things, of course. I think it&amp;#x27;s great fun, which is why I do it.&lt;p&gt;Here&amp;#x27;s the good news: if you realize you don&amp;#x27;t actually have an edge and avoid risking your hard-earned money, you come out ahead of almost all people who ever trade.</text></item></parent_chain><comment><author>djoldman</author><text>This was an open secret.
You can also send the start of a datagram on every incoming packet and then abort if you don&amp;#x27;t want to add&amp;#x2F;modify&amp;#x2F;delete an order by splitting your datagram into multiple packets.  This worked on some exchanges because they ordered add&amp;#x2F;modify&amp;#x2F;deletes by when the beginning of the packet was received as opposed to the end.&lt;p&gt;If you do too much of this you will get angry exchange network people yelling at you as they may consider it spam&amp;#x2F;ddos.  Some exchanges explicitly limit this.&lt;p&gt;It&amp;#x27;s also worth considering the possible gain. If you&amp;#x27;re in the fpga (0-150ns) or cpu(300ns-3us) space, the math can come out differently.</text></comment>
<story><title>More challenging projects every programmer should try</title><url>https://web.eecs.utk.edu/~azh/blog/morechallengingprojects.html</url></story><parent_chain><item><author>pjc50</author><text>I worked on a unique HFT system which was capable of starting the response packet before the incoming packet&amp;#x27;s final byte had arrived. Negative latency. If it mispredicted the future, it would simply scramble the trailer and cause the packet to fail UDP checksum.&lt;p&gt;It didn&amp;#x27;t make money in the real world because the quality of decision that could be made at that speed wasn&amp;#x27;t good enough.</text></item><item><author>henning</author><text>As someone who has played with writing trading bots but never traded them with real money, some advice: if your results seem too good to be true, they probably are. Your trading bot may be doing unrealistic things or its results may not be reliable if the following are true:&lt;p&gt;- You are trading in a market with low liquidity or one that is controlled by a small number of market participants. I&amp;#x27;m not an expert but I think this would apply more to markets like penny stocks and less to big markets like forex for major currency pairs&lt;p&gt;- You are not taking transaction costs into account or not doing so properly&lt;p&gt;- Your bot makes a low number of trades, making the results close or equivalent to lucky coin flips&lt;p&gt;- Your bot is simply making trades that cannot be executed, or may be doing simulated trades of something that is not actually tradable.  This applies to a large number of research papers that assume you can just buy and trade the S&amp;amp;P 500 itself. You can trade ETFs that are tied to an index but an index is not a tradable instrument in of itself. Once you realize this, a lot of papers seem very weird&lt;p&gt;- You are not modelling other aspects of the trading process realistically, such as assuming the bot has infinite funds to trade, allowing it to take unlimited losses and continue trading when in reality you&amp;#x27;d be hit with a margin call and your trading would be stopped&lt;p&gt;- Your code is committing any number of data snooping errors where the bot is asked to trade at time A (say the open of a trading session) but has access to future data (say the closing price of that day, future data that would not actually exist in a live environment)&lt;p&gt;- Depending on what you believe about how market conditions change over time, your bot may have worked in the past but would not work if used today. I.e., the market may have adapted to whatever edge your bot may have discovered&lt;p&gt;There are probably lots more pitfalls I don&amp;#x27;t even know about since I&amp;#x27;m not an actual trader.&lt;p&gt;I&amp;#x27;m not discouraging anyone from playing around or trying things, of course. I think it&amp;#x27;s great fun, which is why I do it.&lt;p&gt;Here&amp;#x27;s the good news: if you realize you don&amp;#x27;t actually have an edge and avoid risking your hard-earned money, you come out ahead of almost all people who ever trade.</text></item></parent_chain><comment><author>inopinatus</author><text>From time to time there comes a remark that is the absolute epitome of Hacker News, and I mean that earnestly and without any backhanded rancour, and I thank you for this flawless specimen.</text></comment>