Loading...

Sign Creation Tutorial

Overview


In this tutorial we will learn how to set up a position opening in the EA by setting signals. We should note that these settings are not an indication of operation, we are looking to understand how to assemble the signals so that from this understanding, we can create our own setups. The signals presented here in this tutorial will result in losses and should not be used on your real account.

Buy signal params & Sell signal params


The parameters below are used to create the operational signals. Here's a brief explanation of each of them:
=>input signal - Signal configuration for opening positions.
=>filter configuration - Configuration of the necessary precondition for an open signal to be valid.
=>output signal - Configuration of the exit condition of an operation, whether it is in a winning or losing condition.
=>stoploss price - Calculation configuration to obtain the stoploss position at the time of opening the position.
=>takeprofit price - Calculation configuration to obtain the takeprofit position at the time of opening the position.

LOGICAL OPERATORS


+ - * /
Mathematical Operators
>
Returns true when a value x is greater than y.
>=
Returns true when x is greater than or equal to y.
<
Returns true when x is less than y.
<=
Returns true when x is less than or equal to y.
&&
Returns true when both operands are true.
or
Returns true when both operands are true.
==
Returns true when element is equal to another.
!=
Returns true when element is different from another.

More complex calculations or conditions must be kept within the indicators. If there is any need to obtain more complex values, please let us know so that we can study the situation, we are open to adjustments in the indicators or to meet any situation that makes it impossible to set up your configuration. The only configuration that is mandatory for the EA to operate automatically is the input configuration, the other configurations are optional, but obviously filling in the set of these configurations in sync is what we are looking for to create a setup.

To learn this understanding, let's use the EURUSD symbol on the M15 timeframe.We will initially use the IKAMA indicator "Kaufman Adaptive Moving Average" to perform a configuration. By adding the indicator to the chart, we can observe the available buffers in the data window.

IKAMA[1,0] = corresponds to the value of the short moving average of the previous candle.
IKAMA[1,1] = corresponds to the value of the medium moving average of the previous candle.
IKAMA[1,2] = corresponds to the value of the slow moving average of the previous candle.

The IPRICE indicator provides the values ​​of conventional candles, heikin-ashi, digits and symbol points.

To obtain a value, we must inform two parameters. Example: IndicatorCode[x,y], where x is the candlestick number and y is the indicator buffer. The candle number equal to zero (0) corresponds to the last candle, that is, the current candle in practice. The number one candle (1) corresponds to the previous candle, and so on. Any value less than zero will be treated as zero. The indicator buffer number is the buffer that stores the information you want to get as a signal. If you try to read a non-existent buffer, the return will be zero(0).

Let's see in practice the assembly of the sign to simplify the understanding. Remember to use a demo account for this purpose and save your settings as soon as you see fit, that way you can load the settings into the strategy tester whenever you want without having to re-enter all the settings.

INPUT


Let's create an entry signal when the price crosses the fast average of the IKAMA indicator for example.
Buy input signal: (IPRICE[1,3]>IKAMA[1,0])&&(IPRICE[0,3]<IKAMA[1,0])
Sell input signal: (IPRICE[1,3]<IKAMA[1,0])&&(IPRICE[0,3]>IKAMA[1,0])
StopLoss: 300 ticks
TakeProfit: 300 ticks
Run the strategy tester to view the result. Note that the EA makes the inputs as programmed.

FILTER


The application of filters is used to tell the EA that a signal should only be selected if the filter is valid. In our example, we limit inputs when the three mobile media are oriented. We will enter in favor of the averages as follows:

Remembering that the tutorial of this tutorial is just to demonstrate some functionality, probably as inputs will present good results in some moments, as well as bad results in others. The use of other indicators like Stochastic, RSI and ATR are very useful to eliminate unwanted moments from the settings. Creating a setup requires time, dedication and analysis of the symbol you want to trade a lot. The same study configuration will probably not work for all your symbols, as each one may have its specific characteristics and this can develop our EA with the necessary flexibility for you to make your operations automatic.


Buy input signal: (IPRICE[1,3]>IKAMA[1,0])&&(IPRICE[0,3]<IKAMA[1,0])
Buy filter configuration: (IKAMA[1,2]<IKAMA[1,1])&&(IKAMA[1,1]<IKAMA[1,0])
Sell input signal: (IPRICE[1,3]<IKAMA[1,0])&&(IPRICE[0,3]>IKAMA[1,0])
Sell filter configuration: (IKAMA[1,2]>IKAMA[1,1])&&(IKAMA[1,1]>IKAMA[1,0])

Run the strategy tester to preview the result. Please note that the EA will only enter the buy when the averages are superimposed on each other.

OUTPUT


We can also set up a signal for the EA to close its position. Regardless of the position's financial status, the EA will close the trade when this signal occurs.

STOPLOSS && TAKEPROFIT PRICE


In these settings, we look for a value to perform the stoploss and/or takeprofit positioning. Regardless of whether or not you have set a fixed value for stoploss and takeprofit placement, when filled in, the EA will use the calculated value in this setting, ignoring the default values. Let's use a position opening using the Fibonacci indicator to exemplify the use of these parameters.

Buy signals
=>input signal: (IPRICE[0,3]<IFIBO[1,3]) && (IPRICE[0,3]>IFIBO[1,5]) && (IPRICE[0,3]>IPRICE[1,1])
=>filter configuration: (IFIBO[1,0]>IFIBO[1,5])
=>output signal
=>stoploss price: IFIBO[1,6]
=>takeprofit price: IFIBO[1,0]

Sell signals
=>input signal: (IPRICE[0,3]>IFIBO[1,3]) && (IPRICE[0,3]<IFIBO[1,5]) && (IPRICE[0,3]<IPRICE[1,2])
=>filter configuration: (IFIBO[1,0]<IFIBO[1,5])
=>output signal
=>stoploss price: IFIBO[1,6]
=>takeprofit price: IFIBO[1,0]

SIGNAL FOR ACTIVATION OF AUTOMATION


After a trade ends, we can wait for a signal to occur before a new entry is executed. Some setups such as Keltner channel, when closing a position, to enter a new position we must wait for the price to return to the central average of the indicator.

Configure this signal when you need to lock the inputs until a certain event occurs. You can also choose to start the EA waiting for the signal in order to avoid market opening gap entries.