Thanks Ivan for the explanation. I get how the function operates as per your explanation.
I'm not so clear about how selecting this function for my strategy will affect/influence my strategy.
Say I implemented a Moving Average Backtest strategy and hold a portfolio of 30 stocks. When market sentiment is bearish, how would the Cash Allocation function influence my strategy to instruct me to sell stocks to raise cash, and how would it prioritise the 30 stocks to sell? Would it be the stock with the steepest drop in price that would be sold first?
Similarly, when market sentiment is bullish, how would the Cash Allocation function influence my strategy to buy stocks - would it prioritse stocks with the steepest increase in price first?
If it does not prioritise stocks by the steepest change in prices, how does the Cash Allocation function tell me which of the 30 stocks to sell/buy then?
Also, how frequently would the the function instruct me to raise cash or buy stocks? Would it be based on the rebalancing setting chosen for the backtest, or would it do so whenever there is a change in the Fear and Greed Index?