“Initial Balance” Rotation Strategy: Part 4 – Signal Limiting

Posted in RTL by astoeckley on January 20, 2011

(This is a continuation in our blog series on creating a trading system from start to finish. Want to see more? Click here for our main RTL support page, which links to the articles in this series and many more tutorials. Questions? Click here for the RTL Community Forum where you can get help on your programming.)

Today we show a nifty little technique for limiting a signal to just the first marker on a chart.

In our previous article in this series, we showed how to create a signal that triggers when prices rise to the 200% IB High.

The problem is obvious: usually, many bars in a row meet the signal conditions, so you end up with a rather inelegant series of overlapping signals that are redundant and not particularly useful. With some short and simple RTL code, you can limit a signal so that it only appears once on a chart.

It is important to note that this is only necessary to beautify the visual depiction of a signal, on a chart. This is entirely unnecessary when backtesting. A backtest allows you to specify how many trade entries to take, regardless of how many signals appear.

In the above screenshot, the signal is added directly to the chart, which creates all the visual cues you see. To limit a signal so it only displays once, the first step is to remove the signal from the chart entirely. Or, you can start with a chart that does not already have the signal added. To remove a signal, click once on any signal marker on the chart, and this will highlight the signal so you can delete it by pressing the “Delete” key on your keyboard. You can also use the trash can icon on the chart’s toolbar (not the main MarketDelta toolbar).

We introduce two new RTL tokens to make this happen:

SIGNAL token : This very simple token indicates whether a signal is valid or not; that is, if the signal’s conditions are met. It is sort of a “signal of a signal” and will be clear in the example below.

SSTAT token – “Signal Statistics” : This versatile token lets us get information about the signals on a chart, and it has many, many options.

In short, we simply need the following information from each token:

  1. We want a marker to appear if the signal itself is valid. This is obvious, and we use the SIGNAL token for this.
  2. We want a marker to appear only if it is the first marker on the chart. We use SSTAT for this, using the setting of “Sum of Session Signals (Intraday).”

With the SIGNAL token, a value of “1″ means the assigned signal to the SIGNAL token is valid and its conditions are met. For the SSTAT token, we also use a value of “1″ to indicate that the total number of triggered signals on the chart is 1; this essentially means that we only take the first signal.

Our code will look like this:

The settings for SSTAT are:

You can access the SSTAT or any token’s settings later by right-clicking on them in the token list on the right of the RTL window. If you right-click on the SIGNAL token, it conveniently opens a new RTL window for that particular signal you are working with.

When you save and add this to a chart, using the same signal marker method instructed in our previous article, you will see only 1 marker, the first marker for the signal.

Here is a comparison between the raw signal on the chart, and this new code which limits the signal:

In this example, I used the “offset” parameter in the signal marker so the green marker did not overlap with the other markers. Without the offset and the extra signals, we just get this:

Since last time we showed the full RTL code for the 200% IB High, here is the similar code used in this signal:

LO <= ((SESST_LOW  – (SESST_HIGH – SESST_LOW))+1) AND TIME >1030 AND TIME < 1500

Note the “+1″ — as we noted last time, this creates the signal within 1 point of the actual 200% IB level, so you can enter the trade slightly ahead of time. Many market reversals occur just before this level, so this prevents the trader from missing the trade altogether. This will be an important part of backtesting, which we start looking at in the next article in this series.

“Initial Balance” Rotation Strategy: Part 3 – Signal

Posted in RTL by astoeckley on January 17, 2011

(This is a continuation in our blog series on creating a trading system from start to finish. Want to see more? Click here for our main RTL support page, which links to the articles in this series and many more tutorials. Questions? Click here for the RTL Community Forum where you can get help on your programming.)


Today we look at creating the actual trading signals based on the 200% Initial Balance rotational strategy previously outlined. In the last segment, we created a custom indicator to display these levels on the chart. Today, we use the same math from the custom indicator to build the signal. The advantage of first creating the indicator is to make sure our math is correct. Added to the chart, this indicator also lets us easily verify that the signal is triggered at the moments we would expect. So if you haven’t already, refer to Part 2 of this series for an explanation of the math involved, and how to setup the RTL tokens to study the 200% IB range.

Creating the signal is actually quite straightforward now that we are sure about the tokens and their settings and relationships.

Just as we had two indicators for each of the 200% IB High and 200% IB Low, we will also have two separate signals for the “buy at the low” and “sell at the high” entries.

Using either the RTL button on your toolbar or the File > New menu, create a New Signal.

We know that the 200% IB calculation is going to be the same as in our indicator, so the first thing you can do is copy/paste or type the indicator code into the the new signal window. We will start with the code for the 200% IB High:

Note: Because a signal requires a comparison between values, which this indicator code does not have, you will see an error in the title bar of this window after you press Save. This is because we are not yet done with the algorithm and have yet to turn it into a trading signal.

Next, we compare the current price to the level calculated using a “relational operator.” There is some room for variation here, but lets assume, for starters, that we want the signal to indicate a “sell” whenever price reaches the 200% IB High level. We will state that if the highest price of a bar/candle penetrates the 200% IB High, we signal a short entry. This occurs if the High (with RTL token “Hi”) is equal to or greater than this IB level:

Press “Save” again. If you already have a chart open to which you want to add this signal, use the Send To button, as we did last time with the custom indicator. You will choose “Signal Marker” from the options.

Alternately, you can add this to any chart in the same way you would add an indicator. Right-click on a chart and choose Add > Technical Indicator or press the Insert key on your computer keyboard to bring up the same window. Select the Signal Marker indicator and configure it as desired:

Press Add and Close and the 200% IB High signal is now on your chart. Where it is placed will depend on the “Location” setting you chose. Any bars that meet the condition of the signal will show the signal, so in our example so far, you may get multiple bars in a row that trigger the signal:

Because we have the custom indicator also on our chart (the blue line), we can quickly verify that the signal is indeed triggering in the right places.

However, we may wish to reduce the actual number of signals. One way to do this is by editing the signal.

To edit the signal quickly, you can double-click on any marker to bring up the marker’s settings. You can then press the Edit button to open the RTL window.

If you omit the “>” sign and save the signal, then the chart will only show a marker when a bar’s high exactly equals the 200% IB High level:

As you can see, this removed some of the markers from the chart, but we still see several consecutive markers for bars that fluctuated back and forth at the 200% IB High level. I demonstrate this here to make two points:

  1. A slight variation in your RTL code or the relational operator can make a big difference in your signal, so attention to detail is critical.
  2. You can quickly experiment with your code and try different algorithms without closing the RTL window; the markers update every time you press Save.

This code, without the “>”, is very limiting. It requires that the high of a bar exactly equal the 200% IB High level.

There is a more robust way to limit a signal from only displaying once on the chart. This method requires two additional tokens, making the RTL a bit more complicated. We will introduce this technique in the next blog post in this series. For now, I recommend you keep the original relational operator, “>=”, in your code.

Adding Conditions

We now have a signal that accurately displays when a bar passes above the 200% IB High. This is the only condition for the signal, currently.

Often, you will want a signal that triggers based on multiple conditions that must be met. We will add two such conditions to our signal based on the time of day.

The IB, by definition, is not complete until after the first hour of trading. Any signals that might appear during the first hour are not truly 200% IB signals. So we want a condition that prevents signals at that time.

Additionally, many traders don’t want to enter such a rotational trade too late in the day. The idea is that such a price extreme late in the day might continue until the end. Or,there may also not be much time left in the day to see a true rotation and make decent profit.

So we will add two conditions: one to limit the signal to times after the first hour, and another to limit it to times before the last hour. In the Eastern time zone, this means the time is after 10:30 am but before 3 pm. Addtional conditions use the “AND” operator.

This is easy to do by adding the following code to our signal:

AND TIME >1030 AND TIME < 1500

All times for the TIME token are in military format.

Adjusting Entry Level

Just because this strategy uses 200% IB levels does not necessarily mean that a trader will always enter exactly at these levels. Some traders like to get in a bit early, as clearly the market often reverses a few ticks away from this level. Other traders may want to wait until the market passes through the level by a few ticks. Whatever the preference, we can add this to our signal. In backtesting, we can determine the best entry point, but for now we will hard-set it into the RTL code.

Consider the following variation for our signal:

HI >= (SESST_HI + (SESST_HI – SESST_LOW))-1

We have enclosed the prior math into parenthesis, and then subtracted 1 point from this. The signal will now trigger when we get within 1 point of the 200% IB High. You could change this to 0.5 or even add 1 instead of subtracting 1 to change where the signal forms around the 200% IB High level. Later, we will change this to a variable and let MarketDelta tell us what is the best option here.

Putting it all together

Here is our final signal code for the 200% IB High:

You would then create the mirror image of this signal in the same way for the 200% IB Low, using the same math as we used in our custom indicator from last time.

“Initial Balance” Rotation Strategy: Part 2 – Indicator

Posted in RTL by astoeckley on January 3, 2011

(This is a continuation in our blog series on creating a trading system from start to finish. Want to see more? Click here for our main RTL support page, which links to the articles in this series and many more tutorials. Questions? Click here for the RTL Community Forum where you can get help on your programming.)

Summary

Last week, we took a look at the Initial Balance concept and how you can predict a day’s rotational extremes using Double IB extensions. We outlined our goals for a trading system based on this strategy.

Today, we will build a custom RTL indicator that mirrors the Market Profile 200% Initial Balance level on a regular candlestick or bar chart. It is important to note that the creation of a custom indicator is not the same thing as creating an actual trading signal that notifies you of trade entries; in fact, for a backtest, this custom indicator is not necessary at all. However, building the indicator offers two important advantages:

  1. It lets us test our algorithm’s math so we can verify that the calculations for Initial Balance price levels are accurate and properly reflect the same levels on a Market Profile chart. The same math will be used in the RTL signals, later.
  2. After we create the RTL signal, having both this indicator and the signal on the same chart makes it easy to verify that the signal is in fact signaling at the right moments, as we’d expect. Without the indicator, we’d have to constantly refer to a separate Market Profile chart to check if the signal works properly.

Build the Indicator

To get started, create an intraday Session 2 chart using a simple minute-based periodicity, such as a 5-minute. We use Session 2 because our Initial Balance levels are based on the first hour of RTH trading, which is 8:30 am to 9:30 am Central Time. The overnight price action is not a part of this strategy.

Next, use the File menu > New > Custom Indicator, or use the RTL button on your toolbar to pull up the RTL window.

First, we will build the indicator that shows the 200% IB Hi level. Separately, we will then build a second indicator to show the 200% IB Low level, for a total of 2 custom indicators.

In the RTL code, we use a “token” which automatically pulls in a value based on the outcome of a standard technical indicator. Each RTL token typically offers many different customizations, so the goal is to determine the right token(s) and then setup the tokens appropriately.

Before we can choose a token, we need to clarify the math used to create the 200% IB levels:

As you can see, the actual 200% IB levels depend on only one thing: knowing the high and low of the first hour of trading. The rest is simple math once we know this information.

The token which provides us with the high and low of the first trading hour is: SESST (“Session Statistics”). The SESST indicator is one of the most useful tokens in MarketDelta as it lets you quickly parse through a day of price data for just the information you need. It can do many different things, so the token must be configured for the 1st Hour Hi and Low at some point during the process. Because the same token cannot simultaneously show both the 1st hour Hi and the 1st hour Low, we will actually use two different instances of SESST in each of our indicators.

There are two different ways to configure tokens in the RTL code:

  1. Write the code from scratch, and include the name of the token in your code. When you Save the custom RTL work, MarketDelta automatically prompts you for the parameters for the token(s) you selected. SESST, for example, can be set to show many different things.
  2. Instead, add the tokens to the RTL window first and set them up as you wish. Then, write your RTL code. When you press Save, the custom indicator simply saves. You are not prompted to configure your tokens since you already did this prior to writing the code.

Either method is fine. Here we will show method 1, as it is faster once you get familiar with RTL coding. If you want a tutorial for method 2, click here for another blog post on creating custom indicators.

In the RTL window, we simply write the code for the 200% IB Hi, based on the math illustrated above. We use parenthesis to organize the math, and we substitute the token SESST whenever we wish to include the first hour High or first hour Low. Since the Hi and the Low are each their own SESST variable, we differentiate between the tokens of the same type by adding an underscore and a name to each token.

Type the RTL code into the RTL window for the 200% IB Hi:

As you can see, this math simply means:

First Hour Hi + IB Range

But it is expressed using the RTL token SESST.

Press Save and you will get pop-up windows to configure the two SESST tokens used:

Change the noted parameters so SESST_HI properly pulls in the highest price of the first hour.

After you press OK you are prompted to do the same for the next token, SESST_LOW, which is set to Lowest Price of the Low price of the First 60 minutes.

Finally, after the tokens are configured, you are prompted to give a name to your new custom indicator.

While not always necessary, it is a good idea to get into the habit of using the Check button in the RTL window after you are done and before you actually use the new RTL indicator.

When you use parenthesis or involve complicated math in your RTL code, you should make sure the software is interpreting your math exactly as you’d expect. The Check button breaks down the algorithm into its parts so you can verify it is processing in the right order. After you press Check, a window appears:

Here, we see that the expression’s parenthesis is calculated first, and stored internally as a variable, T1. Then the program adds T1 to the SESST_HI token. This is exactly as we’d expect. Sometimes seemingly simple mathematics will not work as expected because of the ordering of your expression, thus you should always use Check, and parenthesis, to control how math is processed.

Our 200% IB High indicator is now complete. Press “Send To” to add it to your chart that is currently active. Alternately, you can always add a custom indicator to any chart through the standard technical indicator window:

Or:

Either way, the indicator will then appear on the chart as a new separate pane:

All technical indicators appear by default as their own individual pane when you add them to a chart. To overlay them on top of another pane, in this case the price pane, simply click and drag the indicator’s line up to the price pane.

As an alternative, you can select the price pane at the time you initially add an indicator so ends up where you want it right away. You cannot use this method after the indicator is already on the chart. In the Add Indicator window:

Either way, after you add/move the indicator to the price pane, it appears:

If you so desire, you can customize its color and visual style by double-clicking the indicator line and select appropriate options in the Update Indicator window:

The 200% IB Hi custom indicator is now complete. Look at a Market Profile chart to make sure the indicator lines up with the same price points created by the IB Price Levels.

You would repeat this process to create the 200% IB Low.

The math:

This is simply the equivalent of:

First Hour Low – IB Range

Configure the tokens in the same way as for the prior custom indicator.

After you complete this second indicator and add it to the chart, you will see your completed 200% IB price levels:

Always check the results visually to make sure the indicator lines up with what you expect. In this case, we compare the lines drawn on the chart with a Market Profile chart to ensure they are mirroring those levels accurately.

Once we are confident that the indicator is correct, we no longer need to refer to Market Profile charts throughout the rest of this process as we build signals and backtest the strategy.

In our next tutorial, we build our first trading signal based on this strategy.

“Initial Balance” Rotation Strategy: Part 1 – Concept

Posted in CBOT Market Profile®, RTL by astoeckley on December 30, 2010

Over the next few weeks, we are going to demonstrate how you can chart, signal, and backtest a simple but popular trading strategy based on the “Initial Balance” levels made famous by Market Profile charts. Today we look at the concept itself. Check back with this blog regularly to see the additional installments in this series.

Concept

All trading systems must begin with a concept, or expectation of market behavior. Without a solid idea for a trading methodology, you can’t easily build trading signals and create backtests to determine historical profitability.

Except for trending days, when price tends to move consistently in one solid direction for the course of the entire day, the market usually “rotates” on most days by reversing at price extremes. Traders who accurately predict where these reversals occur can be quite successful. One way to estimate where rotational extremes may appear is by looking at levels created by the Initial Balance.

Market Profile traders are familiar with Initial Balance (IB) levels on their charts. The IB is most commonly defined as the range of prices during the first hour of trading. From this range we get additional price levels that could hold as reversal points on any given day. Some common price extremes are the Double IB High and Low. These are simply the full range of the IB extended above and below the High and Low of the IB to get the 200% IB High and 200% IB Low.

For example, if the Low of the first hour was 1200, and the High was 1210, the IB is a 10-point range. Add this range size to the IB High and IB Low and you get 1220 for the 200% High, and 1190 for the 200% IB Low. (150% IB extensions would be halfway between the IB and the 200% IB levels.)

By default, the Market Profile charts in MarketDelta automatically chart these levels:

Notice how the market came close the 200% IB Low and then reversed, or “rotated,” back up towards the center of the distribution. This is part of the idea behind Market Profile methodology. You may hear traders talk about “reversion to the mean” or a “return to value.” This is often the mechanism behind reversals at price extremes, such as the Double IB High or Low.

Look at these examples as well:

Though you could create signals and backtests for both 150% and 200% IB levels, or any other level you choose, we will start with the 200% in our tutorials.

The goal of this blog series is to ask the questions: How often can we reasonably assume that a 200% IB extension will hold? How many points away from this IB level is optimal for taking a trade entry? How profitable would I have been if I only traded 200% IB reversals for the last several months? What’s the best stop to have for this trading strategy? How long should I hold a trade to maximize my profit potential?

All these questions can be answered within MarketDelta using the Professional Complete version of the software, which allows you to build custom RTL algorithms to enhance your trading.

Stay tuned for our next installment, in which we build a custom RTL indicator to see these levels on a multi-pane chart, such as a bar or candlestick chart. This is the first step in generating an accurate RTL system for this concept. We hope that through these tutorials you will see how relatively straightforward RTL programming can be.

Custom Sessions and Viewing Historical Opening Ranges

Posted in CBOT Market Profile®, RTL, User Tips by astoeckley on December 21, 2010

This week, a user asked how to best view and study historical opening ranges.

Market Profile users, in particular, are used to seeing the Opening Range on every profile chart. The opening range’s duration may be customized, but it often refers to just the first minute of trading of the RTH session that starts at 8:30 am Central Time.

Some traders place great emphasis on the opening range, and devise trade setups around it. Since the first 30 minutes of the session is often the most active, highest-volume part of the day, it makes sense to gain insight into these first moments of the session.

If you wish to analyze opening ranges for the past several months, you would simply build a 1-minute multi-pane chart that starts at 8:30 am each day, and set the Period to “Last 200 days” or whatever you wish. Then you could scroll through the price history and observe the beginning of each day.

But if you want to really focus in on just the first minute, there is a more elegant solution that benefits those looking to study just these first few minutes: Create a custom session.

Visit the Setup menu > Preferences > Sessions. Click “New” and type a name for the new session you are creating, such as “Opening Range.” After you press OK, you are presented with a normal Session settings screen, which you can modify as follows:

A few points about this:

  1. This example is for Eastern Time zone; you can adjust accordingly
  2. “Post Time” should be unchecked for this purpose
  3. Don’t forget to change the “pm” to “am” for the “Stop Time” — easily overlooked
  4. The Stop Time can be set to anything you want; in this case, it lets us view the first minute, the opening range, and the following few minutes as well.

After you press OK, you can apply this session setting, and other necessary settings, to any chart, by right-clicking the chart and choosing Preferences > Chart:

To see the opening range, it should be a 1-minute chart, noted at the top under Periodicity, set to “Last 100 days” if you wish to see a few months’ worth of opening ranges. The session is set to your new session. After you press OK, you will see:

The first 5 minutes of every trading day.

Need more granularity?

The example above is easy to setup, and you can easily view several months, hundreds of days of opening ranges in this way, since all it requires is minute data.

But if you download Tick data, you can really see what is happening during the opening range by choosing bars based on seconds, not minutes. For example, a 10-second setting will divide the opening range into 6 bars.

To change the Periodicity to 10-seconds, set it to the following:

At which point, you will see this on your chart:

If you want to get particularly fancy, you can use the Paint Bars indicator to highlight just the opening range so it is easily to distinguish from the following minutes and seconds. You would need the Professional version of the software to highlight the bars based on time, using a simple RTL signal like this:

This signal simply requires that the affected bar be before 9:31am Eastern Time. (For more about creating custom signals, please click here to see another recent article.)

Now you can add a Paint Bars indicator based on this signal, as follows:

In the below example, I use the “Paint Background” setting in the Paint Bars indicator to highlight the opening range, based on 10-second bars:

You could then scroll through many days’ worth of opening ranges to see how they behaved and affected the following minutes. Remember, this second-based chart periodicity requires Tick data, and the Paint Bars implementation shown here requires Professional.

Create a Custom Signal in RTL for Value Area trades

Posted in RTL by astoeckley on December 13, 2010

We are happy to announce the birth of our RTL Community Forum where you can ask questions and get help on learning RTL, and for troubleshooting issues with your custom indicators and signals. We encourage you to post your RTL questions at the forum, as you will benefit from many readers who can offer insight into your programming. Our technical support team also checks the forums on a daily basis to provide input.

For an introduction to RTL, please read our previous article on building a custom indicator to familiarize yourself with the features of RTL. You can also quickly access all of our blog articles on RTL by viewing the RTL category link for this blog.

MarketDelta Professional versions provide an advanced engine for creating custom indicators, scans and signals, and then running backtests on those signals. Custom trading signals place markers on a chart that alert you to specific entry or exit criteria. You program these criteria into the software using RTL. They can notify you in real-time when your desired conditions are met, and they also show historical signals from prior trading days.

Creating a custom signal is similar to building a custom indicator. The window layout and RTL syntax is the same. In this article, we outline the basics of programming a signal and showing signal markers on a chart. In future articles, we will take this to the next step: backtesting a signal to determine its historical profitability.

Concept

All trading signals begin with an idea you have for a particular trading strategy. Today we look at a basic idea using the Value Area. By Value Area, we refer to the prior day’s value area high and low.

Whether you study Market Profile charts or use the Profile or TPO indicators on candlestick or footprint charts, you no doubt realize how import Value Area highs and lows can be.

Here is an example showing the reversals that often take place at the Value Area:

This particular chart uses the Profile indicator on a day session chart (Session 2 for the E-mini S&P futures), with the following settings:

This instance of the Profile indicator is only on the chart to help see the validity of the signals you create. These particular settings do not apply to the actual RTL signal you will create, which will have its own instance of Profile indicator inside the RTL window, called a “token.”

To see all the profiles for all the days on your chart, the “Compute Last” should be set to a large number, equivalent to the number of days you show on your chart.

Strategy

We want to create a signal that alerts us as the instrument (in this case, the ES contract) approaches the Value Area Low from below. That is, the session begins with the contract trading below yesterday’s established value. As it rises and approaches value, the signal suggests a short entry.

This is an easy signal to create. It’s important to note that this is only one signal that might exist as part of an entire strategy built around similar entries. For example, you might also go long at the Value Area High as price drops from above value. That would be a separate, distinct signal, and you would apply both of these to the same chart or trading system. In this article, we look only at the short entry, to get you started with the process.

Coding the Signal

Click your RTL button on the main toolbar to open a signal, and then choose “New Signal.”

The syntax for this signal is simple, as follows:

There are three tokens used in this RTL code: SESST, PROF and HI. Two of these are indicators: SESST and PROF. The two indicators must have specific settings, and the program automatically prompts you for these settings when you save this signal. Otherwise, you can instead, optionally, first create the tokens from the list, pulling them over into the right side of this window for use in your code.

In any case, the settings for these two tokens are:

This pulls in yesterday’s (Prev) value area low.

This finds the highest price reached during the day (session) by the time the current bar prints.

The RTL code, shown above in the RTL window, is:

SESST.1<PROF AND (PROF-HI)<1

This code will create a signal as price gets within 1 point of the Value Area Low, from below. This makes it possible to signal a potentially rewarding short trade even if the price doesn’t exactly hit the level.

The first part of the code states that the highest intraday price reached by the end of the previous bar is lower than the value area low. This means that the market opened, and has remained, below the value area so far during the day. “SESST.1″ refers to the historical value of the SESST indicator/token from one bar ago. Since PROF remains the same all day, it is not necessary to add a “.1″ after it, though you could and it would make no difference in this particular case.

The second part of the code simply requires that the price difference between the Value Area Low and current bar’s highest price is less than 1 point. Again, this is optional; I include it here to give some “front running” potential to the trade. In a backtest, you could experiment to see if front running was really necessary, or if front running by a greater or lesser amount would make a difference to long term success. We’ll investigate this in future blog articles.

After you save and send this signal to the chart, you will see markers such as these:

Because we have the Profile indicator added to the chart, we can verify if the signal is working properly. Note how the signal correctly triggered a short entry marker when the market bounced off these Value Area Lows from below.

The signal marker itself is highly customizable. You can change the icon, the color, the placement or even trigger sounds when the signal criteria is met:

Hopefully this will get you thinking about how you can quickly build these indicators. As you can see, the actual RTL code is often quite minimal for common trading ideas.

Check back with this blog to see more examples in coming weeks.

Create a Custom Indicator, the 3/10 Oscillator

Posted in RTL by astoeckley on October 18, 2010

The Real-Time Language (RTL) within MarketDelta allows anyone to harness the program’s internal compiler for building custom technical indicators. Access to RTL is available in the Professional versions of MarketDelta.

MarketDelta offers a wide assortment of technical analysis tools to please chart enthusiasts, especially novel indicators such as the Volume Breakdown, Profile and TPO indicators, as well as numerous tools designed for statistical analysis. But sometimes you may want to take matters into your own hands. Using RTL, you can design your own indicators or mirror those you’ve seen elsewhere.

The “3/10 Oscillator” is a simple technical analysis indicator made famous by trader and educator Linda Raschke (who appears in the popular book, New Market Wizards). As with most oscillators, the 3/10 is an effective way to gauge momentum and see price divergence. The 3/10 oscillator resembles other well-known oscillators, such as the MACD, RSI and Stochastic indicators. Its calculation is particularly basic. The main oscillator charts the difference between 3-period and 10-period simple moving averages, hence its name. To smooth the results, a signal line overlays the oscillator, comprised of a single 16-period moving average of the indicator itself.

Despite its popularity, the 3/10 oscillator is not included in most charting platforms, which often leaves traders wondering how they can use it. However, it is easy to build one in MarketDelta. This process shows you the basics of using RTL.

To begin, open any multi-pane chart in MarketDelta to which you wish to apply this new custom indicator.

Then, click the Open RTL button on the main MarketDelta toolbar, and choose Open Custom Indicator from the pop-up menu. (Don’t see an RTL button? See this article.) A new pop-up menu will then appear:

From this new window, choose the first option, New Custom Indicator, then press OK.

A new pop-up RTL window appears:

“Tokens” are the results of other program indicators or references that may be used in RTL. The list above shows all these different tokens you can add to your new Custom Indicator.

Since the 3/10 oscillator is the difference of two moving averages, we will need to add 2 tokens, both of which are a moving average with a specific setting.

Scroll down in this list to find “MA: Moving Average” and double-click this token. A pop-up window for the MA will appear:

Our first MA token will be for the 10-period moving average that is part of the 3/10 oscillator. So make sure it says “Simple” and a period of “10″ and press OK. The token appears to the right of the RTL window now:

Now add another MA token in the same way, but double-clicking the MA from the list on the left of the window, and this time choosing “3″ for the period. Once you click OK, the program will prompt you to rename this token, since you cannot have two tokens with the same name as “MA.” So, feel free to rename it as anything you wish, such as “MA_three.”

Next comes the actual RTL programming to create the token.

The 3/10 oscillator is defined as the difference between a 3-period and 10-period moving average. These two moving averages already exist now as RTL tokens, each with a specific name as listed in the “Token” column on the right of the window.

Thus, our RTL code will simply say:

MA_three-MA

Type this into the code box at the bottom of the RTL window. The code *is* case-sensitive:

If desired, press the “Check” button to see if the program understands your RTL code. In particularly complex custom RTL coding, this is useful.

If all’s good, save your new indicator pressing the “Save” button, and give it a name. If you are making changes to an existing indicator and want to save them under a new indicator name, use the “Save As” button.

At this point, you have two options. The indicator has now been created and saved. You can either exit this window and apply it to any chart, or you can have it automatically applied to the currently-selected chart in the program by pressing the “Send To” button and selecting “Chart – Custom Indicator.”

If you choose to add a custom indicator later to any chart, press the “Insert” key for the shortcut window to add an indicator, and click “Custom Indicator.” This displays the option on the right of the screen to select the RTL indicator you recently created and saved:

Select the custom indicator you want, and press the “Add and Close” button. It will now appear on the chart:

Next, we need to add the 16-period moving average to the custom indicator for the smoothing signal that is a part of the 3/10 oscillator.

Technically, this is called an “indicator of an indicator,” since we are adding one indicator to analyze the results of another indicator. In RTL, this is an entirely separate indicator.

Open the RTL window again, using the steps from above to create a new custom indicator.

Now, here’s a simple shortcut to create the signal line and add the tokens to the RTL window automatically. In the RTL code box at the bottom of this window, simply type:

MA(CI)

In this case the “CI” stands for “Custom Indicator.”

Press “Save” and since you had not already pulled in the tokens, MarketDelta will prompt you for the settings for both the moving average as well as the custom indicator. You can set the MA to 16, and then just select your recently-named 3/10 indicator for the CI pop-up.

Once this is done, the tokens will appear in the RTL window, and you can save the indicator as you did the last one. Note: though this indicator is associated with the 3/10, you must save it as a new indicator with a unique name. Perhaps “310_signal” or similar is appropriate.

Next, add this second custom indicator to the chart, either by using the “Send To” button as noted before, or by manually adding the indicator using the “Insert” button.

It will appear at as an entirely separate pane in the chart:

Next, we want to move the signal line to the original 3/10 indicator pane we first added, so they are not on separate panes. To make sure the signal is clearly obvious after they both appear on the same pane, first change the color of the signal line by double-clicking it and adjusting the color settings. (You must double-click right on the line itself to get these settings, which is the same process as changing settings for any indicator.)

After you change the color, click once on the signal line so it is clearly selected (the line will appear bold). Then drag this line up onto the original 3/10 pane. It will move and appear overlaid, so the full 3/10 oscillator with signal is apparent:

Congratulations!

One simple step you can do to clean up a chart after you dragged indicators around is to auto-resize the panes. Right-click on the chart and choose “Size Panes” followed by “Instrument Panes 75%” or whichever option you prefer.

While the math in this particular indicator is quite simple, it outlines the process of converting a concept into programming code and then into a visual representation of that code, using RTL.

But it doesn’t stop there. You can harness many powerful built-in indicators, such as Session Statistics, to create entirely new ways of looking at the market, all using this same process.

Customize the Main Toolbar

Posted in RTL, User Tips by astoeckley on October 18, 2010

The Main Toolbar in MarketDelta is an important part of program operation. It allows you to see the “Hearbeat” icon, which signals if your data feed is sending data. You can also start your data service and download historical data all from this toolbar.

You can easily customize what appears on this toolbar, as well as its size. To see the available options for customization, right-click the white Status bar in the toolbar, and you will see a menu:

The settings are:

Anchored - locks the toolbar to the main program window so it doesn’t “Float.” If you are often “losing” the toolbar from dragging it around your monitors, this may be a convenient option.

Button Titles – After you become familiar with what each button does, you may find you no longer need to view the text titles that appear under each button. Unchecking this option will make the toolbar smaller, providing more room for your charts, if desired.

Condensed - This removes spacing between the buttons so they are closer together, thus shortening the size of the toolbar.

Slim - If you are in need of maximizing the vertical real estate on your computer monitor, this setting forces the entire toolbar, including its Status bar, into one row.

You can also change which buttons actually appear on the toolbar itself. This useful if you want to reduce clutter by removing buttons you do not use, or by adding buttons that you would use more often, for frequently-used features.

For example, if you subscribe to a Professional version of the software, you may wish to add the RTL button to the toolbar so you can quickly access those features that set these versions apart. Simply click the “Preference” option after you right-click the Status bar. You will get this pop-up window:

Select the buttons you wish to appear or not appear, and then press the OK button, and your Main toolbar will change accordingly.

Creating a Signal Marker (Alarm) on Keltner Channel

Posted in RTL, User Tips by tharnett on July 1, 2010

More and more people are showing interest in RTL (Real Time Language). This is the language in MarketDelta used to create custom indicators and studies that does all sorts of things.

Below is an example of a practical way to have a marker popup on a chart when a specific condition is met. In this case we have a Keltner Channel and want to see the bars that close above or below the channel and have those bars specifically marked in some way.

The video below shows how to accomplish creating a simple signal and the links below are a great place to start learning RTL. Something not in the video but can be accomplished is the ability to have the signal produce an audible sound when the signal occurs. This is in the signal marker properties. Just click the box “Signal Action” and choose a sound.

Complete RTL Information and RTL 101

Coding Indicator on Indicator with RTL Formula Language

Posted in RTL, User Tips by tharnett on December 10, 2008

In the very brief time I’ve been at MarketDelta, the question of using the RTL custom programming language has come up often. RTL is the proprietary, embedded scripting language which allows custom indicators, trading signals and multi-instrument scans to be developed within MarketDelta. The Pro and Pro Complete versions of MarketDelta support RTL.

For more information on RTL please see the MarketDelta knowledge base including these links:

What Is RTL?

How To Create Custom Indicators

I am happy to report that we’ll be introducing numerous RTL and trading system related videos over the coming months. One of the more frequent requests is how to program an indicator on indicator using RTL.The video in this blog post will take you, step by step, through the simple process of creating a moving average of the commodity channel index. While you may not be interested in this specific configuration or these particular indicators, I encourage you to watch if you’re at all interested in RTL programming.

The principles will transfer to your own creative ideas. I’m a self-taught programmer, and what I’ve found is that the easiest way to learn is to just keep examining sample code, over and over until it sinks in. And, as you’ll see in this video, useful creations don’t necessarily mean complex or difficult to build.