(check-order)Fills the pending orders whose security has a price today and drops the ones that have expired. Orders that reduce a position are filled before orders that add to one, so that sale proceeds can pay for purchases made on the same day. Orders whose security has no price today stay pending.
Fills the pending orders whose security has a price today and drops the ones that have expired. Orders that reduce a position are filled before orders that add to one, so that sale proceeds can pay for purchases made on the same day. Orders whose security has no price today stay pending.
(check-terminating-condition)Close all positions if net worth < 0 or portfolio margin < maintenance margin, i.e. user has lost all cash
Close all positions if net worth < 0 or portfolio margin < maintenance margin, i.e. user has lost all cash
(end-order)Call this function at the end of the strategy. Closes every position at today's close; a security with no price today is booked as cash at its last value.
Call this function at the end of the strategy. Closes every position at today's close; a security with no price today is booked as cash at its last value.
(incur-interest-cost)This private function deducts the loan interests cost on every trading day.
This private function deducts the loan interests cost on every trading day.
(next-date)Advances the clock one trading day: revalues holdings, charges interest, checks margin, fills pending orders and runs automations. Returns the new date, or nil once the run has terminated.
Advances the clock one trading day: revalues holdings, charges interest, checks margin, fills pending orders and runs automations. Returns the new date, or nil once the run has terminated.
(order permno
quantity
&
{:keys [expiration remaining leverage print direct]
:or {expiration ORDER-EXPIRATION
remaining false
leverage LEVERAGE
print PRINT
direct DIRECT}})Queues an order of quantity shares of permno. It fills at the close
of the next trading day on which the security has a price, up to
expiration trading days after today (ORDER-EXPIRATION by default);
after that it is dropped. :remaining true makes quantity the target
holding instead of the amount to trade.
Queues an order of `quantity` shares of `permno`. It fills at the close of the next trading day on which the security has a price, up to `expiration` trading days after today (ORDER-EXPIRATION by default); after that it is dropped. `:remaining true` makes `quantity` the target holding instead of the amount to trade.
(order-internal order-date permno quan remaining leverage print direct info)This is the main order function
This is the main order function
(update-holding-tickers)Revalues every holding at today's close, paying or reinvesting dividends.
Revalues every holding at today's close, paying or reinvesting dividends.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |