TOTALCASH

Top  Previous  Next

Keyword Description

Category-related / Category-legal.

Class

Function

Where Legal

Resources

Entry Logic

Exit Logic

Initial Size

Resize

(Pre-Category)

Resize

(Category-Level)

 

 

 

l

l

l

Syntax

TOTALCASH

       

Return Value

Returns dollar value of currently available cash which can be used for stock purchases.

Example

Sample code Initial Size

 

MEMORY[1] = TOTALCASH / SIZING[1] 

'sizing[1] holds yesterday's closing price. TOTALCASH=investable cash available

MEMORY[2] = 200 / SIZING[1]  

'buy $200 worth of each stock 

IF MEMORY[1] < MEMORY[2] THEN NEWSHARES = MEMORY[1] ELSE NEWSHARES = MEMORY[2] 

'Are we running low on cash? Don't exceed investable cash available

 

ThumbTack white

When INCLUDETODAY = TRUE position sizes will be automatically adjusted downward if upon trade entry or resize the position size requested would have created a negative cash balance. If INCLUDETODAY is not set to True Mechanica does not adjust position sizes to respect TOTALCASH. In that case if a violation occurs the PSR will display Cash Call amounts. Cash calls will be noted in Open Positions of PSR detail on the days that they occur.