Project

General

Profile

Actions

Feature #2240

closed

StrategyInfoHost: store multiple StrategyInfo of distinct types

Added by Junxiao Shi almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tables
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
2.00 h

Description

Allow multiple StrategyInfo objects of distinct types to be attached to StrategyInfoHost.

StrategyInfo derived class must declare a int getTypeId() static method, which returns a unique identifier for the StrategyInfo type.
Those identifiers are assigned on StrategyInfoType wiki page.

StrategyInfoHost will store StrategyInfo objects in std::map<int, shared_ptr<StrategyInfo>> container.

Necessity:

  • Various parts of a complex strategy needs to store different types of information that are used at different occasions.
    Although it's possible to make a complex StrategyInfo type that contains everything, it's more convenient if StrategyInfoHost can allow multiple StrategyInfo of distinct types, because it allows sub modules to be shared between strategies.
  • In a composed strategy (#2000), each building block wants to store information for its own use.
    Although it's possible to compose a StrategyInfo type that contains everything, that is basically a container of building block's StrategyInfo indexed by type, which is same as what StrategyInfoHost is expected to do.
  • Measurements could be shared between strategies if they are using compatible types.
    StrategyInfo doesn't have to be cleared when changing strategy.
Actions

Also available in: Atom PDF