# Quantconnect setcash API not working with Alpaca

**URL:** <https://forum.alpaca.markets/t/quantconnect-setcash-api-not-working-with-alpaca/1922>\
**Category:** App-Integration\
**Created:** [June 29, 2020, 5:59pm UTC](https://forum.alpaca.markets/t/quantconnect-setcash-api-not-working-with-alpaca/1922 "2020-06-29T17:59:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sudheer\_Kumar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/sudheer_kumar/32/990_2.png) [@Sudheer\_Kumar](https://forum.alpaca.markets/u/Sudheer_Kumar)\
**Post date:** [June 29, 2020, 5:59pm UTC](https://forum.alpaca.markets/t/quantconnect-setcash-api-not-working-with-alpaca/1922/1 "2020-06-29T17:59:00Z")

</div>

I am running my algorithm through quantconnect and I am not able to control the cash allocation for each algorithm. I used self.Portfolio.SetCash(1000); and self.SetCash(1000) individually, when I deploy it ended up using my entire cash in the account which was $2000.

Can you suggest if there is a way to restrict cash to each algorithm through quantconnect?
