Helping you Master EasyLanguage https://easylanguagemastery.com Helping you Master EasyLanguage Fri, 15 Aug 2025 14:51:05 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.2 https://easylanguagemastery.com/wp-content/uploads/2019/02/cropped-logo_size_icon_invert.jpg Helping you Master EasyLanguage https://easylanguagemastery.com 32 32 EasyLanguage Master has passed on https://easylanguagemastery.com/getting-started/easylanguage-master-has-passed-on/?utm_source=rss&utm_medium=rss&utm_campaign=easylanguage-master-has-passed-on https://easylanguagemastery.com/getting-started/easylanguage-master-has-passed-on/#respond Fri, 15 Aug 2025 14:27:03 +0000 https://easylanguagemastery.com/?p=535912

Today is a very sad day for me. Sam Tennis, my programmer and writing partner, died today of sepsis. He was diagnosed with cancer eight months ago but finally succumbed to sepsis of the gallbladder.

Sam was the originator of EasyLanguage. He was the lead programmer at Omega Research (which became TradeStation) who created it all. And, of course, he was a masterful EasyLanguage programmer.

Sam was more than brilliant to me—he was my best friend. We met together on Tuesdays, Thursdays, and Saturdays for three hours each, for nearly three years while writing The Definitive Guide to TradeStation’s EasyLanguage & OOEL Programming. It became a 1,300-page, two-volume opus. 

We shared writing, we shared jokes, we programmed together, we shared life stories, and we shared love.

Sam lived in south Florida and I in Southern California, so our meetings were all by Zoom. We shared a love of programming, a love of TradeStation, and a love of family. I’ve known Sam for more than 39 years, though I hadn’t seen him in person since 1988. In November, we both went to TradeStation’s “Crossroads Summit,” which was a magnificent gathering. It was so great to spend time with my old friend, have dinners, share drinks, and listen to lectures. We didn’t know Sam was sick yet.

Sam will be missed by many, not only for his kindness and generosity but for his brilliant mind. I could give him a description of what I wanted, and he grasped it instantly and had it programmed before we were off our phone call. And not just a great programmer—he was also a great diagnostician.

I called Murray Ruggiero (also deceased) one night at midnight to help me with some code that I couldn’t get to compile. Unbeknownst to me, Murray called Sam to ask for his help with my problem. In about 30 minutes, Murray called me back and said, “What’s wrong with your eyes? Can’t you tell a 1 from a lowercase L?” Sam had solved it.

Sam will be missed by many. I will forever miss him. The world has lost a great man.

]]>
https://easylanguagemastery.com/getting-started/easylanguage-master-has-passed-on/feed/ 0
The S&P Overnight Edge (Update for 2025) https://easylanguagemastery.com/getting-started/the-sp-overnight-edge-update-for-2025/?utm_source=rss&utm_medium=rss&utm_campaign=the-sp-overnight-edge-update-for-2025 https://easylanguagemastery.com/getting-started/the-sp-overnight-edge-update-for-2025/#respond Wed, 14 May 2025 13:13:12 +0000 https://easylanguagemastery.com/?p=535653 The overnight trading action of the S&P has a decisive edge. Did you know that a lot of the gain of the S&P happens at night? This provides a unique opportunity to build a trading system. 

But is that edge still holding up?

The overnight edge of the S&P is something I’ve written about before. If you’re not familiar with it, you can check out the article, “The Overnight Edge.”

Here’s a quick refresher.

I put together a trading system to test the overnight edge by buying at the current close and closing out the trade at the next day’s open. So, our trade is in play during the overnight session. On the flip side, I’ve also tested holding a trade only during the day by buying at the open and selling at the close. If you want to dive deeper into the details, just head over to the article I mentioned earlier.

S&P Points During Overnight Since 2020

What I want to focus on is what has it been doing recently. So, let’s take a look at the results since 2020.

  • January 1, 2020 to May 14, 2025
  • No slippage or commission cost deducted.
  • The symbol used was @ES.D.

So, let’s dive in and see what kind of action we can find during the day session. It’s always exciting to explore new possibilities and see if we can uncover some profitable patterns. Worst case scenario, we learn a thing or two along the way, right?

S&P Points Gained During Day Since 2020

In contrast to the Overnight equity curve we can see new equity highs being made here. Thus, it looks like S&P gains are happening more often during the day session.Let’s put the results in a table to better compare. 

Holding Overnight

Holding During Day

Net Profit

$44,562

$53,037

Profit Factor

1.08

1.07

Total Trades

1147

1147

Avg.Trade Net Profit

$38.85

$46.24

Max Drawdown

$50,250

$45,325

NP vs. DD

0.9

1.1

Let’s add a 200-bar simple moving average to act as a regime filter. We’ll take long trades only when price is above the 200-bar simple moving average. 

Holding Overnight

Holding During Day

Overnight W/Regime

Holding Day W/Regime

Net Profit

$44,562

$53,037

$72,850

$7,087

Profit Factor

1.08

1.07

1.22

1.01

Total Trades

1147

1147

850

850

Avg.Trade Net Profit

$38.85

$46.24

$85.71

$8.34

Max Drawdown

$50,250

$45,325

$33,313

$34,412

NP vs. DD

0.9

1.1

2.2

0.2

Adding the regime filter did help the Night Session but it hurt the Day Session. Interesting! For the Day session we reduce the average profit per trade and the total net profit. On the other hand, with the night session we see nice improvements with the metrics.

Trading during the night session when the S&P is in a bull phase, looks promising. However, trading during the day does not look so hot. In short, this may suggest that the edge is in holding during the over night session.

Below is the equity curve of of taking long trades during the Night Session when the S&P is in bull phase.

What About Shorting?

With a little research I was able to test the optimal shorting is shorting the Day Session during Bear Markets (Below 200-day simple moving average).Below is a table containing the best shorting setup and the best long setup.

Short Day Session During Bear Markets

Long Night Session During Bull Markets

Net Profit

$28,288

$72,850

Profit Factor

1.13

1.22

Total Trades

297

850

Avg.Trade Net Profit

$95.24

$85.71

Max Drawdown

$20,250

$33,313

NP vs. DD

1.4

2.2

What Can I Do With This Info?

The above strategies  are not trading systems. They are market studies to help point us in the right direction. They’re more like our trusty market compasses, pointing us in the right direction and giving us some clues about where we might want to focus our trading system-building efforts.The data is clear: since 2020, the S&P gains have tilted toward the day session, but only on the surface. Once we factor in market regime using a 200-bar simple moving average, the overnight session during bull markets becomes the standout performer—yielding a 2.2 Net Profit to Drawdown ratio and over $72K in net profits. That’s a dramatic improvement over the raw overnight edge or day trading alone.On the flip side, the best shorting opportunity appears in the day session during bear markets. This regime-aware approach reveals that profitable edges in the S&P aren’t just about time of day—they’re about context. The market environment (bull vs. bear) plays a critical role in whether the edge appears or vanishes.So what does this mean for the average retail algo trader?

  1. Divide and Conquer Your Strategy Design. Build separate systems for long and short trades—don’t lump them together. Focus your long entries on the overnight session during bull markets, and your short entries on the day session during bear markets. This alone can eliminate a ton of noise and increase strategy robustness.
  2. Use Market Regime as a Gatekeeper. A simple 200-bar moving average filter turned a mediocre strategy into a high-performing one. This is a powerful reminder: market regime filtering is not optional—it’s essential. It sharpens the edge and smooths the equity curve.
  3. Reconsider When You Trade. Most retail traders default to day session strategies because that’s when markets are “active.” But this study shows that some of the most profitable, lowest-drawdown opportunities exist when you’re asleep. A VPS and automated execution can help you capitalize on this overlooked edge.
  4. Non-Obvious Opportunity: Portfolio Timing Allocation. If you’re building a portfolio of systems, you might consider **segmenting exposure based on session and regime**, rather than spreading capital evenly. For instance, overweight your portfolio toward the long overnight strategy when in a bull market, and shift exposure to short day strategies during bear markets. This dynamic capital allocation could significantly enhance returns and reduce drawdowns.

The takeaway? Don’t just build “an S&P strategy.” That’s too vague. Build for session and regime. You’ll uncover edges others ignore—and in a market as competitive as the S&P, that might make all the difference.

]]>
https://easylanguagemastery.com/getting-started/the-sp-overnight-edge-update-for-2025/feed/ 0
Swarm Mode: An Approach to Trading System Diversification https://easylanguagemastery.com/getting-started/swarm-mode-an-approach-to-trading-system-diversification/?utm_source=rss&utm_medium=rss&utm_campaign=swarm-mode-an-approach-to-trading-system-diversification https://easylanguagemastery.com/getting-started/swarm-mode-an-approach-to-trading-system-diversification/#comments Wed, 05 Mar 2025 14:37:03 +0000 https://easylanguagemastery.com/?p=535389

Optimization paralysis—we've all been there. Five promising systems, but which one do you actually trade? What if the answer is: all of them?

When developing trading systems, you'll often face a common dilemma. After running optimizations or combining different filters, you don't end up with just one ideal system. Instead, you're left staring at 4, 8, 12, or even 16 different variations that all look promising. Traditionally, traders would analyze these candidates, select the "best" one, and discard the rest.

But what if there's a better approach?

In this article, I'll introduce you to a concept I call "Swarm Mode." In technical terms, this is a form of ensemble trading, similar to the machine learning technique known as Bagging (Bootstrap Aggregating). But "Swarm Mode" just sounds better, doesn't it?

The core idea is simple yet powerful: instead of selecting a single system, we'll deploy multiple variations of a core strategy simultaneously, using micro contracts to manage our overall risk exposure. This approach provides instant diversification within a single trading concept and can potentially lead to more robust performance across varying market conditions.

Let's dive in and see how this works in practice using Build Alpha and Larry Connors' popular Two-Period RSI strategy as our foundation.

The Foundation: Larry Connors' Two-Period RSI Strategy

Larry Connors' Two-Period RSI strategy has stood the test of time as a reliable mean-reversion approach for stock index markets, particularly the S&P 500. Its enduring popularity stems from its simplicity and effectiveness, making it an ideal candidate to demonstrate our Swarm Mode concept.

The basic premise of this strategy is straightforward:

  • Buy when the two-period RSI falls below 30 (indicating an oversold condition)
  • Sell when the two-period RSI rises above 70 (indicating an overbought condition)

To implement this strategy using Build Alpha, we'll start by coding the core rules. If you're not familiar with Build Alpha, it's a powerful system development platform that allows you to quickly test and optimize trading ideas without writing code. You can learn more about Build Alpha by checking out this article, The No-Code Solution for Generating Winning Trading Systems.

For our implementation, we'll configure Build Alpha with these initial parameters:

  • Market: ES (E-mini S&P 500 futures)
  • Direction: Long only
  • Entry condition: Two-period RSI < 30
  • Exit conditions:
    • Two-period RSI > 70, or
    • Maximum hold time reached (starting with 3 days, and also testing 4 and 5 days)
  • Stop loss: Testing ATR-based stops of 4X, 6X, and 8X 
  • Testing period: 2006-2022 (in-sample), with 2023-2025 reserved for out-of-sample validation
  • Commission $2.50 per trade
  • Slippage $12.50 per trade

The 2006 starting date was chosen specifically because it marks the beginning of the fully electronic futures market era, giving us a consistent data environment.

For execution settings, we'll enter on the next bar's open, apply realistic slippage and commission values, and limit our strategy to two rules per entry—keeping things elegantly simple.

When we run this basic setup through Build Alpha, it quickly generates a set of variations based on our parameters. The system checks that we have valid prices, applies our two-period RSI < 30 entry condition, and tests our various exit combinations.Below is a typical equity curve:

Highlighted blue line is out-of-sample.

This foundational strategy produces a reasonably good equity curve, but what if we could enhance it further? That's where the next step in our process comes in.

Enhancing the Base Strategy

Now that we have our foundational strategy in place, we can explore how to enhance it using Build Alpha's powerful optimization capabilities. This is where our journey toward Swarm Mode truly begins.

Rather than just fine-tuning parameters of the base strategy, we'll take a more sophisticated approach by looking for complementary filters that can improve our strategy's performance. To accomplish this, I'll leverage Build Alpha's extensive library of technical indicators.

In Build Alpha, I'll select nearly 4,000 different indicators from the legacy single signals menu. This gives the system a vast array of potential filters to test in combination with our two-period RSI entry condition. The goal is to find additional conditions that, when combined with our core RSI signal, produce superior results.

For this initial optimization, I'll use the fitness function of "net profit versus drawdown"—a balanced metric that rewards both profitability and risk management. I'll configure the testing to ensure:

  • 40% of data is reserved for out-of-sample validation
  • A minimum of 50 trades in both in-sample and out-of-sample periods

When we run this optimization, Build Alpha quickly tests thousands of combinations and identifies several promising filters. Let's examine what it found:

At the top of our results list is a system that combines our two-period RSI < 30 signal with a price action filter. Specifically, it requires that the open from three bars ago is less than or equal to the low from five bars ago. This particular combination generates an impressive equity curve with excellent in-sample and out-of-sample performance.

Scrolling through the results, we find several variations with similar entry conditions but different stop loss values. Some use tighter stops while others employ wider ones, all producing slightly different performance metrics.

Further down, we discover another cluster of promising systems. These use a "value high" indicator as part of the filter, generating distinctly different equity curves that also show promising performance.

Continuing our exploration, we find systems using  Kaufman Efficiency Ratio as a filter, each with its own performance characteristics and equity curve patterns.


And herein lies our dilemma—which system should we actually trade?

Traditionally, traders would analyze these results, select what appears to be the most robust system, and begin trading it. In this case the very 1st equity curve with the price filter looks the beset. But this approach discards valuable information and alternative systems that might perform better in future market conditions. In short, how do we know which version will work best moving forward?

We don't know! This is precisely where our Swarm Mode concept offers a compelling alternative.

The Swarm Mode Concept

The advent of micro contracts in futures trading has created a fascinating opportunity to rethink our approach to system deployment. Traditional futures contracts, even E-mini contracts, often require significant capital allocation for each trade. But micro contracts, at one-tenth the size of an E-mini, allow for more granular position sizing and risk management.

This is where the Swarm Mode concept becomes truly powerful.

Instead of choosing a single system from our optimization results, what if we traded multiple systems simultaneously? Here's the core idea: Rather than allocating our capital to a single approach, we can spread it across several variations of our base strategy.

For example, let's say we were planning to trade one E-mini S&P 500 contract with our two-period RSI strategy. With micro contracts, we could instead trade ten different variations of that strategy, each trading a single micro contract. The total position size remains equivalent to one E-mini contract, but our approach is now diversified across multiple system variations.

Why is this beneficial? Because we simply don't know with certainty which system variation will perform best in future market conditions.

Even the most promising backtest results can falter in live trading due to luck, changing market regimes, or other unforeseen factors. By trading a "swarm" of systems, we're acknowledging this uncertainty and creating instant diversification within our core trading concept.

This approach embodies the statistical principle that a collection of diverse models often outperforms any single model—the same principle that powers ensemble methods in machine learning and statistics.

To implement Swarm Mode effectively, we want to select systems that:

  1. Share the same core concept (in our case, the two-period RSI)
  2. Employ meaningfully different secondary filters
  3. Use varying parameter settings (like different stop losses or hold times)
  4. Demonstrate solid performance individually
  5. Ideally, enter and exit the market at somewhat different times

The goal isn't to simply pick the top five systems from our optimization results. Instead, we want to create a diverse portfolio of approaches to the same trading concept. This diversity is what gives our swarm its robustness.

In the next section, we'll walk through the process of selecting five distinct systems from our optimization results and combining them into a Swarm Mode portfolio.

I'll make that correction. Let me update this part of the section:

Creating a Swarm Portfolio

With our concept in place, let's now create an actual Swarm Mode portfolio using our optimization results. The goal is to select five distinct systems that all leverage the two-period RSI concept but approach it in different ways.

Selecting Diverse Systems

Let's start with our top performer, which combines the two-period RSI with a specific price action filter (where the open from three bars ago is less than or equal to the low from five bars ago). This system produced an excellent equity curve with strong metrics, so it's a natural first choice for our swarm.

RSI-Swarm, Sub-System 01

RSI-Swarm, Sub-System 1

For our second selection, I'll choose another price-based system, but one with a different filter. This system uses a condition where the high from three bars ago is less than or equal to the close from eight bars ago, combined with our two-period RSI signal. While similar in concept to our first selection, it uses different price points and lookback periods, creating distinction in its entry signals.

RSI-Swarm-SubSystem-02-EQ-Curve

RSI-Swarm, Sub-System 2

Moving further down our results list, I notice a cluster of systems using the "value high" indicator. This represents a fundamentally different approach from our price action filters, so I'll select the best performer from this group as our third system.

RSI-Swarm, Sub-System 03

RSI-Swarm, Sub-System 3

For our fourth system, I'll change the fitness function in Build Alpha from "net profit versus drawdown" to simply "net profit." This gives us a different perspective and brings a Value Close indicator to the top of our new results. This indicator is distinct from the value high in our third system, adding more diversity to our portfolio.

RSI-Swarm, Sub-System 4

RSI-Swarm, Sub-System 4

Finally, for our fifth system, I find an entirely different indicator - the Kaufman Efficiency Ratio (KER) - which, when combined with our two-period RSI entry condition, produces a solid equity curve with unique characteristics compared to our other selections.

RSI-Swarm, Sub-System 5

RSI-Swarm, Sub-System 5

Now we have five distinct systems, each sharing the core two-period RSI concept but implementing it with different complementary filters:

  1. Price action filter (open 3 bars ago ≤ low 5 bars ago)
  2. Price action filter (high 3 bars ago ≤ close 8 bars ago)
  3. Value high indicator
  4. Value close indicator
  5. Kaufman Efficiency Ratio

Each system also has its own unique combination of stop loss values and maximum hold times, further diversifying our approach.

Combining Systems into a Swarm

After selecting and validating our five individual systems, the next critical step is to analyze how they perform together as a swarm of systems. This analysis answers the key question: Does the Swarm Mode approach actually deliver better results than any single system?

To find out, I first loaded each of our five systems into a chart and traded a single contract for each strategy. I moved the historical data to the out of sample data segment, February 28, 2025 with three years of historical data. The results are in the table below. Each system result represents a possible outcome we might have faced if we traded on a single strategy. Naturally, they are all different, and our dilemma in building systems is we don't know for sure which one will work going forward.

System 1

System 2

System 3

System 4

System 5

Net Profit

$59,663

$34,755

$86,807

$89,613

$55,048

Profit Factor

3.70

1.57

2.11

2.04

1.89

Total Trades

30

39

76

80

58

Avg.Trade Net Profit

$1,989

$892

$1,143

$1,120

$949

Max Drawdown

$13,943

$24,068

$24,070

$24,973

$19,718

NP vs. DD

4.3

1.4

3.6

3.6

2.8

Next, I loaded all five strategies into Portfolio Analyst, my preferred portfolio analysis tool. This tool allows us to see the combined performance as if we were trading all five systems simultaneously, with each system allocated two micro contracts.

The portfolio results are impressive: Trading all five strategies together generated $68,865 in profit over our three-year out-of-sample period. Remember, this is exclusively using data that was not part of our original optimization—true unseen data that provides a realistic picture of how these systems might perform in live trading.


System 1

System 2

System 3

System 4

System 5

Swarm

Net Profit

$59,663

$34,755

$86,807

$89,613

$55,048

$65,117

Profit Factor

3.70

1.57

2.11

2.04

1.89

2.05

Total Trades

30

39

76

80

58

283

Avg.Trade Net Profit

$1,989

$892

$1,143

$1,120

$949

$230

Max Drawdown

$13,943

$24,068

$24,070

$24,973

$19,718

$12,773

NP vs. DD

4.3

1.4

3.6

3.6

2.8

5.1

Looking at the detailed performance metrics, we can see the Combined strategy make about average profit compared to the other five. The real benefit comes in the drawdown. The strategies worked together in such a way we have an improve risk adjusted return. Namely, the NPDD is 5.1 which is the best in the bunch.

The recommend account size is $65,400. Below are image of the equity curve, drawdown and periodic returns table.

It's important to note that future drawdowns are typically larger than what we see in backtests, so prudent risk management remains essential. However, the diversification effect of trading five distinct systems helps mitigate this risk compared to trading any single system with the same total position size.

The periodic returns analysis further confirms the consistency of this approach, showing positive returns across most time periods.

This portfolio analysis demonstrates the core benefit of the Swarm Mode approach: By combining multiple variations of our core strategy, we create a more robust trading system that maintains the profit potential while potentially reducing overall risk through diversification.

Conclusion and Key Takeaways

The Swarm Mode approach to system trading represents a powerful technique in how we can deploy trading strategies in today's markets. By leveraging the flexibility of micro contracts, we can transform the common dilemma of "which system should I trade?" into a strategic advantage.

Swarm Mode isn’t about creating a diversified portfolio—it’s a way to increase the robustness of an individual strategy before including it in a portfolio. The core idea: Instead of picking one version of a strategy and hoping it survives, trade a swarm of variations.

This isn’t an alternative to a diversified portfolio—it's a way to make a single strategy more robust before it’s even added to a portfolio.

Standard Portfolio → 5 diversified strategies, each trading 1 mini contract.
Swarm Mode → Each of those 5 strategies now trading 5 sub-systems, each with 2 micro contracts.

As we've demonstrated with our two-period RSI example, creating a swarm of related but distinct trading systems offers several compelling benefits:

  1. Enhanced Robustness: By diversifying across multiple variations of our core strategy, we're less vulnerable to the failure of any single approach.
  2. Smoother Equity Curve: The portfolio effect tends to smooth out the equity curve, as different systems often experience drawdowns at different times.
  3. Improved Risk Adjusted Returns: Reduced drawdown.
  4. Reduced Optimization Anxiety: Rather than agonizing over which single system is "best," we can select a diverse set of promising candidates.

It's worth noting that what I'm calling "Swarm Mode" is essentially a form of ensemble trading, similar to the machine learning technique known as Bagging (Bootstrap Aggregating). These ensemble methods are well-established in quantitative fields for their ability to produce more robust results than single models.

Depending on how you trade these strategies, if you were to take them live in TradeStation, you need to update the code a bit so each strategy will act on its own unique signals. I didn't want to get into those technical weeds in this article, but it's an important implementation detail to keep in mind.

As you consider applying this approach to your own trading, remember that the key to a successful swarm isn't just selecting your top-performing systems. Instead, focus on creating meaningful diversity within your core trading concept. Look for systems that use different indicators, different parameter values, and ideally enter and exit the market at somewhat different times.

The advent of micro contracts has made this approach accessible to traders with modest account sizes. Even if you were planning to trade just one mini contract, you can now trade five diverse systems with two micro contracts each – potentially improving your results while maintaining equivalent overall exposure.

I encourage you to experiment with this approach in your own system development. Whether you're using Build Alpha or another development platform, the Swarm Mode concept can help you transform the optimization dilemma into a strategic advantage.

Video Demo!

Watch me demonstrate the Swam Mode using Build Alpha and TradeStation by watching this video:

Resources

]]>
https://easylanguagemastery.com/getting-started/swarm-mode-an-approach-to-trading-system-diversification/feed/ 2
Brainwashed! How Traders Are Programmed To Fail. https://easylanguagemastery.com/getting-started/brainwashed-how-traders-are-programmed-to-fail/?utm_source=rss&utm_medium=rss&utm_campaign=brainwashed-how-traders-are-programmed-to-fail https://easylanguagemastery.com/getting-started/brainwashed-how-traders-are-programmed-to-fail/#respond Fri, 14 Feb 2025 12:00:00 +0000 https://easylanguagemastery.com/?p=535356

Another day, another losing set of trades.

Your stomach churns as weeks of backtesting and optimization vanish in hours of live trading. The backtest looked perfect. The equity curve was beautiful. But reality? It's anything but.

Why do you keep failing as a trader? Because you've been *brainwashed* into being a failing trader.

Here's the brutal truth: Trading is a zero-sum game. For every winner, there's a loser. And guess who's winning? Highly funded institutions, hedge funds, and professional traders—many of whom are making money from *you*. While you're struggling with commissions and fees eating away at your dwindling capital, they're profiting from your programmed mistakes.

You're smart. You understand the technology. You've read the books, taken the courses, studied the markets. But success remains frustratingly out of reach. That consistent income you dreamed of? It feels like chasing a mirage.

The internet is filled with misleading advertisements like:

Crazy ads found online
Crazy ads found online
Crazy ads found online

These claims paint a picture of effortless success, and if you're new to trading, it's easy to believe them. The messages appeal to emotion rather than logic, convincing traders that making money is quick and easy. But this is completely false. These are the same beliefs that cost me years of frustration and tens of thousands in lost capital before I finally understood what was really going on.

I once thought trading was easy - just buy low and sell high. I took out a $20,000 credit card loan and funded my day trading account. It was only a matter of months before I could quit my day job, or so I thought. But the reality was much different.

In this article, I will show you exactly how you've been brainwashed and, more importantly, how to break free. I will expose three toxic myths carefully planted in your mind by an industry that profits from your failure.

Trading Myth #1: Trading Is Easy

You've seen the ads online:

  • "This simple indicator makes $50,000 in our backtest"
  • "This simple strategy made me $10,000 last month!"
  • "Follow these three indicators, and you can't lose!"

These are the siren songs of the trading industry. They echo through YouTube videos, bounce across Instagram stories, and flood your inbox through endless "educational" emails. Each one carries the same seductive message: trading is easy, and anyone can do it.

But here's what they don't show you:

  • The thousands of hours spent developing and testing strategies that fail
  • The countless sleepless nights debugging code that looked perfect but blew up in live trading
  • The psychological warfare of watching your account bleed money while you second-guess every decision

The "trading is easy" myth is perhaps the most insidious because it sets the foundation for failure. When you believe trading is easy, you don't prepare to trade correctly, and every loss feels like a personal failure. Every failed strategy becomes proof that you're "not cut out for this." But how could you be?

You're competing against teams of Ph.D. mathematicians working full-time on trading algorithms, high-frequency trading firms operating on millisecond timescales, and institutional traders with access to information and tools you'll never see.

The reality? Professional trading firms spend millions on research and development, risk management systems, data feeds and infrastructure, and teams of specialists. Yet somehow, you've been led to believe you can match them with a laptop and a few indicators?

Think about this: Would you trust a doctor who learned medicine exclusively from YouTube videos and six months of playing Operation? Of course not. We understand that becoming a doctor requires years of medical school, supervised residency, and continuous learning. Yet somehow, we've been conditioned to believe that mastering the financial markets—where billions of dollars move daily and the smartest minds compete—requires nothing more than a few online courses and some practice in a simulator.

This isn't to discourage you. But understanding the true complexity of trading is the first step toward success. It's not about following simple rules or copying someone else's strategy. It's about developing a deep understanding of markets, mastering risk management, and building robust systems that can survive in an ever-changing landscape.

The truth is, trading can be profitable. But it's never easy.

Trading Myth #2: $250 Per Day Fantasy

It starts innocently enough. You do the math: "$250 a day... that's $5,000 a month... $60,000 a year. If I can just learn to scalp consistently, I could quit my job. It seems reasonable – I just need to catch a few small moves each day."

This is the siren song that has lured countless traders to ruin. After all, the goal seems modest compared to the influencers showing off their Lamborghinis. Just a few ticks on a futures contract, a couple of quick scalps on forex, or some small wins in stocks. How hard could it be?

You start paper trading and it works. You're hitting your daily targets in the simulator. The dream feels within reach. Maybe you even have a few good days with real money. Then reality hits.

They're selling you a lie.

Markets don't care about your daily income goals. The markets don't distribute returns in neat, predictable packages. Hedge funds and high-frequency traders dominate day trading. They have access to cutting-edge technology and market advantages you simply don’t.

Slippage and commissions eat away at your profits – Every trade you place comes with costs, and these add up fast on small timeframes.

Small timeframes are noisy – The smaller the timeframe, the harder it is to extract consistent profits.

Think about it: if making a consistent $250 daily was achievable through a simple strategy, why would hedge funds spend millions on research? Why would prop firms hire teams of PhDs? Why would banks maintain massive trading operations?

The truth about consistency in trading is far more nuanced. Successful traders focus on:

  • Risk management over profit targets
  • Monthly or quarterly results instead of daily goals
  • Preserving capital during unfavorable conditions
  • Building diversified strategies that work in different market regimes

Can you make money trading? Absolutely. Can you guarantee a specific daily profit? That's like trying to predict exactly how many inches of rain will fall tomorrow. You might get close sometimes, but claiming you can do it consistently is either delusion or deception.

Professional traders understand this. They know that some months they'll exceed their targets, while others they'll need to focus on minimizing losses. They adapt to market conditions rather than forcing trades to hit arbitrary daily goals.

Let's look at a real example of just the impact of slippage and commissions:

In Figure A, we see a promising equity curve from a 5-minute Euro futures trading system, showing $22,000 in profits. 

Figure A - No slippage and commissions

Figure A - No slippage and commissions

However, Figure B shows the same system with slippage and commissions included - profits are cut by more than half, and the equity curve spends considerable time underwater.

Figure B - With slippage and commissions

Figure B - With slippage and commissions

This illustrates why higher timeframes often offer better opportunities:

  • Lower impact from slippage and commissions
  • Reduced noise in price action
  • Better profit-to-cost ratios

This is why I recommend trading on higher timeframes. As you move up in timeframe, the impact of slippage and commissions shrinks, making it easier to build profitable systems.

Trading Myth #3: Unrealistic Returns

Many traders set unrealistic expectations about how much money they can make. I've had people tell me they want a system that makes 20–55% per year on autopilot—yet they have little or no trading experience.

Let's put things in perspective with real market performance:

  • Over 100 years, the S&P 500 has returned 10.57% annually with dividends reinvested (7.41% inflation-adjusted)
  • Managed futures funds typically return 11% annually—run by professionals managing billions
  • Six top-performing emerging markets (EM) hedge funds averaged 12.5% annually over five years (2019–2023), with peaks of 16.6% in 2023
  • Elite funds like Waha Capital and Promeritum delivered consistent returns of 9–16% annually with low drawdowns
  • Even the legendary Medallion Fund (Renaissance Technologies)—arguably the most successful quantitative fund in history—returned 66% annually before fees and 39% after fees from 1988–2018, with resources most traders can't imagine

Yet retail traders regularly believe they can beat these market giants by orders of magnitude. They expect 100%+ annual returns, convinced their small account size and aggressive strategy will give them an edge. This dangerous delusion stems from a fundamental misunderstanding of market dynamics and risk.

Consider this: If you could consistently generate 12-15% annual returns while keeping drawdowns under 15%, you'd be outperforming most professional funds. It might not sound exciting compared to the promises of 100% returns, but it's sustainable and achievable with proper risk management.

If hedge funds with teams of PhDs and AI-driven algorithms struggle to hit 20% annually, what makes you think a laptop and a few indicators will do better? Why would institutions waste billions on research if they could just follow that "one weird trick" some YouTuber is selling?

This delusion isn’t accidental. You’ve been conditioned to believe in lottery ticket trading by Hollywood, online vendors, and social media influencers who make their money selling you the dream, not trading.

Remember: The goal isn't to get rich quickly—it's to build a sustainable trading operation that can compound returns over decades. The most successful traders aren't the ones promising astronomical returns; they're the ones quietly building robust systems that generate consistent profits year after year.

The first step toward real trading success is accepting this reality and adjusting your expectations accordingly. Only then can you begin building strategies that actually work in the real world, not just in your dreams.

Conclusion

In closing, these are not the only reasons you are likely failing as a trader. Obviously, there are many other factors at play, including your own psychology, which often actively works against you. But that's another article. Trading success isn't about finding a magical strategy or getting rich overnight—it's about building a sustainable foundation for long-term growth. While the journey ahead is challenging, it's also deeply rewarding for those who approach it with the right mindset and expectations.

Learning to become a successful algo trader is a journey that takes work:

Coding -> Strategy Building/Validation -> Portfolio Construction -> Live Trading -> Maintenance & Continued Education

If you're just starting out, focus on learning rather than earning. Set aside time each week for coding, studying markets, and understanding trading systems. Join communities of serious traders who share your commitment to sustainable growth. Most importantly, remember that building a successful trading operation is a marathon, not a sprint.

Can you become a profitable trader? Absolutely. But success comes from embracing the journey, not searching for shortcuts. Start with a solid foundation in programming and trading basics. Build your knowledge systematically, test thoroughly, trade small, scale gradually, and always remember: the goal isn't to get rich quickly—it's to build something that lasts. While I can't turn you into a successful trader, as that depends upon your skills, dedication, and willingness to learn, I can help you on your journey by showing you some of the fundamental skills, such as coding and proper strategy construction. Learn more here.

]]>
https://easylanguagemastery.com/getting-started/brainwashed-how-traders-are-programmed-to-fail/feed/ 0
The Top 6 Most Popular EasyLanguage Articles of 2024 https://easylanguagemastery.com/getting-started/the-top-6-most-popular-easylanguage-articles-of-2024/?utm_source=rss&utm_medium=rss&utm_campaign=the-top-6-most-popular-easylanguage-articles-of-2024 https://easylanguagemastery.com/getting-started/the-top-6-most-popular-easylanguage-articles-of-2024/#respond Mon, 30 Dec 2024 11:49:00 +0000 https://easylanguagemastery.com/?p=535301

1. Crafting a Winning NG Futures Strategy with CCI and Build Alpha

This exploration dives into using the versatile Commodity Channel Index (CCI) indicator to develop a robust trading strategy for natural gas futures. After coding a basic short-side strategy in EasyLanguage, the author upgrades it by leveraging Build Alpha - a no-code platform for strategy creation and optimization. Within minutes, Build Alpha tests thousands of combinations and discovers that adding a 200-day moving average filter and tuning the profit targets and stops boosts performance. Rigorous validation on unseen market data verifies the CCI system is profitable, robust, and not overfit.

Crafting a Winning NG Futures Strategy with CCI and Build Alpha

Key Points:

  • Build Alpha rapidly prototypes and stress-tests trading ideas without any programming required.
  • Adding a simple moving average filter and optimizing exits improved the short-side CCI system for natural gas futures.
  • Multiple validation techniques confirm the strategy is robust and poised to work in live trading.

Read the full article.

2. A Better Regime Filter: True Range Adjusted Exponential Moving Average

This article uses the True Range Adjusted Exponential Moving Average (TRAdj EMA) as an improved regime filter compared to the traditional 200-bar Simple Moving Average (SMA). While the SMA reacts quicker, it results in more false signals. In contrast, the TRAdj EMA more efficiently identifies major trends with fewer trades. Backtests on the E-mini S&P 500, Crude Oil, Soybeans, and Euro Currency show the TRAdj EMA captures strong trends with higher profit per trade. Understanding and experimenting with the TRAdj EMA can significantly enhance your trading strategy.

A Better Regime Filter: True Range Adjusted Exponential Moving Average

Key Points:

  • Backtests show the TRAdj EMA results in fewer but more profitable trades by better identifying major trends.
  • The TRAdj EMA incorporates volatility to be more responsive than traditional moving averages.
  • The 200-bar SMA and TRAdj EMA have value depending on trading style and risk tolerance.

Read the full article.

3. Capture The Big Moves! (Updated 2023)

This article explores an RSI-based indicator that identifies major bull and bear markets. Using a 12-period weekly RSI and thresholds of 40 and 60, signals are generated to exit positions before crashes and enter before bull runs. Backtests over 1960-2020 capture moves like the 1990s bull market and 2007-2009 financial crisis with solid profits while avoiding drawdowns. The indicator struggles with sharp, short-term moves like the 2020 COVID crash. While imperfect, it provides a mechanism to avoid severe drawdowns and enter bull markets early.

Capture The Big Moves! (Updated 2023)

Key Points:

  • Uses a 12-period weekly RSI with thresholds of 40 and 60 to determine bull and bear markets
  • Backtesting over 1960-2020 shows the ability to capture upside moves while avoiding major drawdowns.
  • Struggles with short-term crashes like 2020 COVID selloff, but can help guide long-term position trading

Read the full article.

4. Enhancing RSI Mean Reversion Strategies with VIX Filtering

This exploration looks at boosting the performance of a classic RSI mean reversion system in index futures by adding a Volatility Index (VIX) filter. Testing on the ES market shows going long when a 2-period RSI crosses below 20, producing profits and excessive trades. Incorporating additional rules like only taking trades if the VIX high 7 bars ago is above 50 cuts trades in half while doubling average profit per trade and halving drawdowns. When optimized, the enhanced strategy delivers a consistent edge across multiple indexes like NQ, RTY, and YM over various timeframes.

Enhancing RSI Mean Reversion Strategies with VIX Filtering

Key Points:

  • A VIX filter dramatically reduces trades and drawdowns for RSI strategies without sacrificing total net profit.
  • Optimal VIX lookback periods and overbought/oversold levels differ across index futures and timeframes.
  • Automated strategy testing makes finding the best VIX filter parameters for each market quick and easy.

Read the full article.

5. Testing Market Regime Indicators

Trying to trade the same way in all market conditions often leads to disappointment. This article explains an easy method to adjust your trading system dynamically based on whether you’re in a bull or bear market regime. Knowing the current regime can help you take advantage of different market characteristics. For example, only taking long trades in a confirmed bull market.

The article tests four common indicators to categorize the market: SMA, ROC, Adaptive Momentum, and Relative Strength Ranking. Each is optimized over 2000-2023 for markets like the S&P 500, crude oil, soybeans, and the euro currency. The best performers overall were Adaptive Momentum and smoothed ROC, able to reliably determine bull vs bear regimes across different markets.

Testing Market Regime Indicators

Key Points:

  • Adaptive Momentum dynamically adjusts its inputs based on recent price action to determine bull or bear markets.
  • Smoothed ROC reduces false signals by averaging the rate of change values over multiple bars.
  • Systematically testing regimes on different markets helps build robust strategies optimized for current conditions.

Read the full article.

6. Can You Time the Market Using Nothing But Moon Cycles?

Intrigued by a trader who profited from using moon cycles, this article backtests the simple strategy of buying on the full moon and selling on the new moon over the past 20 years. Surprisingly, it slightly beats buying and holding the S&P 500 while having lower drawdowns and only being invested half the time. Adding filters like moving averages or stops fails to improve performance. However, combining with positive day-of-week tendencies and a profit target transforms returns. The resulting system has a great equity curve, improved risk metrics and continues working even 18 months later.

Can You Time the Market Using Nothing But Moon Cycles?

Key Points:

  • Combining monthly moon cycles with positive weekly seasonality filters creates a winning swing trading system.
  • A $1000 profit target on moon cycle trades vastly improves overall performance and drawdown.
  • Even though counterintuitive, the simple system has worked well for over 20 years on both the long and short side.

Read the full article.


]]>
https://easylanguagemastery.com/getting-started/the-top-6-most-popular-easylanguage-articles-of-2024/feed/ 0
Is The Christmas Season Bullish For U.S. Markets? https://easylanguagemastery.com/market-studies/christmas-trade/?utm_source=rss&utm_medium=rss&utm_campaign=christmas-trade https://easylanguagemastery.com/market-studies/christmas-trade/#comments Mon, 16 Dec 2024 11:00:00 +0000 http://systemtradersuccess.com/?p=2821

With the Christmas season upon us, I thought it would be interesting to review how the S&P behaves in the days just before Christmas. Do the days just before this holiday tend to be bullish, bearish, or neutral?

To test the market behavior just before the Christmas holiday I will use the S&P Cash index back in 1960. I will create an EasyLanguage strategy that will enter a trade X days before Christmas and close that trade on the opening of the first trading day after Christmas. Each trade will dedicate $100,000 to purchase shares. Stops, and both commissions and slippage are not utilized in this study.

Ten Days Before Christmas

First let's look at the 10 days before Christmas. What happens if we enter a trade X days before Christmas and close that trade on the open after Christmas? By using TradeStation's optimize feature I can systematically test each day over the historical data. The results of each test is the generated P&L for each iteration and is depicted in the bar graph below. Looking at the graph, each bar on the x-axis represents the number of days before Christmas.

It appears that the 10 days before Christmas all show positive P&L. In general, the longer you're holding period before Christmas the better.

Ten Days After Christmas

Using a similar trading system, I will look at entering a trade on open of trading day following Christmas and holding that trade for X days. Below is a bar graph showing the days 1-10 after Christmas. Again, each bar represents P&L and the x-axis is the number of days the trade is held.

Historically, all days after Christmas in our study have returned positive results. Unlike the 10 days before Christmas, in this case it appears there is not much gain for holding beyond five days.

The Christmas Trade

Based on the information above, which seems to show a strong bullish biased for the days immediately before and after Christmas, I'm going to create another strategy that will open a trade five days before Christmas and closes that trade five days after Christmas. I picked five days simply because it was the middle value (1-10) for the days before and after Christmas we tested. Last year's Christmas Trade (December 2022) was a losing trade. It's pictured below.

Christmas Trade 2023

Christmas Trade 2023

When you combine all the trades going back to 1960 we get the following equity curve and performance, below. The last equity peek was in 2021.

Christmas Trade Equity Curve

Conclusion

There certainly does seem to be a very strong bullish tendency around Christmas. The most recent action looks a little more flat. However, we did have a new equity high in 2021.

Can you take advantage of this in your trading? Perhaps. Remember, the code with this article is not a complete trading system, but an indicator to help me gauge the market behavior around the Christmas holiday. If you have trading systems or trade a discretionary method around these days before and after Christmas, you might use this knowledge to ignore short signals, or modify your exit based upon what we learned. 

]]>
https://easylanguagemastery.com/market-studies/christmas-trade/feed/ 5
Adapting to Volatility: Strategic Position Sizing for Algorithmic Traders https://easylanguagemastery.com/building-strategies/percent-risk-and-volatility-2/?utm_source=rss&utm_medium=rss&utm_campaign=percent-risk-and-volatility-2 https://easylanguagemastery.com/building-strategies/percent-risk-and-volatility-2/#comments Mon, 02 Dec 2024 11:00:18 +0000 http://systemtradersuccess.com/?p=2748

I’m going to show you how to turn a good system into an amazing system with just a few lines of code! Adding these few lines of code could make you an additional $10k, $25K or even $50K in profits instantly.

Today we’re going to take my Better Breakout Strategy, which is a day trading strategy and dramatically improve it’s ability to generate profit. The simple technique I’m going to show you can easily be applied to any of your trading systems allowing you to generate 10s of thousands of more dollars quickly.

Let’s start with a thought experiment.

Explain This Mystery?

Say we have two traders who are each given identical trading systems to execute on the NASDAQ futures market (@NQ).  Because both systems are identical copies of an automated trading system, both trading systems generate the same buy/sell signals, use identical stop loss and trailing stop parameters.

These two traders are also going to start trading on the same day, with the same starting account size.  In essence let’s pretend we have two traders that have identical trading circumstances. Let's give these two traders 12 months to trade.  At the end of the trading period, we would expect them to have the same account balance, right?

But at the end of the trading period, reality has made fools of us. One trader generated more net profit. How can this be?

Reviewing the trading results for both traders you can see both traders took the same signals. Both traders have the same win/loss ratio and even the same number of stop-out trades. But there is one difference.

One trader used a simple mathematical formula to determine how many shares to buy and thus, his account grew at a faster rate.

What is Position Sizing

Position sizing is a critical component of both systematic and discretionary trading, addressing the pivotal question: How many shares or contracts should I purchase?

Far too often, the answer is derived from nothing more than a well-informed guess. A common misstep among traders is to size their trades without considering risk, potentially undermining their results, their trading systems, and, in some cases, their careers as algorithmic traders!

By anchoring your trade size to a risk metric, you adopt a defensive stance against the unpredictability of the market. Risk management should be paramount for any trader aiming for long-term success. Therefore, employing a risk-based metric to mathematically size your trades is not just recommended; it's essential. Despite this, the common practice involves using a fixed number of shares or allocating a fixed dollar amount per trade. Let's pause to consider the implications.

Imagine your trading system signals a new buy opportunity. You could, theoretically, risk your entire cash balance on this single signal. A win might double your money swiftly, but a loss could deplete your account entirely. It's evident that staking your whole account on one trade is a gamble far too risky for any prudent investor. This extreme example illustrates a fundamental truth: risking your entire trading capital on a single trade is recklessly imprudent.

So, what's the prudent amount to wager? Maybe 90% of your account? Or perhaps you decide on purchasing 100 shares. Many system developers overlook how trade size influences the risk-reward dynamic of a trade.

As the risk increases, so does the potential reward. Yet, overextend your risk, and a few losing trades could decimate your account. Theoretically, there's an optimal balance between risk and reward specific to each trading system.

Your mission is to identify a nearly optimal level that aligns with your comfort as a trader. While delving into the intricacies of finding an optimal position sizing strategy for a specific trading system is beyond the scope of this discussion, I will illustrate the difference between employing a risk-based position sizing algorithm and simply buying a fixed number of shares—the latter being a common practice that neglects risk metrics, thereby failing to adjust trade sizes according to market conditions.

Does a risk-based approach truly offer an advantage? Let's delve into the evidence.

Our Day Trading Algorithm

We will be using a simple intraday breakout model called, Better Breakout which was discussed in thie article, A Modern Approach To Breakout Trading. Please review that article for the strategy rules. The code is available for all EasyLanguage Mastery subscribers.

Let's load the strategy on a NASDAQ Futures (@NQ) chart.

  • Historical data January 1, 2012 through October 31, 2024
  • Trades are executed on a 5-minute bar
  • All trades are closed at the end of the day
  • A dynamic stop loss based upon the volatility of the market. See the code for details.
  • All trades are long only.
  • We assumed a starting capital of $100,000
  • $15 for slippage and commissions deducted for each round trip.

Below is an example of the strategy trading on the daily chart of @NQ. We can see the trade entering early on the 9:05 AM bar on a big gap up from the previous day. The trade closed at 15:00 PM the same day.

Fixed Contract Position Sizing

The fixed-share method is a non-risk-based method. In this case we simply buy the same number of contracts (1) for each signal. I use this technique all the time when developing a strategy. But it's probably not the best way to trade something live.

Contracts = 1


Percent Risk Position Sizing

The percent-risk method is a strategy grounded in risk management. In this approach, we allocate a fixed percentage of our equity—2% in this example—to risk on each trading signal. The choice of 2% is guided by a widely accepted principle in trading that suggests risking anywhere from 0.5% to 2% of your account balance on any single trade. This strategy aims to mitigate the impact of a series of losses, preventing them from significantly damaging your trading account. We then use this predetermined risk percentage to calculate the specific dollar amount you're willing to risk on an individual trade.

Example:

Contracts  = (2% of Account Equity) / ( Stop Loss Per Contract)
Contracts  = (2% * $100,000)/ $500
Contracts = $2,000 / $500
Contracts = 4

In the example provided, we have the methodology to calculate the number of contracts to purchase while maintaining a consistent risk level of 2% of the account size per trade. As mentioned, the stop-loss value for the 'Better Breakout' strategy adjusts based on recent market volatility, as detailed in the original article.

This adaptive approach means that if market volatility increases, our stop-loss threshold will widen. Consequently, to adhere to our 2% risk per trade guideline, we might find ourselves buying fewer contracts. Conversely, in periods of reduced volatility, our stop-loss tightens, allowing us to purchase more contracts without breaching the 2% risk rule.

The essence of this strategy is that we never risk more than 2% of our account on a single trade. This flexibility enables us to adjust the number of contracts traded in response to the volatility of the market, effectively normalizing our risk exposure relative to market conditions.

But what implications does this have for our trading outcomes?

Performance Comparison

Fixed

2% Risk

Net Profit

$59,595

$112,350

Profit Factor

1.88

2.16

Total Traders

193

193

Avg.Trade Net Profit

$308.78

$582.12

Annual Rate of Return

3.64%

5.87%

Max Drawdown (Intraday)

$10,425

$13,270

NP vs DD

5.7

8.5

In our analysis, we observed an increase in profits while maintaining the same number of trades (almost, there is one extra trade), without escalating our maximum intraday drawdown. We also increased every other metric!. 

This is a clear win. More profit. Identical risk. 

It's important to note that in our Percent Risk model, we are not reinvesting profits. We started trading with an account balance of $100,000 which remains constant for the purpose of calculating position sizes.

Why adopt this approach?

The goal was to evaluate the impact of scaling trades based on market volatility and to compare its performance with that of the Fixed Model. Incorporating profits into our calculations would undoubtedly enhance our returns further. However, I preferred to avoid complicating the analysis with additional variables. This decision was made to provide a clearer comparison and to focus solely on the influence of the position sizing model.

Pitfalls To Avoid

Don't Using Position Sizing To Improve A Poor System

First, let’s tackle a common misconception: thinking position sizing can turn a mediocre system into a winner.

Here’s the truth – position sizing isn’t a magic fix. If your trading system doesn’t have a solid foundation, even the best position sizing approach won’t make it profitable in the long run.

Imagine trying to fix a car with no engine by just repainting it; it might look better, but it’s still not going anywhere. You should always start with a positive expectancy system, meaning it’s capable of generating returns based on the market behavior it was designed to exploit.

Think of position sizing as the tool that can amplify or protect your returns, not create them from scratch. So, before diving into advanced sizing techniques, ensure your system is already well-tuned and thoroughly backtested. Only then can you expect position sizing to help elevate your results.

Don’t Risk Too Much Per Trade

Now, here’s a mistake that every beginner should be wary of risking too much per trade. It’s easy to think that a higher risk per trade means faster growth, but the opposite is true – the more you risk, the faster you can blow up your account.

In professional trading, a common rule is to keep risk per trade around 1-2% of your account. Why? Because this allows you to survive the inevitable losing streaks. Even the best trading systems will experience losses, sometimes back-to-back.

If you’re risking 5%, 10%, or more on a single trade, it won’t take long for a few bad trades to wipe out a significant portion of your capital. Here’s the bottom line: keeping your risk per trade at around 2% or lower gives you the breathing room to recover from losses and make adjustments if needed. It’s all about protecting your account so you can stay in the game for the long haul.

Remember, in trading, slow and steady does win the race.

Conclusion

Alright, let’s recap the main points.

We started with the concept of position sizing and why it’s essential for traders who want consistent, long-term results. We saw how adjusting trade size based on a percent-risk approach – rather than a fixed contract method – can help align your trades with market conditions, providing flexibility and stability in a volatile environment.

We also dug into the two common pitfalls to avoid: first, don’t rely on position sizing to make up for a weak system. Build a solid foundation with a proven strategy, and then let position sizing enhance it. Second, keep your risk per trade at a reasonable level, around 2%, to avoid those devastating losses that can sideline even the most promising traders.

Key takeaway? Strategic position sizing is a powerful tool when used with a robust trading system and disciplined risk management. It’s about managing your exposure, protecting your capital, and allowing your account to grow consistently.

Good luck with your trading.

]]>
https://easylanguagemastery.com/building-strategies/percent-risk-and-volatility-2/feed/ 5
Why You Need To Learn Easylanguage Now! https://easylanguagemastery.com/learn-easylanguage/why-easylanguage-is-your-trading-superpower/?utm_source=rss&utm_medium=rss&utm_campaign=why-easylanguage-is-your-trading-superpower https://easylanguagemastery.com/learn-easylanguage/why-easylanguage-is-your-trading-superpower/#comments Mon, 18 Nov 2024 11:00:00 +0000 https://easylanguagemastery.com/?p=23478

In a previous article I talked about how EasyLanguage helped me transform from a losing trader into a winning trader. 

In this week's article I'm going to show you what you can do with EasyLanguage. I'm going to show you how EasyLanguage can be used to help determine which indicators, price patterns, and trading systems will work. It's really powerful and a skill set that I think you should learn. In fact, I think it's required learning!

Let's dig in. 

What trading style will work?

Let's say you wish to trade the E-mini S&P futures market. What we want to do is ask, should we utilize a mean reversion strategy, or should we utilize a momentum strategy? So we're going to tackle the E-mini S&P from a very high level, and other retail traders won't even be thinking this way.

How do we define momentum? Let's keep it real simple. These are examples of momentum:

  • buying at a 52-week high
  • buying it a new 10-day high
  • buying when price crosses above a moving average 

So prices are moving forward. It's breaking a new 10-day high, new 52-week high, or crossing above a moving average. And we're going to buy in hopes of price to continue to move in that direction. So that's momentum.

What is mean reversion? Well, that's where to go against the immediate trend. We're going to locate price extremes and fade those. So, in this case, we see the E-mini S&P going up. We're going to wait for a pullback and buy. That's mean reversion.

So which one is going to be best suited for the E-mini S&P? Well, we can build a simple strategy to test how the markets behave. We're not going to develop a strategy for trading per se. We're going to use this as a test to see which trading style works best. This will give us clear guidance on which path to follow when we actually want to build a real trading system. 

Let's start with momentum, and we're going to use three consecutive higher closes.

Pictured you can see what we're looking for. Three consecutive higher closes. That's our buy signal. You can also see how simple the EasyLanguage code is.

We're not going to get into all the details of EasyLanguage code, but I did want to just show you what this looks like. Very simple.

When do we exit? We're just going to count three bars and then exit. What are we doing here? Well, we're going to determine, okay, when this event happens, three consecutive higher closes, what does the market tend to do? Does it tend to go higher, or does it tend to go lower? This is vital information for building a trading system. We're trying to estimate what the market tends to do when we have three consecutive higher closes.

So we're going to just hold our open trader for three bars and see what the market does. In TradeStation, I create a TradeStation WorkSpace with the daily chart of the E-mini S&P. We have 18 years of history, no commissions, and no slippage. Remember, we're not going to trade this. This is just a task. What will work better mean reversion or momentum? Any ideas?

This is what it looks like.

If you buy three consecutive higher closes, go in and exit three days later, most of that equity curve is below the zero line. Most of the time you're losing money on that concept. Again, this is on a daily chart holding for several days.

What happens if we invert our concept? So, in this case, we're looking for the close less than the close of yesterday. So we're going to reverse the logic. Then we're going to hold for three bars. Let's see what results we get.

Huge difference! What did we learn from our experiment? If we buy into it in the short term, we weren't doing so hot. However, if we wait for a pullback and then go long, you could see a huge difference. So the E-mini S&P has a long bias. And if you buy the SOP and hold for years, it generally goes up typically. But in the short term, you don't necessarily want to buy momentum because if you define short term and on a daily chart as just a couple of days, you're probably going to end up in the red.

Alright. If you want to build a short term trading strategy for the E-mini S&P, you probably should focus on mean reversion. We discovered that right away, and you can use EasyLanguage to apply this to any market on any timeframe, it can point you in the right direction when you want to trade that market.

Here's another situation.

Does this indicator work?

Watch the video on how EasyLanguage can help you determine if a given indicator will work for you or not.

So we're gonna take a look at John Ehler's Laguerre RSI. This indicator was popular about 10 years ago. Below is a graph of this indicator applied to a price chart of Amazon.

And you can clearly see where to go long and where to sell. You can see that there is a red line and a green line on the indicator. When the indicator dips below that green line, we're in a pullback, and we can buy. We can then sell when the price rises above the red line. Simple!

Looking at the chart over, you can easily say to yourself, Wow! Looks great.

But do we really know? Would you trade this without really knowing how well it would work? How do we gauge how well this indicator will work?

We're going to take the indicator, and we're going to buy when the Laguerre RSI is less than 0.1 and then sell it when the Laguerre RSI is greater than 0.9. Very similar to a traditional RSI indicator, right? 

So here's what the EasyLanguage code looks like. The code is available to download anywhere. And it's pretty simple, right? It's a few lines of code. And with this, you can code and test, and see if it works. Let's see what it does with gold futures.

All right. Not too bad. That simple concept seems to hold up reasonably well. Remember this isn't a complete trading system. We're testing. We're being a scientist and figuring out what works. What about the Euro?

It seems to hold up pretty well there too. NASDAQ.

Wow! NASDAQ, like all the stock indices, has a long bias, but this looks pretty good. So what was the conclusion?

This indicator has merit. It's very possible that a trading system could be built from this indicator. Now, of course, you could test all your favorite signs. You could actually create a library of EasyLanguage code and go to your favorite markets such as gold, E-mini S&P, the Euro, or wherever, and rank your indicators, which ones produce the best results. Wouldn't that be great? Maybe eliminate 90% of your indicators and focus on the top 10% or the top 5% of the indicators that work for you.

Knowing EasyLanguage allows you this huge, huge advantage!

Does this Price Pattern work?

There are many price patterns. Double tops, shooting stars, engulfing bears, islands, and key reversals. Well, we're going to pick up something called a reversal bar, and we're going to see if it holds any trading merit. Again, knowing EasyLanguage, we can cut through the noise and see what works and what doesn't work.

So I just went to a website and here's a price action pattern that you may know. It's called a key reversal bar. What is a key reversal bar?

We have a market that's going down and down then Boom! The market changes direction. That is our key reversal bar. Why? Well, it's the lowest low of the last three bars. Also, the high is greater than the high of yesterday. That's all we need now.

There are different versions of the key reversal bar. We picked this one. Why? Just because it's one of the more simpler ones. Let’s test to see how effective it is. Knowing EasyLanguage means you never have to wonder if a price pattern will work or not. So let's put it to the test. 

Here is what we'll do. We're going to exit five days after buying. We want to test the behavior for the market after this price pattern event. What does the market tend to do five days after our key reversal bar? Does it tend to rise, fall, or go sideways? That's what we want to answer.

So the EasyLanguage code looks like this.

I'm not going to get into all the code here, but you can see how few code lines are needed. Once you learn EasyLanguage, this can quickly be constructed.

Alright. Let's take a look at the E-mini S&P. What do you think here? You can probably deduce based on what we saw in the previous example.

We have a failing equity curve. So on a key reversal bar (a sign of strength), if you go along, your trade does not work out so well. After a strong reversal bar, five days later, the market tends to be lower. Wouldn't that be good to know before putting money on the line or attempting to paper trade this? Think of the time we just saved.

Let me show you something you could do. We know buying into weakness in the short term seems to be rewarded when trading the E-mini S&P, right? That's what we've seen. So, what happens if we change our code and look for a weak reversal bar?

Here we made the high lower than yesterday. It's a weak bar. That's just four consecutive lower lows, right? Now let's apply it to our E-mini S&P chart.

Wow! You see that this makes night and day difference. Look at that equity curve. You can't trade that as is, but you're damn close. Right? Look at the difference between the equity curves.

This is incredible information to know. This key reversal pattern does not work on a daily chart of the E-mini S&P futures. However, with slight modification, it may be beneficial.

Does This Strategy Work?

What happens when you locate a trading strategy that looks interesting? How do you know it will work?

Well, I ran into this simple trading system years ago. It's called the first strike trading system, and it only has two rules. It trades the Euro futures. Here is the entry rule. Simultaneously on Monday, wait till the market opens. Then place a buy stop 50 points above the open and a sell short 50 points below that open. Then you just wait for the market to take you in either going to go long or going short. 

When the market takes you in, you simply place a 60-point stop on that trade. Very simple. Just wait for the market to take you in on the long side or the short side. When it does, you simply cancel the other order and place your stop. Then if you don't get stopped by Friday, you close the trade Friday before the close. So you're gonna make one trade a week. How beautiful is that? Here is the equity curve.

But does it really work? What I would do is code it up and put it to the test. This is the actual code to build that trading system.

This is not a lot of code. It's very simple to create. Once you learn a few basic commands in EasyLanguage, you can apply it again and again, and you can start building out systems like this pretty quickly to test. So will it work? Let's see.

Not so hot! Maybe this works for someone. I don't know what the author of this strategy was doing. Perhaps he was looking at something else, something different than I was, but it didn't work for me. Now think about all the time I saved by coding that up. Maybe it took me 15 minutes to code it up and test it. How long would it take you to manually test? How many hours would you spend on it? Well, I determined very quickly - it's not worth my time. Knowing EasyLanguage saved me a ton of hassle and potential money. Knowing EasyLanguage is invaluable!

Why You Need To Learn EasyLanguage

So there you have it - some concrete examples of why you need to learn EasyLanguage.

In all these examples, I've created objective evidence. That's the power of EasyLanguage. You can create objective evidence based on your markets and timeframes you use. There's no more guessing. Can you imagine what type of anxiety this clears up? 

With EasyLanguage as part of your skillset, you know how to become an evidence-based trader. You perform experiments to see what works and what does not work. You are a trading scientist, and you are testing and probing the market for market edges.

So knowing EasyLanguage is an incredibly powerful skill to have. In fact, I like saying that EasyLanguage is your trading superpower. And I really don't take that lightly. I mean it. It changed how I trade forever.

If you want me teach you EasyLanguage and how to build strategies, I teach a hands on course where I show you how to use EasyLanguage. It's a very pratical course that will quickly show you how to become an EasyLanguage coder even if you never coded before.

You can also find some free EasyLanguage resoruces here.

]]>
https://easylanguagemastery.com/learn-easylanguage/why-easylanguage-is-your-trading-superpower/feed/ 6
From Losing Trader To Superhero By Doing This One Thing! https://easylanguagemastery.com/learn-easylanguage/discover-your-trading-superpower/?utm_source=rss&utm_medium=rss&utm_campaign=discover-your-trading-superpower https://easylanguagemastery.com/learn-easylanguage/discover-your-trading-superpower/#comments Mon, 04 Nov 2024 11:00:00 +0000 http://easylanguagemastery.com/?p=21229

Do you have a trading super power? 

I do.

It's knowing EasyLanguage! Yep, that's my trading super power and I'm going to explain why. I'm also going to try to convince you that you should learn EasyLanguage as well.

This is a part one of a 3-part series on why I think you need to learn EasyLanguage. At the conclusion of these articles my goal is to convince you that EasyLanguage is critical to your success as an algorithmic trader. I’m also going to give you some solid advice on how I learned to code in EasyLanguage so you can learn it too.

So, let's get started.

A Failing Discretionary Trader


There was a time when I wasn't making any money trading, and I was feeling like a complete failure. This is a feeling that most traders have had when we first started out on our trading journey.

For me that was back in 2006 when I wanted to be a day trader. I needed money to fund my trading account. So what did I do? I made a really *smart* move and borrowed $20,000 on credit cards (cash advance). Those were the days when you could bounce credit card balances around between different cards at 0% interest.

I opened my trading account and started trading!

I had no idea what I was doing, particularly looking back, but I figured out how hard it can be, right? You buy low, sell high, pretty simple. Within a few weeks, I made an excellent breakout trade on a stock. I generated around $1,400 within an hour or two. I was absolutely hooked.

With victory fresh in my mind, I felt awesome, and thought, trading is what I should be focusing on. But of course, right after that, I was struggling to discover a consistent trading setup. I read every book I could, read blogs, and even magazines on the topic. This went on for months and months.

I saw thousands and thousands of dollars drain from my trading account during that first year. Naturally, I was getting more and more frustrated and depressed as this happened. How do I explain this to my wife? How do I pay this money back?


I saw thousands and thousands of dollars drain from my trading account during that first year. Naturally, I was getting more and more frustrated and depressed as this happened. How do I explain this to my wife? How do I pay this money back?

By the end of my first year, it was apparent that I was a losing trader. 50% of my capital was gone. I attributed not wholly blowing up my account to risk management. I was naturally risk-averse so I stuck to my stops most of the time, and that's what saved me from completely annihilating my account.

But I pushed forward with trying to learn how to trade.

Yet, each month was a defeat as I saw more money drain from my account. It was disheartening. The year was coming to a close, and all those hours reading, studying, and sitting in front of a computer screen was costing me money and lots of it. The harsh reality of learning to trade was sinking in.

Then I tried understanding trading psychology and becoming more disciplined in my approach. Now, this did work a little bit. Once you understand psychology and try to work at that, you can start to make changes. I did start seeing some improvements.

Bringing discipline to my trade setups and researching some ideas with a little more rigor, I was able to make some money. But the market was not done toying with me. I would maybe be consistent for a week or two and build up a nice little chunk of money. I began to feel hope again. Then my good luck would turn as I made dumb mistakes, and the money would disappear quicker than it appeared. I would lose weeks of profit in a single day. It was totally frustrating, and I would get angry. 

For example, I deviated from my plan by taking trades that were not part of my trading plan. I would also avoid trades that I should have executed. Sometimes losing trades would so enrage me that I would open "revenge" trades to earn back the money I lost. It rarely worked, and I dug myself deeper. Another losing day. Another losing week. Another losing month. I was getting absolutely eaten alive by trading discretionary. I was doing absolutely everything wrong. Those times were miserable.

 

Other times I was full of fear. I may have experienced a series of losing trades, then upon my next trade setup, I would not take the trade. I was paralyzed with fear! I was too afraid of losing more money to open a new trade. Often the market would move in my favor, and I would feel like a complete idiot. I would ask myself, why can't you follow a simple trading plan? How dumb are you?!

In short, my psychological issues were getting in the way. I could not pull the trigger when paralyzed with fear of losing more money, and I could not follow a trading plan 100%. Instead, I would exit early, I'd skip trades or make other mistakes that cost me dearly. Furthermore, there was no testing to demonstrate if a trading idea would work. How crazy is that to think about? I found an idea on the web or in a magazine, and I just traded it.

My trading was not rooted in cold, hard facts. 

So, not only was I the weakest link in my trading plan, I'm basing my trading decisions on emotion or on a belief on what I think might work. There were no cold, hard facts backing up my trade setups. My trading was faith-based. I believed a particular setup would work. I thought I could make money. What other industry do you go in with this mindset? If you want to become a doctor, do you simply read a few books and jump in?

It's crazy, right? But that's what I was doing.

I knew something had to change.

The Ah-Ha Moment! Computers & EasyLanguage

I tried leveraging the power of computers to build automated trading systems because a computer is going to execute the plan, right? Just had four losing trades in a row, the computer is going to execute the next trade. No emotion. Just correct execution. It's not going to move the stop. It's not going to exit early. It's not going to miss trades.

 

So, the light bulb went on, and things started to change.

After I stopped my discretionary trading experiments, that's when my account started to grow. Now, obviously, it didn't start right away.

There's a learning curve in there, but I put that as the pivotal time when my account started to grow, and things completely changed. So the missing piece was fully embracing automated and quantitative trading.

Again, the critical point was I'm the weakest link in reaching my trading success. To fix this, trading could be automated by a computer, which allows for near-perfect trade execution.

EasyLanguage Allows You To Test Ideas To See What Works

Beyond perfect trade execution, learning code allows you to test ideas and see what works and what doesn't. You're actually able to test ideas to see if they work or not. This can save a massive amount of time, money, and frustration. Learning how to code allows you to cut through the noise and trade effectively with confidence. So evidence-based trading provides a powerful edge, and that's the main thrust here.

 

Learning a language, such as EasyLanguage, is evidence-based trading that provides a powerful edge. Most retail traders aren't doing this. I guarantee that most people are not very skilled in EasyLanguage or other computer languages, and are really taking advantage of this. This is a potent edge. In fact, I think it's almost necessary for you to succeed.

Why So Many Traders Fail

Why do most traders fail? Well, as I discovered most trade on emotion without any empirical evidence to back up their trade setups. Another problem is unrealistic expectations. New traders think trading is easy, and they think it's a get-rich-quick game. Outside of a few lucky or extremely talented people, this is not true at all. Expectations are a huge component of why new traders think trading is easy, and they fund their first account with the hopes of getting rich quick.

Here is another reason why so many fail.

When you attempt to make money trading, you're competing against the very best in the world. Think about all the well-capitalized institutions, equipped with the best hardware, and populated with the best minds money can buy. This field is filled with very competitive individuals that are aggressively attacking this problem, and you're going to go up against them. 

Most fail because they rely on emotions and hope to make trading decisions instead of quantifiable evidence. Most fail because they don't realize that while trading is simple in concept (buy low, sell high), the psychological impediments actually make it difficult. Mix these factors in with the fact that you're competing with the very best in the world, and you can see why most traders are doomed to fail right from the start.

How to overcome these problems?

How To Win At Trading

I think you need to leverage the power of computers and become a trading scientist. What does that mean? A trading scientist is a skeptical person who just does not believe in a trade setup or merely accepts a trading truth. Instead, he attempts to gather empirical evidence by performing a little experiment on the market to see what works and what does it.

And that's how you have to approach your trading. You must perform experiments to see what works and EasyLanguage allows me to do that. To become a trading scientist, you'll need one skill that opens the door to the kingdom, and that is coding in EasyLanguage. 

What can you actually do with EasyLanguage? What kind of experiments can you perform, and how will this really help you? We'll go over some great examples in the next article!

Until then you can get a jump start on learning EasyLanguage by getting this free eBook and video series.


]]>
https://easylanguagemastery.com/learn-easylanguage/discover-your-trading-superpower/feed/ 1
A Modern Approach to Breakout Trading: The Better Breakout Strategy https://easylanguagemastery.com/strategies/a-modern-approach-to-breakout-trading-the-better-breakout-strategy/?utm_source=rss&utm_medium=rss&utm_campaign=a-modern-approach-to-breakout-trading-the-better-breakout-strategy https://easylanguagemastery.com/strategies/a-modern-approach-to-breakout-trading-the-better-breakout-strategy/#respond Mon, 21 Oct 2024 10:00:00 +0000 https://easylanguagemastery.com/?p=535126

Are you interested in an intraday breakout trading system that has been consistently performing since 2012? You're in the right place! In this article, we'll explore a modern approach to trading breakout systems, and I'll even share the code with you—for free.

Hello, I'm Jeff Swanson, and with over two decades of experience in the futures markets, I'm here to share my journey and help you become a successful algorithmic trader. This is the second article in our series on breakout trading strategies. If you missed the first article, you can read it here, The Powerful Benefits of Breakout Trading Systems.

Let's dive right in.

Understanding the Better Breakout Strategy

Today, we'll delve into a powerful breakout trading system specifically designed for the futures market. The strategy is called the Better Breakout, and it's tailored for the S&P E-Mini Futures market. The performance of this strategy has been impressive, showing strong results dating back to 1987.

The original rules for this strategy were described in Futures Truth magazine back in 2012, in an article titled "Better Breakouts in the Electronic Age" by Murray Ruggiero. While the magazine is no longer in circulation, I've written an article about it called Better Breakout Trading Model.  I wrote that article back in 2012 and that means we have 12 years of out-of-sample data!

The Shift in Breakout Strategies

Traditionally, many breakout strategies use the 8:30 AM Central Time opening as a key price level for determining when to enter long or short positions. However, with near 24-hour access to the futures market, the significance of that opening time has diminished.

Murray Ruggiero proposed a twist on the traditional breakout strategy. Instead of relying on the opening range, we're going to use yesterday's price action to set our breakout levels.

Who Was Murray Ruggiero?

Before we dive deeper, let's take a moment to acknowledge Murray Ruggiero's contributions.

Murray was a pioneering figure in algorithmic and quantitative trading, renowned for his expertise in advanced technologies like machine learning and intermarket analysis. He spent decades refining data-driven approaches and authored numerous articles and books that have been immensely helpful to traders, including myself.

Unfortunately, Murray passed away a couple of years ago, but his work continues to influence traders worldwide. He's perhaps best known for his insights into intermarket analysis and seasonality patterns. Thank you, Murray, for your invaluable contributions.

The Logic Behind the Better Breakout Strategy

Now, let's explore how Murray's strategy can help us improve a typical breakout system.

Using Yesterday's Price Action

Instead of relying on the traditional opening range, we'll use yesterday's price action to set our breakout levels. Let's consider yesterday's bar, which includes:

  • Open
  • High
  • Low
  • Close
Figure A: Yesterday's Price Action Bar

Figure A: Yesterday's Price Action Bar

We will use this information to build our breakout levels. Specifically, we'll calculate offsets based on the difference between yesterday's close and its high or low. The larger of these two values is averaged over three days to create a dynamic breakout range.

Calculating the Offsets

Here's how the process works:

Here's how the process works:

  1. Calculate the High Offset:
    High Offset=High−Close
  2. Calculate the Low Offset:
    Low Offset=Close−Low
Figure B: High and Low Offsets

Figure B: High and Low Offsets

These calculations are straightforward. We're essentially measuring the distance from the close to the high and the close to the low.

  1. Determine the Maximum Offset:
    • Take the larger of the two offsets.
    • For instance, if the close is near the high, the high offset will be small, and the low offset will be larger.
    • Store the larger value as the Max Offset.
  2. Compute the Three-Day Average:
    • Calculate the max offset for each of the last three days.
    • Compute the average of these three values.
    • Store this in a variable called Max Offset Average.

This approach gives us a more adaptive breakout level that reflects recent market conditions. It's less dependent on the arbitrary opening price and more aligned with current volatility. As market conditions change, our offset adapts accordingly.

The Logic Behind the Adaptation

By accounting for significant price movements from the previous day—both the highs and lows relative to the close—we create a breakout strategy that's responsive to the market's recent behavior. Smoothing out anomalies by averaging over three days ensures that our breakout levels aren't overly influenced by a single day's extreme movement.

Implementing the Strategy in EasyLanguage

Now, let's delve into how to implement the Better Breakout strategy using EasyLanguage in TradeStation. Don't worry if you're new to EasyLanguage; I'll break down each part of the code so it's easy to understand. Remember, mastering EasyLanguage is a crucial skill for becoming a successful algorithmic trader.

Input:
CloseTime(1500),
Lookback(40);

Variables:
LastBar(0),
StopLoss$(0),
vMomentum(0, Data2),
LowOffset(0, Data2),
HighOffset(0, Data2),
MaxOffset(0, Data2),
MaxOffsetAvg(0, Data2);

Once LastBar = CalcTime(CloseTime, -BarInterval);

LowOffset = AbsValue(Close of Data2 - Low of Data2);
HighOffset = AbsValue(Close of Data2 - High of Data2);
MaxOffset = MaxList(LowOffset, HighOffset);
MaxOffsetAvg = Round2Fraction(Average(MaxOffset, 3));
StopLoss$ = Round2Fraction(MaxOffsetAvg / 2) * BigPointValue;
vMomentum = Close of Data2 - Average(Close of Data2, Lookback);

If (vMomentum < 0) and (EntriesToday(Date) = 0) and (Time < LastBar) Then
Buy("LE") 1 Contract Next Bar at Close of Data2 + MaxOffsetAvg Stop;

If (Time >= LastBar) Then
Sell("EOD") Next Bar at Market;

SetStopLoss(StopLoss$);

Code Breakdown

Let's go through the code step by step to understand how each part contributes to the strategy.

Inputs

  • CloseTime(1500): This sets the time (in military format) when we want to close all positions. Here, it's set to 3:00 PM (1500 hours).
  • Lookback(40): This determines the number of periods (in this case, days) for calculating the momentum indicator

Variables

  • LastBar(0): Will store the time of the last bar before the close time.
  • StopLoss$(0): The calculated dollar amount for the stop loss.
  • vMomentum(0, Data2): The momentum indicator based on the daily chart (Data2).
  • LowOffset(0, Data2) and HighOffset(0, Data2): Variables to store the offsets from the close to the low and high of the previous day.
  • MaxOffset(0, Data2): The maximum of the two offsets.
  • MaxOffsetAvg(0, Data2): The three-day average of the maximum offset, rounded to the nearest valid price increment.

Calculate Last Bar Time

  • Purpose: Determines the time of the last bar before CloseTime.
  • CalcTime(CloseTime, -BarInterval): Calculates the time by subtracting the bar interval from the close time. This ensures we don't enter new trades too close to the market close.

Calculating the Offsets

  • LowOffset: The absolute value of the difference between yesterday's close and low.
  • HighOffset: The absolute value of the difference between yesterday's close and high.
  • Data Reference: Data2 refers to the daily data series we've added to our chart. This allows us to access daily high, low, and close prices while trading on a 5-minute chart (Data1).

Determining the Maximum Offset and Average

  • MaxOffset: Selects the larger of the two offsets for each day.
  • Average(MaxOffset, 3): Calculates the average of the maximum offsets over the last three days.
  • Round2Fraction(...): Rounds the average to the nearest valid price increment (tick size), ensuring our calculations align with the market's price increments.

Calculating the Dynamic Stop Loss

  • Purpose: Sets a dynamic stop loss based on recent market volatility.
  • MaxOffsetAvg / 2: We take half of the average maximum offset to determine a reasonable stop distance.
  • BigPointValue: A built-in variable representing the dollar value of a full point move in the contract (e.g., $50 for the ES futures).
  • StopLoss$: The stop loss value in dollars, adjusted to market increments.

Calculating the Momentum Filter

  • Purpose: Measures market momentum to filter trades.
  • Close of Data2: The closing price from the daily data series.
  • Average(Close of Data2, Lookback): The 40-day simple moving average of the close.
  • vMomentum: When this value is negative, it indicates that the current price is below the 40-day moving average, suggesting a potential buying opportunity in a pullback.

Entry Conditions

  • (vMomentum < 0): Ensures we're only entering trades when the momentum indicator is negative (price below the moving average).
  • (EntriesToday(Date) = 0): Limits us to one trade per day.
  • (Time < LastBar): Prevents new entries too close to the market close.
  • Buy("LE") 1 Contract Next Bar at Close of Data2 + MaxOffsetAvg Stop;:
    • Action: Places a stop order to buy one contract.
    • Price Level: At yesterday's close plus the average maximum offset.
    • Order Name: "LE" (Long Entry).

Exit Conditions

  • (Time >= LastBar): Checks if we've reached the time to close positions.
  • Sell("EOD") Next Bar at Market;:
    • Action: Sells the position at the market price on the next bar.
    • Order Name: "EOD" (End of Day)

Setting the Stop Loss

  • Purpose: Implements the stop loss calculated earlier.
  • Dynamic Stop Loss: Because StopLoss$ is based on recent volatility, it adapts to changing market conditions.

By understanding each component of the code, you can see how the Better Breakout strategy uses recent price action and market momentum to determine entry and exit points. The use of dynamic calculations makes the strategy adaptive to changing market conditions, which is crucial for long-term success in algorithmic trading.

If you're new to EasyLanguage, I highly recommend taking the time to learn it. The best way to do that is to have me teach you in my System Development Master Class.  Being able to code and test your own strategies is an invaluable skill that can significantly enhance your trading performance.

Setting Up the Chart in TradeStation

To implement this strategy in TradeStation:

Chart Settings:

  • Session Times: 8:30 AM to 3:00 PM Central Time.
  • Time Frame: 5-minute chart.
  • Slippage and Commissions: $30 deducted per round trip.
  • Data Stream:
    • Data1: 5-minute chart (trading timeframe).
    • Data2: Daily chart (for calculations).

Trading Rules:

  • Long Only: The strategy is designed for long entries.
  • One Trade Per Day: Ensures risk management and prevents overtrading.
  • Close All Trades at End of Day: All positions are closed at the specified close time.

Performance Analysis

The equity curve shows a steady upward trend since 2012, indicating consistent performance. While there has been some choppiness in recent times, the strategy has maintained its profitability

Better Breakout 2024

Better Breakout 2024

Key Performance Metrics:

  • Total Net Profit: Approximately $35,000.
  • Average Trade Profit: $181 (including slippage and commissions).
  • Total Trades: 191.

Annual Returns Breakdown:

  • Profitable in most years since 2012.
  • Notable exceptions in 2013 and potentially 2024.

Trying the Strategy on Different Markets

One of the great aspects of algorithmic trading is the ability to test strategies on different markets. Let's see how the Better Breakout strategy performs on the NASDAQ futures (NQ).

A New Market and New Chart Setting

In an effort to explore the robustness and adaptability of the Better Breakout strategy, I decided to apply it to the NASDAQ futures (NQ) market. The NASDAQ futures often exhibit higher volatility and different trading dynamics compared to the S&P E-Mini Futures (ES), which can potentially enhance the strategy's performance.

Next I adjusting Data2 to use a 1,440-minute chart (equivalent to a daily chart), we can test the strategy on the NASDAQ futures.

The 1,440-minute chart provides more accurate pricing information because the closing price represents the actual last traded price, rather than the settlement price used in daily bars. Settlement prices can introduce inaccuracies due to adjustments made at the end of the trading day, which can affect real-time trading strategies. By using the last traded price, we eliminate issues with changing settlement prices, leading to more precise entry and exit signals.

Using a 1,440-minute chart leads to more accurate backtesting results. It removes discrepancies between daily Open, High, Low, and Close (OHLC) prices and minute bar OHLC prices that can significantly impact backtested strategy performance. 

Better Breakout on NQ with 1440 minute data2  2012 to 2024-10-09

Better Breakout on NQ with 1440 minute data2 

Improved Performance Metrics:

  • Total Net Profit: Approximately $60,000.
  • Average Trade Profit: $308.
  • Total Trades: 193.

The equity curve for NQ shows an even more impressive upward trend, with a new equity high as recent as August 2024

Experimenting with the Momentum Filter

In the original Better Breakout strategy code, we included a momentum filter to improve the quality of our trade signals. This filter is designed to ensure that we only enter trades when certain momentum conditions are met, potentially increasing the efficiency and profitability of the strategy.

I also experimented with removing the momentum filter to see its impact.

Without Momentum Filter:

  • Total Net Profit: Approximately $67,800.
  • Average Trade Profit: $108.
  • Total Trades: 627.
  • Profit Factor: 1.63.
  • Equity Curve: More volatile with a larger number of trades and lower efficiency.

With Momentum Filter:

  • Total Net Profit: Approximately $60,000.
  • Average Trade Profit: $308.
  • Total Trades: 193.
  • Profit Factor: 1.88.
  • Equity Curve: Smooth upward trend with fewer trades and higher efficiency.

By only allowing trades when the price is below the 40-day moving average, the filter reduces the number of trades. It helps us focus on higher-probability setups where the market may be poised for a rebound after a pullback.

This illustrates the importance of testing different ideas. Removing the momentum filter increased the number of trades and total profit but reduced efficiency. Depending on your trading goals, you might prefer one setup over the other.

Avoiding Rookie Mistakes

When experimenting with algorithmic trading, keep these common pitfalls in mind:

  1. Not Trying Different Markets:
    • Don't limit yourself to a single market. Testing on similar markets can yield better results, as we saw when switching from ES to NQ.
  2. Not Trying Different Time Frames:
    • Experiment with different time frames, both for your trading chart and data inputs. Small changes can lead to significant differences in performance.

Conclusion

In this article, we've explored the Better Breakout strategy, a robust and adaptive approach to intraday breakout trading that has stood the test of time since its inception in 2012.

The Better Breakout strategy continues to demonstrate its effectiveness in today's markets, proving to be a reliable and adaptable approach for algorithmic traders. Its strength lies in its simplicity and the use of dynamic calculations that adjust to changing market conditions. Whether you're a novice trader or an experienced professional, this strategy offers a solid foundation upon which you can build and customize your own trading system.

By understanding the underlying logic and experimenting with different time frames, and filters—you can tailor the strategy to fit your trading style and objectives. I think the Better Breakout only works well for the stock index markets, but it's worth testing other markets. 

Final Thoughts

Algorithmic trading is a journey of continuous learning and adaptation. The Better Breakout strategy serves as an excellent starting point, encouraging you to delve deeper into the mechanics of trading systems and the nuances of market behavior. As you apply and modify this strategy, you'll gain valuable insights and develop the skills necessary to become a successful algorithmic trader.

Remember, the key to success lies in diligent testing, thoughtful analysis, and a willingness to experiment. Don't hesitate to explore different markets, adjust parameters, and incorporate new ideas. The more you engage with the strategy, the more proficient you'll become in crafting systems that align with your goals.


]]>
https://easylanguagemastery.com/strategies/a-modern-approach-to-breakout-trading-the-better-breakout-strategy/feed/ 0