Portfolio Manager

Top  Previous  Next

The Portfolio Manager is used to filter the instruments available to the system. This is analogous to a screen for stock trading. The purpose of the Portfolio Manager block is to indicate to the system which instruments are to traded on a particular day. If you want all instruments included, then don't use a Portfolio Manager block. You can also use this to set whether an instrument is allowed to trade just long, just short, or both.  The built-in Trade Direction Portfolio Manager does just this.

 

First the Rank Instruments script is called once for each instrument. This allows you to use the Ranking Functions of the instrument Trading Object (i.e.instrument.SetLongRankingValue and instrument.SetShortRankingValue) to set the value which will be used by Trading Blox to rank the various instruments.

 

Then Trading Blox sorts and ranks each instrument based on the ranking value provided by the Rank Instruments script. The long ranking value is sorted highest to lowest, while the short ranking value is sorted lowest to highest. The respective rank is put in the Ranking Properties.

 

Finally Filter Portfolio is called once for each instrument so you can use appropriate Instrument Trade Control Functions like instrument.AllowAllTrades or instrument.DenyAllTrades as necessary based on the current instrument rank.

 

Note that if there is no scripting code in the Filter Portfolio script, then the ranking will not take place. Some code in the Filter Portfolio script is required in order for the ranking to take place, and the rank to be determined and defined.

 

 

See Also

Ranking Properties

Ranking Functions

Trade Control Properties

Trade Control Functions