Every time a TA icon is evaluated as true it triggers an action (the icon connected to the TA - let's say BUY or SELL) Let's say you max number of positions is 1. The ea starts, a TA is evaluated to BUY. Then it checks max number of positions, it's 0, so a position is opened. In the next bar the TA is evaluated to BUY. Then it checks max number of positions, it's 1, so NO position is opened. Next bar, a TA is evaluated to SELL. It closes all existing long (BUYS), then it opens 1 position. So max number of positions makes sure that long or short your max opened positions is 1
|