Stop bot to open more then 1 trade

 
Hi

My bot is taking trade everytime once condition meet.

I want my bot to take only 1 trade untill TP or stopless hit

Can anyone guide
 
Safeer Altaf :
Hi

My bot is taking trade everytime once condition meet.

I want my bot to take only 1 trade untill TP or stopless hit

Can anyone guide

The simplest is to use the PositionsTotal call: if there are positions in the market, then just exit OnTick.

Documentation on MQL5: Trade Functions / PositionsTotal
Documentation on MQL5: Trade Functions / PositionsTotal
  • www.mql5.com
PositionsTotal - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Safeer Altaf:
Hi

My bot is taking trade everytime once condition meet.

I want my bot to take only 1 trade untill TP or stopless hit

Can anyone guide
if(BuySignal==true&&LongPos<1){trade;}
if(SellSignal==true&&ShortPos<1){trade;}