# Morse code

The essence of the EA is to set certain combinations of candles. The rules are: a bullish candle means "1", a bearish candle means "0". So, it is possible to search for such combinations of candlesticks simply by specifying "101":

So far the problem is in coding the representation of combinations - in the input parameters you cannot specify the number in binary form.

Morse code

So far Morse code version "1.003": you can manually set a string description of a pattern and even run single passes in the tester.

Morse code

### Morse code version "1.005"

...

Solved two problems:

1). the user sees the pattern as "0101" in the input parameters:

2). The input parameter is perfectly optimised in the tester.

The essence of the EA is to set certain combinations of candles. The rules are: a bullish candle means "1", a bearish candle means "0". So, it is possible to search for such combinations of candlesticks simply by specifying "101":

While the problem is in coding the representation of combinations - in the input parameters we can't specify the number in binary form.

you can text and then parse the string....

(That's cool).

In the input parameters, you can specify numbers in decimal form. And it can also be converted to binary or already used as a sequence of binary signs by pulling out each bit individually. It's as simple as that)).

you can text and then unpair the string....

As a rough draft I did so, plus all sorts of checks - for string length and to ensure that only characters '0' and '1' were in the string. But there's a new problem: such a string cannot be run in tester in optimization mode:).

Aliaksandr Hryshyn:

(That's cool).

In the input parameters, you can specify numbers in decimal form. And it can also be converted to binary or already used as a sequence of binary signs by pulling out each bit individually. It's simple)).

It is possible to set it as a binary parameter, but it is not possible to present it as a binary representation in the input parameters:

Input parameter in binary form

Example from helpchar, short, int and long types:

... For integer variables, values can be specified in binary form using the B prefix. For example, you can encode working hours of a trading session into a variable of int type and use information about it according to the required algorithm:

```//--- для рабочих часов ставим 1, для нерабочих указываем 0
int AsianSession   =B'111111111'; // азиатская сессия с 0:00 часов до 9:00
int EuropeanSession=B'111111111000000000'; // европейская сессия  9:00 - 18:00
int AmericanSession =B'111111110000000000000011'; // американская 16:00 - 02:00 ```

But specifying the input parameter in binary form (exactly in the form111111111000000000)

```//+------------------------------------------------------------------+
//|                                                         Test.mq5 |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#property script_show_inputs
//--- для рабочих часов ставим 1, для нерабочих указываем 0
input int AsianSession=B'111111111'; // азиатская сессия с 0:00 часов до 9:00
input int EuropeanSession=B'111111111000000000'; // европейская сессия  9:00 - 18:00
input int AmericanSession=B'111111110000000000000011'; // американская 16:00 - 02:00
//---
string text="10";
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart()
{
//---

}
//+------------------------------------------------------------------+
```

will not work - in the input parameters, the binary representation of the number is converted to a regular number:

Question: is there any way to set values in input parameters exactly in a binary form (so that a user would not see a number, but just a binary representation, like11111111111000000000)?

The situation does not seem very reliable for a Close == Open candle
And the option -1 0 1 is suggested
Where 0 is suitable for any direction

I did it that way as a draft, plus all sorts of checks - for string length and to make sure that only characters '0' and '1' were in the string. But there is a new problem: such a string cannot be run in tester in optimization mode:).

Make input parameter as int type and then change int type to string and parse ....

Sergey Dzyublik:
The situation does not seem very reliable for a Close == Open candle
And the option -1 0 1 is suggested
Where 0 is good for any direction

I rejected the Close == Open variant as unreliable -> such a candle has no direction.

What INT ?
It's only through strings or arrays.