If you're trying to use positionsize based on the equity value, check this message 108746.
hope it helps --- In [email protected], "spi_maker" <ja...@...> wrote: > > I am trying to calculate a position size based on the current level of equity > built up, but I not doing this properly. > > I set up a situation to limit trades to a percentage of recent average volume > as: > > Vol_Limit = .05; > > MaxShares = MA(V, 10) * Vol_Limit * 1000; > > TheEquity = Foreign("~~~EQUITY", "C"); > > Indicated_Shares = TheEquity / Open; > > The_Position = Min(MaxShares, Indicated_Shares); > > SetPositionSize(The_Position, spsShares); > > > > First Problem > > I was having difficulty getting working results so I set the position size to > a fixed amount as: > > SetPositionSize(500, spsShares); > > When I ran the backtest, it dutifully set the shares to 500 except would > randomly set the shares to 210, then 230, then 260, then 290 etc. in > transactions 5, 16, 18, 30, etc. Throughout 600 trades, 99% of the share > values are 500 and the rest are these odd values. > > I wonder if anyone has any idea what might be happening there. > > > > Second Problem is much simpler. When I use the SetPositionSize(The_Position, > spsShares) in the backtester, I get no results at all. No trades, no > nothing, which leads me to believe that I am not using the ~~~EQUITY properly. > > Any insights would be greatly appreciated. > > When I backtested this >
