how can i make my EA fully and always invested

 

Hey fellas


i need some help with my EA, for example when the "Buy" condition is true, i need it to place buy orders one after the other when the tp is hit, and the same for "Sell". currently it only opens one order only here is my code below...

    if(newBar){
        //Buy Condition:
        if(Buy && PositionSelect(_Symbol) == false){
            drawVerticalLine("Buy",Candle[1].time,clrBlue);
            if(PositionsTotal() == 0){
               BuyAtMarket();
               }
        }
        
        // Sell Condition:
        if(Sell && PositionSelect(_Symbol) == false){
            drawVerticalLine("Sell",Candle[1].time,clrRed);
            if(PositionsTotal() == 0){
               SellAtMarket();
            }
        }
    }
 
JohnHlomohang:

Do not double post!

I have deleted your other post.