Trend Following (Algo) Strategy

The premise of this strategy is that whatever is happening will continue happening (especially when it comes to a strong trend). In this example, I’m using 5 consecutive green candles as an indicator of a strong trend. Because something is obviously causing such a clear move in one direction. entry position (white dot) and exit position (yellow square) In the code below, using the Badger […]

Read More...

Candle Counting (Algo) Strategy

In random events, “streaks” have low probability, and this strategy is trying to take advantage of this fact by betting against the “streak”. Here we see 3 consecutive red candles before the algorithm enters the trade: entry position (white dot) and exit position (yellow square) In our code, using the Badger algo-trading framework, we can see that the actual candles taken into consideration are… …but […]

Read More...

Moving-Average Crossover (Algo) Strategy

Moving-average crossover strategy assumes that we can detect the change in overall trend by catching it early on a shorter time frame. entry position (white dot) and exit position (yellow square) In the code, using the Badger algo-trading framework, we’re comparing 10 and 20-candle moving average (those are 1-minute candles). First we need to verify that the ma10 is below the ma20. Then once it […]

Read More...

Price Percentile (Algo) Strategy

Similar to local minimum strategy, the idea is to wait for price to go somewhat to the extreme and then wait for pullback/retracement. The degree to which you want the price to go to extreme (before entering the trade) is completely up to you. In this code example using the Badger algo-trading framework, I set the percentile to 20% (i.e. when price was at the […]

Read More...

Local Minimum (Algo) Strategy

This strategy is based on the observation that the price tends to reverse/retrace from extremes and this algorithm captures such behavior. When the price reaches local minimum (20 candles), the trade is executed, expecting the price correction in opposite direction. entry position (white dot) and exit position (yellow square) Below is the code that uses Badger algo-trading framework for backtesting and visualization: // LOCAL MINIMUM […]

Read More...

Buy And Hold (Algo) Strategy

The simplest code example for Badger algo-trading framework is “buy and hold” strategy where your main focus is picking a good entry point. This code example picks the entry point at random (at the beginning of the backtestPeriod). entry position (white dot) and exit position (yellow square) But you can decide based on variety of factors like: // you can also add custom variables here […]

Read More...

The Best Programming Language For Finance

You probably never heard of it, but it’s D. What is D? A programming language with the simplicity of Python and speed of C (or extremely close to it). And the syntax? Very familiar and very simple. If you ever coded in JavaScript, C, C++ … you’ll feel right at home. import std.stdio : print = writeln; void main() { auto numbers = [1, 2, […]

Read More...

Algo-Trading Framework

If you’re reading this, you’ve probably seen the effectiveness of the Badger algo-trading framework in action on YouTube. In fact, the name Badger was chosen because they are… …exactly what you need to survive in dynamic markets. And if you download it, you don’t have to bother with: All of these boring and tedious tasks are done for you. ✅ Therefore, you can completely focus […]

Read More...