Using Equity() or foreign(~~~EQUITY...) to change trade size during 
  a
backtest is useless and should never be done in portfolio 
  backtest
Equity() is only the value for single symbol over the entire 
  history
and not feasible in a portfolio backtest simple because it is not 
  the
equity size for a portfolio backtest, and it assumes every trade 
  entry
signal is taken.
~~~EQUITY is composite symbol produced after a 
  backtest has been
completed. The moment a positionsize is changed using 
  this symbol then
the ~~~EQUITY symbol values are wrong because the equity 
  will change
due to the altered trade results for the change trade 
  sizes.
You can only alter the positionsize based on backtest results, 
  ie
equity size, by using the Custom Backtest code.
There are examples of 
  this in the various web sites devoted to code help.
Go to the help 
  manual and read up a bit more on Portfolio Backtesting
and in particular 
  the Portfolio Backtester Interface Reference Guide.
-- 
  
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com
 
  .