thank you Andrew, i used another method but your's is much simpler :
bool Trade_short_state()
{bool bool_short= false;
for(open_trades){
if(TradeIsShort == true){
bool_short= true;}}
return bool_short;
}
bool Trade_long_state()
{bool bool_long= false;
for(open_trades){
if(TradeIsLong == true){
bool_long= true;}}
return bool_long;
}
if the function return true then a trade is already in place if not i can open the trade
thank you.