RealTest User Guide
RealTest User Guide

 

 

Navigation: Realtest Script Language > Syntax Element Details >

MinFreeCash

 

 

 

 

Category

Strategy Elements

Description

Minimum free cash to keep on hand in the trading account

Input

Any formula specifying a dollar amount

Notes

MinFreeCash is one of the Capacity Constraints formulas used in the setup selection process.

A setup is only selected if current S.Cash minus cash required to enter this position and other setups selected so far would not go below MinFreeCash.

For a futures position the cash required to enter is the number of contracts to enter times the S.FuturesMargin required per contract.

For a long stock position the cash required to enter is the number of shares to buy times the expected entry price.

For a short stock position cash is received upon entry so a short setup cannot trigger this constraint and will make it less likely for a subsequent long setup to do so.

If a setup cannot be selected due to this constraint and the strategy specifies Reduce: True, then the position's Quantity will be reduced to allow the position to be ordered for entry at smaller size if possible.

Setups skipped for this reason display "min free cash" in the Reason column of the Trade List, provided that the KeepTrades setting included Skipped.

If MinFreeCash is not specified and CashAccount is False or not specified then there is no lower limit placed on free cash in the account. If CashAccount is True then the default MinFreeCash is 0 (cannot go negative, i.e., cannot use margin).

Note that opening gaps beyond a specified order price may cause actual free cash drop below the specified cap in some situations -- think of this constraint as "minimum intended free cash". Allow a bit of extra room in your MaxExposure level if this is an issue.

See Also: Backtest Engine Details and Capacity Constraints

 

 

 

Copyright © 2020-2024 Systematic Solutions, LLC