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":

Morse code

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

Forum on trading, automated trading systems and strategy testing

Morse code

Vladimir Karputov, 2017.04.06 10:25

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.

Forum on trading, automated trading systems and trading strategy testing

Morse code

Vladimir Karputov, 2017.04.07 08:42

Morse code version "1.005"

...

Solved two problems:

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

Convenient view of the input parametre

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



 
Vladimir Karputov:

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


 
Vladimir Pastushak:

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:

Forum on trading, automated trading systems and strategy testing

Input parameter in binary form

Vladimir Karputov, 2017.04.05 09:24

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 |
//|                                      Copyright 2017, CompanyName |
//|                                       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:

Input parameters


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
 
Vladimir Karputov:

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.
 
Vladimir Karputov:

You can set it as a parameter in binary form, but you cannot represent it in input parameters in binary form:


I wrote that you can set it in decimal form, as an ordinary integer, and then pull individual bits from it.
 
Vladimir Karputov:

I have discarded the "Close == Open" option as unreliable -> such a candle has no direction.

Well, then we need to consider all variants through the fluid chart.
Because the one that was thrown out could give a full-fledged direction at -30 sec timeframe
Reason: