Hey everyone,

I've build this first algo of mine which is buying the underlying asset when the price is below the 200 EMA. 
this algo only uses the top technology stocks.

It is not finished yet but i am struggling to understand the construction model. 
I want my algo to execute a position using 10% of my overal portfolio. And i want it to STOP once i can't open another position of 10%. (portfolio is full and my algo has to stop trading until i hit a target which i have to program later)

But when i run my backtest it is executing some stocks good. however after holding some stocks it is making very small trades of 1 to 10 shares.. i don't know why my algo is making these trades.

Can someone explain this to me?

Thanks!!

Author