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 great course called System Development Master Class. It's offered a couple of times per year so, if it's not available. Get on the waiting list. You'll be very happy you did.
In the first example- you’re exploiting the long only bias by only taking long positions. If you’re not taking short trades and if the long only bias is real- can closing a long trade and re-entering ever beat a simple buy and hold strategy. You’d close the long position on weakness (going flat)- but enter back long on strength or a breakout, so you’re effectively entering later in the draw down recovery …. and that drawdown is only open equity as the trade is never ‘banked’? Thoughts….? TY
Hello! This point is not to beat buy and hold. Why? This is NOT a trading system. This is a market study to understand the market characteristics. This information could be used to build a trading system.
Jeff, I’m an experienced trader, and prior to opening a TradeStation account and engaging with EL, I’m trying to determine if a simple system I trade can even be coded and backtested in EL. Because it involves the issue of buying at a bar open.
In my reading and watching of EL tutorials I’m not sure if it can be coded in EL. And if it can’t, then I’m not going get on that long path.
To be precise, IF the close of yesterday’s bar meets certain conditions, for example above or below an MA, and IF the bar open today is above or below the close of yesterday by X percent, then enter the trade.
Sounds simple. And it is. Or, should be. Understand I’m NOT looking for code, but just a confirmation of my suspicions regarding problems with entering on a bar open. Thanks for your opinion.
Hi Eric. TradeStation, by default, will place orders at the next bar open. When a bar closes, your EasyLanguage code executes, and if a new position needs to be opened, it will be executed at the open of the next bar. These are most likely at market order. However, your condition is also testing the opening price of today’s bar. The price of today must exceed yesterday’s price x percent. If I understand you correctly, this would require a stop order. This can be done in EasyLanguage. When you place your order in EasyLanguage, it will look something like this:
buy next bar at myPrice stop
The price at the opening to todays bar must be at or above your stop price (myPrice) to open a new trade.