Polyindicators

Multiple Frankies can be linked together to create a net of EAs: some agents will provide trading signals
and others('lead' agents) will use these signals to analyse the market and make a trading decision.

This approach creates a Hive-Mind type of intelligent trading system.

To configure a group of Frankies to trade together in a swarm manner - use Polyindicators page.

On the page you'll find latest Polyindicator configurations currently in use by TS_DayTrader servers.

To learn how to set up your own unique swarm with different preferences check out the "Local Installation" chapter.


PI Configuration

Note: Only users with administrator rights can make changes on this page!

To configure a new swarm of Frankies, set up a new Polyindicator by posting a new row to the table:

Polyindicators

After you've changed the configuration, don't forget to press 'save changes'.


Layout

A Polyindicator is an abstraction, binding multiple Frankies together.
Polyindicator configuration is stored in a configuration file PI.conf.
The file is downloaded by the specified in it Expert Advisors.(or provided manually, when using the Local Installation version of FrankPro.ex5)
EAs then reconfigure themselves according to the received PI.conf file.

Users can edit the PI.conf file directly to set up new polyindicators, see the Local Installation chapter.

Each Polyindicator receives the EA signals, processes them, and then provides the result(PI signal)
to the EAs using this polyindicator as input polyindicator(all within the Terminal's local environment).

Schematically, this organization looks like this:
PI_arch1


InputEAs

To specify which EAs are used as signal providers - use text field "InputEAs".
The input must match the following format: "EURUSD-3,EURUSD-4,GBPUSD-13,GBPUSD-122-R".
This is a list of Symbol-Magic pairs, separated by commas.
The postfix "-R" means that the signal will be "reversed" - BUY becomes SELL, and vice versa.
This postfix is optional.

The "InputEAs" format: "SYMBOL-MAGIC(-R),SYMBOL-MAGIC(-R),SYMBOL-MAGIC(-R)".


InputPIs

A Polyindicator can also use other Polyindicators as input signals.
To specify which Polyindicators are used as signal providers - use text field "InputPIs".
The input must match the following format: "123,4,512,54-R,51".
The "InputPIs" format: "PI_ID(-R),PI_ID(-R),PI_ID(-R)".
The -R postfix works the same way here: it reverses the signal from BUY to SELL.

Schematically, this organization looks like this:
PI_arch2


Signal Triggering

Use 'MinimalSignalsNum' and 'MaximalOppSignalsNum' parameters to set up the
Polyindicator's trigger sensitivity.

MinimalSignalsNum sets the minimal number of signals signaling in the same direction required for the "Lead" EA to
be able to open a deal.
For example, if the "Lead" EA is trading BUY positions it waits for other EAs to signal BUY as well.

MaximalOppSignalsNum sets the maximal number of opposite signals allowed to be present.
For example, if the "Lead" EA is trading BUY positions, and there's a lot of SELL signals
from other EAs, exceeding the MaximalOppSignalsNum, trading will be forbidden until
the opposite signals 'die'.


The Swarm

Let's have a look at how to configure Swarm of EAs in the Terminal.

After the PI configuration is all set, it is time to set up the Lead EA and the sattellite EAs(signal providers).
You will find the necessary block of parameters under the DATABASE section in EA:
Polyindicators_params

The signals are distributed locally, this means that all Frankies that are part of the swarm have to be running on the same machine in the same MetaTrader5 terminal.

Let's look at an example of configuration...
Using InputEAs="EURUSD-3,EURUSD-4,GBPUSD-13,GBPUSD-122-R" and InputPIs="123,4":


The signal providers(InputEAs)

Launch 4 EA's with Symbol-Magic pairs: EURUSD-3,EURUSD-4,GBPUSD-13,GBPUSD-122-R

For each, set the 'PolyIndicator: provide PI signal locally for other Frankies' parameter to 'true'.
Now they are providing the signal locally(for the lead Frankie).

Set the 'PolyIndicator: Lifetime, seconds' to 300 seconds(arbitrary, use any other value if needed).
This means that the lifetime of the signal provided is 5 minutes, after that the signal is deactivated.

Set the 'PI: Deviation Type: 0 = % of TP/SL, 1 = ticks' to ticks or to %(relative to SL/TP).
The choice depends on the trading strategy.

Deviation boundaries restrict the allowed price movement.
This is to ensure that the market situation is the same, the price is still within the desired range
for all of the signal providers.
'PI: Deviation Negative' and 'PI: Deviation Positive' set the price limits at which the signal dies.
Price moving in the direction of SL is considered to create a potentially more profitable position(Positive Deviation), because it increases the potential
profits.
Reversed logic is applied to Negative Deviation. If the price gets too close to TP,
the probability of the price retracing back is the highest, and the price difference and potential profit - the smallest.
Thus, price moving towards TP is - Negative Deviation.

You can keep the signal provider EAs always running in virtual mode.
This way they don't trade but only provide signals.


The AUX PIs(InputPIs)

As was mentioned earlier, the Polyindicator can use other Polyindicators as signal-providers(inputs).
They are treated with the same priority as simple EA signal providers.

You can build multi-level structures, just be careful not to create any infinite recursions
where the child PI is simultaneously its parent(the EA would "freeze" because of CPU overload).

The PI signal and its subordinate PI signals will be calculated by the lead EA each time before opening a new deal.


The Lead Frankie EA(signal receiver)

The Lead Frankie is the EA that posts trades, working in Real mode(or Virtual).
It recieves signals from other subordinate Frankies.

There can be multiple lead Frankies for the same PI_ID, simultaneously.

Lead Frankie makes it's own judgement about the market situation,
but the assigned polyindicator filters all its decisions.

This way the EA is using collective reasoning, relying on the prediction function
of other agents.

To set up the Lead Frankie all you need to do is set 'PolyIndicator: BUS3: use Frankenstein.pro PI input' to true(not for Local Installation!),
and specify the 'PolyIndicator: P_ID input' - PI_ID of the Polyindicator you want to use as an input for the Lead EA.

The Lead EA will now read the configuration from Frankenstein.pro(or read it locally from FS, for Local Installation)
and create the Polyindicator signal, based on all locally provided signals by other satellite(aux) EAs.

The current state of the signals is periodically uploaded to Polyindicators Page.
(for Local Installation, use 'State' feature to observe the PI signals current state)

There can be multiple Lead EAs with the same Input PI_ID.
The common practice is to use 4-20 aux EAs for each Lead EA.
It is possible to bind over 90+ agents this way.

The Swarm is now ready to process market data, trade and posts deals.


State

To observe the PI signals state, open the State window:
PI_state

If you open a BUY trade, you can observe the new state of the EA output signal against the EA_BUY indicator:
PI_state2
(0 or - stands for OFF, 1 or + stands for ON).
This signal is now accessible to other agents.


Common Practices

There's numerous ways to benefit from Polyindicators.

User can bind different symbols together, or use multiple timeframes to analyse a single instrument.
Another way is to measure the power of one symbol against multiple other symbols.

The limits here are defined by imagination only.