Liking cljdoc? Tell your friends :D

clojure-backtesting.order


check-orderclj

(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.
sourceraw docstring

check-terminating-conditionclj

(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
sourceraw docstring

end-orderclj

(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.
sourceraw docstring

incur-interest-costclj

(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.
sourceraw docstring

next-dateclj

(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.
sourceraw docstring

orderclj

(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.
sourceraw docstring

order-internalclj

(order-internal order-date permno quan remaining leverage print direct info)

This is the main order function

This is the main order function
sourceraw docstring

pending-orderclj

source

update-holding-tickersclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close