Frankenstein EA


This manual describes Frankenstein EA's functionality, its parameters and configurations.

The functional core of TS_DayTrader system is implemented as the standalone application Frankenstein.ex5(or FrankPro.ex5).
The trading advisor program for MetaTrader5 loads a copy of iFrankenstein.ex5 - a resource indicator
that provides Frankenstein EA with analytical data(exports signals and suggests TP\SL).

All of the trading, timemanagement, riskmanagement, SL trailing, keeping statistics and other
routines are taken care of by Frankenstein.ex5.



EA Overview

Frankenstein.ex5 is a MQL5 program, it requires MetaTrader5 instance to run.

Different builds:

EA's input parameters:
FrankEA_params
EA's input parameters include input parameters from iFrankenstein.ex5:
FrankEA_params2

Input parameters are loaded into RAM in multiple ways: manually, automatically downloaded
from frankenstein.pro(as a new optimization result), passed locally from Optimizator.ex5 through the filesystem,
or loaded from a previously compiled .tpl template file.

It is over 1000 parameters in total, the input parameters for iFrankenstein.ex5
are described in the previous "TA Model" chapter, now we will touch
the EA parameters...

The .set file with parameters can be downloaded at the Robots page,
just click on "download" button against the chosen robot.

The .set files at the Robots Page are updated weekly(on weekends, or Monday, usually).
Notice the Result(Last Week) column, it shows the current trading success of the robot.

Another way to acquire .set file is to download it from the History of Optimization Results(at Optimization page):
Download_prev_sets


Header

Each running instance of Frankenstein agent is tagged
with a unique number - 'Unique MAGIC for EA' parameter.
A combination of the symbol name plus magic is the unique identifier of the agent
within the system.
You can see the Symbol-Magic pair in the left top corner of the chart window:
Magic


Virtual Trading

The system has trading virtualization capabilities:
any trade can be placed in a virtual trading environment.
This way a trader can test strategies in fully operational trading environment
without risking any real funds.

Virtual Trade example:
Virt_trade

'Virtual Trading' parameter controls this feature.
The following Swap and Commission parameters set the virtual trading environment
characteristics.

The trades opened in virtual mode are visible on chart in the same way as real trades,
but displayed separately in the Statistics of the agent...


Statistics

To display Statistics click on 'Stats' button:
Stats

Each Frankenstein agent keeps its own database located at MQL5\Files\[SYMBOL]_[magic]\ folder.

The first STATS screen shows general trading summary.
By default, the data is shown for both
the Virtual Trading Environment and the real trading history.

To switch to the Real trades click the 'All/Virt/Real' button:
stats_real
To see only the Virtual trades click the 'All/Virt/Real' button again:
stats_virt

Other STATS screens contain more detailed trading data, click on 'NEXT' to see them...
2nd screen shows data for each pattern separately:
stats_2

3rd screen sorts data for each PUT of FUT that has been activated for the trade:
stats_3

4th screen sorts data by days of week(the day of opening the trade):
stats_4

5th screen sorts data by hour:
stats_5

6th screen lists all trades:
stats_6


Trading parameters

Trading parameters block starts with 'Risk size for a deal' input parameter:
trading_params
It sets the estimated possible loss for a single trade.
The value is in permille to the Capital(EQUITY).

The volume and margin size are calculated based on this value.
Another way to set deal volumes is to use 'Deal size in lots' parameter.
It sets fixed volume for all deals.

Parameter 'Maximal size for a deal' limits the volumes. The parameter is useful when
the volume is calculated automatically, to set up a protective threshold.

Parameter '1 lot size' sets the size(price) of 1 lot measured in the Base currency(what is Base currency?).
For forex markets, the value is usually 100'000.
Meaning that 1 lot of GBPUSD(USD is Base currency) equals 100'000$.
For some crypto markets the value should be set to 1 or 10, like BTCUSD.
1 lot in this case equals 1 Bitcoin.
Some markets, like GOLD or XAUUSD require parameter '1 lot size' to be set to 100.
Each broker configures the trading server in a different way,
keep that in mind, the same value may not work for every broker and may need some tuning.

Other trading parameters:


Position Manager

Frankenstein EA tracks all open deals, and has a series of input parameters responsible for
the policies managing multiple open positions:
pos_manager

If the parameter 'On/Off' is set to false — it turns off Position Manager and allows
multiple positions without any restrictions.

Trades that were initiated while the position is already opened — are called "Refills".
They increase the volume of the currently open position.

Parameter 'Refill:allow refill' allows opening "Refill" positions, when set to true.
Refills are only allowed in the same direction(for ex.: only SELL trades are allowed if 1 SELL deal is currently open).

Parameter 'Refill: distance to the next refill' sets the minimal distance
the price has to travel(go up or down) before another refill is allowed.
Useful for setting up strategies that exploit trend formations, pumping as much volume as possible to squeeze a big trend.

Parameter 'Refill: maximal number of additional positions' limits the number of
simultaneously open positions.

Parameter 'Refill: set all SLs to the same value as new SL', when opening a trade, moves all active
Stop Losses to the price of the new SL.

'Refill: Trading hours' parameter only allows refills during specific hours/minutes of the day.


Manual

Trades can be placed in Manual mode.
To activate it, click on button 'Manual':
manual

The red horizontal line represents Stop Loss and
the green line is for Take Profit.

The TP value is calculated according to the current SL value and input parameters.
The lot size and base currency are the same as for automatic trading and controled
with the same parameters.

If you drag the red SL line, the TP will be recalculated and the line will move:
manual2

Take Profit distance depends on the 'TP for ManualMode' parameter:
manual_params

CLick BUY / SELL to place an order or DONE to close the control panel and quit the Manual Mode.


Database

All Frankenstein builds manage a local LiteSQL DataBase.
Each agent uses a separate DB kept in a separate file.

The default directory is:
*\MQL5\Files\[Symbol]_[Magic]\[Symbol][Magic].sqlite

For example: *\MQL5\Files\EURUSD_101\EURUSD101.sqlite (C:\Users\User\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Files\EURUSD_101\EURUSD101.sqlite)
You can use SQLiteBrowser to observe the contents of the DataBase.

Trading statistics can be compiled to .csv file if requested by the 'Compile to .csv at deinitialization' parameter:
DB_csv

Use other parameters to manage, filter the output:

To turn on an additional audit, logging to the Audit.txt file, use the parameter 'Name for the txt file' under the "Audit" category.

Trades, trailing events or critical errors are logged to the file
instantly after the event:
DB_params


Trading Time(Time Manager)

For each pattern, a separate block of parameters for time management is located
under the "Trading Time" category:
TimeManager

Trader can set up specific hours when trading is allowed.
Days of weeks and months are also configurable.


Trailing

To set up trailing, use the following group of parameters:
Trailing_params

The threshold controls the distance at which the Trailing module starts moving the Stop Loss, following the price movement.
TRAILING: threshold = 1 means that Trailing will be activated when the price moves 100% distance to the SL at the moment of deal opening,
in the profitable direction.
TRAILING: threshold = 10 means that Trailing will be activated when the price moves x10 times the distance to the SL.

Stop Loss can only be moved in one direction. It never retraces back, only if ordered so manually.

In the next example, TRAILING: threshold = 1:
Trailing_params

When Trailing is activated, the SL begins to follow the outer boundary of the iBB(Bollinger Bands) channel
(TRAILING: threshold = 0, SL starts moving the moment the deal was posted):
Trailing_params


Tuning

Under the 'Tuning' category you will find some tweaking parameters:
tuning

We recommend to use the default values, using these parameters is only neccessary
in case of encountering any execution problems.

The only parameter we're going to mention - 'Override base currency name'.
In some cases, User needs to specify the Base Currency name manually(if the EA does not do it automatically for any reason).
For example - often this is the case for BTCUSD or other cryptocurrencies, or for Metals, or stocks.
For BTCUSD specifying 'Override base currency name' as "BTC" works.
For XRPUSD - "XRP".
Depends on the broker and his server configuration, historical data provider.


Misc

Under the 'Misc' category see the 'Override pip size' and
'Override tick size' parameters:
misc
These are useful whenever the EA fails to automatically detect the right pip or tick size.

Example of use:
a) for BTCUSD set 'pip size' to 10 or 1, 'tick size' to 1 or 0.1.
b) for XAUUSD(Gold) set 'pip size' to 0.1, 'tick size' to 0.01.
c) for USDJPY set 'pip size' to 0.1, 'tick size' to 0.01.


Trouble Shooting

Sometimes there's a need to collect more data
to be able to understand the reasons why certain position was opened or
filtered out and ignored by the engine.

Additional data output options are located at the end of the parameters list:
debug


For more

Feel free to ask any questions, the info provided above is a quick overview
of the system and only covers the basics.
Check out YouTube lessons.