NAME
Finance::GeniusTrader::PortfolioManager - Manages a portfolio
DESCRIPTION
A PortfolioManager is an entity interacting between a Portfolio, a Trading System, money management rules and trade filters.
When it comes to starting a new position (ie submitting an order to start a position), the money management system comes in again to decide how much to put on the trade.
Filters can be applied to accept/refuse trades proposed by the various trading systems.
my $manager = Finance::GeniusTrader::PortfolioManager->new($portfolio)
-
Create a new portfolio manager that implements a money management strategy.
$manager->set_portfolio($portfolio)
-
Change the portfolio managed.
$manager->portfolio()
-
Returns the managed portfolio.
$order = $manager->buy_market_price($calc, $source)
$order = $manager->buy_limited_price($calc, $source, $price)
$order = $manager->buy_conditional($calc, $source, $price [, $price2])
$order = $manager->virtual_buy_at_open($calc, $source)
$order = $manager->virtual_buy_at_high($calc, $source)
$order = $manager->virtual_buy_at_low($calc, $source)
$order = $manager->virtual_buy_at_close($calc, $source)
$order = $manager->virtual_buy_at_signal($calc, $source)
$order = $manager->sell_market_price($calc, $source)
$order = $manager->sell_limited_price($calc, $source, $price)
$order = $manager->sell_conditional($calc, $source, $price [, $price2])
$order = $manager->virtual_sell_at_open($calc, $source)
$order = $manager->virtual_sell_at_high($calc, $source)
$order = $manager->virtual_sell_at_low($calc, $source)
$order = $manager->virtual_sell_at_close($calc, $source)
$order = $manager->virtual_sell_at_signal($calc, $source)
-
Those functions are used to create orders that may be modified and submitted later.
$manager->set_order_partial($order, $ratio)
-
When you want to close a position, you may want to not close it fully. With this function, you indicate how much of the initial position you want to close.
$manager->discard_all_orders($calc, $source)
-
Discards all orders concerning this share and this source.
$manager->submit_order($order, $i, $calc)
$manager->submit_order_in_position($position, $order, $i, $calc)
-
Submit the prepared order, either an order that will start a new position or as an order that will modify an existing position.
$manager->add_money_management_rule($mm_rule)
$manager->delete_all_money_management_rule()
$manager->default_money_management_rule($mm_rule)
-
Use a money management rule and remove all money management rules currently used.
$manager->decide_quantity($order, $i, $calc)
-
Apply the various money management rules and decide the size of the position.
$manager->finalize()
-
Finalize the setup of the manager. Calculate its name. You can get its name afterward using $manager->get_name.
$manager->get_name()
-
Return the name of the system.
$manager->setup_from_name($name)
-
Setup the portfolio manager according to the name, it will create the corresponding money management rules.