Indicator Builder Overview
Oftentimes we use chart indicators and studies to try to understand price action. That understanding is one of the components we use when buying or selling in any financial market.
Moving averages, Bollinger Bands, RSI, ADX and MACD are used heavily by most traders and are among the first chart tools that people learn when they start technical analysis.
MACD for example was created in the 1970s by Gerald Appel. The RSI, ADX and ATR were developed in the late 70s by J. Welles Wilder. Moving averages have a similar long history. Crossovers of the 50 and 200 day moving averages have long been considered as a signal of a new bull or bear market trend.
Why you need your own indicators
While standard indicators are useful, the overuse of any system is guaranteed to bring its demise.
If a majority is following the same signal, then who is there to take the other side of the trade? A classic example of this is the bullish golden crossover. If everyone sees the cross approaching & knows the market will rise, the advantage will go to early movers who front-run the market before that rise happens.
In this way the value of the indicator is eroded over time by those front-running it until it’s no longer useful.
Paying attention to standard indicators is helpful; but those who are most successful develop their own trading systems.
- your own system is unique and not eroded by overuse
- know exactly what’s inside… it’s not a black box
- test different trade setups easily and quickly
- customize it to your own needs not someone else’s
- it will be up to date, not an off-the-shelf idea designed years ago
- improve it yourself as you get results
For non-programmers, creating your own chart indicators might sound a bit daunting to start but it really is not difficult. The benefits are so great, that it’s worth taking some time out to understand the process.
Tradoso provides a simple tool that makes it easy to plug indicators and other operators together to create your own sophisticated trading algorithms. By following this in stages you can create a fully automated trade system. There’s no coding needed, technical know-how or complicated maths involved.
On opening the builder tool you’ll start with a blank slate from which you can start adding components to create your algorithm.
The menu actions in the builder.
- Save: Save the indicator
- New: Start new indicator
- Undo: Undo the last edit operation
- Plus: Add row above
- Minus: Remove row above
- Cut: Cut the current row
- Copy: Copy the current row
- Paste: Paste contents into current row
- Delete current row
- Search: Search dropdown for operator. Use check icon to accept choice.
- Preview: Preview results
Each component in your trade system is a row in the builder that has inputs and outputs. You can copy or move any row using the mouse or device equivalent. To move a row, click and drag the row then drop it over the new location. To copy a row, click and drag while holding to the control key (CTRL).
When you first open the builder, you’ll see a blank page and a prompt to enter the first operator.
An operator is just something that takes input and creates some kind of output. Let’s take the example of an Add operator. An Add operator takes as input two numbers, and outputs the sum of those two numbers.
Operators like Add work on single values. Many operators that are useful for analyzing charts work on strings of numbers.
Take the Summation operator for example. A summation adds together a string of numbers of a certain length. The length of that string of numbers is an input parameter to the operator.
That is, as well as giving an input, the operator lets us define the length of the summation. In the above example, the input to the Summation is High price. The length of the summation is 30 chart bars. The result of this will be to sum the high price over each of the last 30 bars.
The preview button next to operator lets you see the output of that individual step.
On clicking the preview, the plot of the Summation is shown overlaid on the price chart. In this illustration, the chart is EURUSD 1D. The output is shown as the blue line (see below).
By default, the output line is plotted on its own axis, separate to the price axis. This is useful when the outputs are much bigger or smaller than the price. This happens with a summation because in this example, on average each point is 30 times the value of the price.
To change the axis setting, just set the axis switch in the chart settings tab. This tab is opened by clicking the cogs icon.
To change the market or timeframe, just click the bars on the top left side of the chart. This opens a menu box where you can choose the market, the chart type, and the date range. Once those are set, click the OK button to apply the changes. See the image below.
Designing an indicator
Building a useful automatic trading system usually involves connecting together several different components. Doing this lets you make certain calculations using the price inputs, and from that trigger a buy, sell or some other signal when certain conditions are met.
It’s useful to have a design idea before creating a complex system. In most cases, a design starts as a conceptual idea, and that gets fleshed-out into a simple paper design that outlines each of the steps.
Tradoso’s indicator generator provides you with logical operators, comparisons, array operators, date functions, output operators and others. From these building blocks, you can create a system with sophisticated logic.
The most basic are comparison operators. These include equals, less than, greater than and so on.
Less than takes two inputs; input 1 and input 2. It returns true, when input 1 is less than input 2 and false otherwise. Or mathematically,
Input 1 < Input 2
Take an example. Suppose we want to know where the open price is less than the close price. This is just the definition of a white candle in a candlestick chart.
Hence the logic above just selects white candles. Using greater than instead would have output all of the black candles.
Instead of using chart prices, comparison operators also let you use a single value. Let’s say we think there’s good price support for EURUSD at 1.10. To locate places where the price falls below 1.10 we set the second input to a constant, then set the value of that constant to 1.1.
The image above previews the result, which as can be seen, marks out areas where the high price dips below 1.1.
The equals operator compares its inputs returning true when they are the same. There are two modes, exact match and interpolate, which can be chosen in the settings. An exact match will return true only when the inputs are identical.
In interpolate mode, Equals will return true when the price line (or whatever the input is) crosses the value between any two bars. For example, with interpolate mode, Equals(High price, 1.1) will return true when the price in one bar is 1.05 and the price in the next bar is 1.15.
The logical operators are important building blocks. These include And, Or, Not, and XOR.
They allow you to combine outputs from other steps to create more elaborate logic.
Suppose we want to detect white candles, but this time only where the price is less than 1.1.
This is very easily done. We just use an And operator. The first input is the logic to detect the support range at 1.1. The second input, is the logic to detect the white candle. Putting these two pieces together tells us where there is a white candle and the price is less than 1.1. The chart above illustrates the output.
So far we’ve looked at operators that use constants and data series values such as high and low price. But sometimes, when creating an indicator we want to process adjacent bars. For example, we might want to detect places where pairs of white candles occur.
The array operators exist to provide this function. The most important of these is Array Shift. Array Shift simply takes its input and shifts it on the time axis by a specified number of bars.
Let’s say we want to combine all of the logic above. That is, to detect a white candle, where the price is below 1.1. But this time we only want to detect cases where the previous candle is black.
To do this, we use a small bit of logic to detect a black candle, and then input that to Array Shift with value 1 bar. As we need to combine this with the previous logic, the And operator is used as this tells us where both conditions are true. The image above shows the output.
A very common task when creating indicators is finding places where a condition starts or ends. For example, suppose we just wanted to detect where the price initially falls below 1.1 but don’t want to do anything once the price is already below this range.
A quick way of doing this is using a function called Dirac delta. This function just looks for change, and ignores everything else.
Applying Dirac delta to our existing logic to detect the support line creates the chart as below.
Notice that the up spike identifies where the condition starts, the price drops below 1.1, and the down spike locates where the condition ends as the price rises above 1.1. There is no output at other places.
In this basic example, we could create a sell signal at the start and a buy signal at the end. Or, the other way around.
To select the start or end conditions, just use a comparison operator to locate where the Dirac delta output is greater than zero (the start) or less than zero (the end).
Dates and times
Dates and time operators let you process events at certain times, on certain days and so on. All date functions are based on Unix time.
Day of week for example returns a number for each day. Monday is day 1 and Sunday is day 7.
If we want to trigger an event on Monday for example, we can create a simple piece of logic using Equals and Day of Week.
In this comparison, the constant value is set to 1, to match Mondays. The Equals operator is set to exact match (not interpolate). As the chart above shows, this produces an output only on Mondays.
The date function uses the bar time of the data points in the current chart. For example, weekly charts usually start on Sundays and therefore each bar will usually have the same day. Daily forex charts start at midnight.
Times are displayed in your current time zone, according to your device. Your active time zone is shown in your account settings.
Most operators require chart data to work with. Data values are the raw data from each bar that you can use in your functions. These are
- Open price
- High price
- Low price
- Close price
- Median price
In the candle example above we used Open price and Close price. Median price is the midway point between High price and Low price. Time is the Unix timestamp of the chart bar.
When you’ve completed your indicator, you can have it output a buy signal, a sell signal or both. These operators take a value as input, and when that value is true they output that trade signal, displaying a marker on the chart.
For example, on choosing the Buy operator, we just need to plug our logic to the input of that operator.
Now on clicking the preview of the Buy operator, we see buy signals that correspond to white candles within the specified price range.
To create buy and sell signals in the same indicator, the Buy/Sell operator provides two inputs. One for buy-logic and the other for the sell-logic.
If you want your indicator to output two line signals, use the 2-Output operator.
Saving a new indicator
You can save your indicator by clicking the disk icon and giving it a name. Once saved, you will be able to set alerts on it, and use it in charts. Notice that once saved, your indicator name will appear in the drop down list so that you can use it as input to your other indicators or strategies.
Here are a few tutorials that explain step by step how to build some useful indicators
- Building a basic custom indicator: Candle pair
- Moving average crossover
- Identifying bearish tops
- Engulfing candlestick indicator
- Bearish capitulation
- Pivot support breakthrough
- 200 day moving average breakthrough
- Engulfing candle detector with gap
- Creating a divergence detector
- Price volume divergence
- Bullish momentum breakout
- Detecting bullish higher highs
- Bullish MACD crossover
- Bollinger squeeze
- Bollinger swing trade
- Price mean reversion