“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.

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

No comments.


Add a Comment