ROUNDEDDOWN is a function in the ProBuilder language used primarily to round down numerical values to the nearest whole number. This function is particularly useful in trading scenarios where you need to determine the maximum number of whole shares that can be purchased with a given amount of cash, based on the current share price.
ROUNDEDDOWN(expression)
Suppose you have a trading strategy where you want to invest a fixed amount of cash in a stock, but you can only buy whole shares. If you have $1000 to invest and the current stock price is $123.45, you can use the ROUNDEDDOWN function to calculate the maximum number of shares you can buy:
cash = 1000
pricePerShare = 123.45
maxShares = ROUNDEDDOWN(cash / pricePerShare)
This will result in maxShares being 8, as 1000 divided by 123.45 equals approximately 8.1, and rounding down gives 8.
Understanding and using the ROUNDEDDOWN function can help in creating more realistic and executable trading strategies in the ProBuilder environment.