multiple trading issues

 
I have an expert short EUR on H1
and an expert which tries to enter Short on CHF M15
and other 6 charts open with no experts attached.


The m15 expert prints the following using my comments in the code :

"received short signal"
"Denied trading"



using the following block:

if(MyShortSignal())
{
Print("received short signal");
if(Bars<100 || IsTradeAllowed()==false)
{
print("Denied trading");
return;
}

//this never executes
print("firing short signal");
Ordersend(symbol(),OP_SELL,etc..
}

This happens even if the EUR expert doesn't receive any ticks.
After I noticed this then I tried removing the EUR H1 expert from the chart
and it didn't work!
Then I closed the chart and kept getting the same error on the m15 expert.
Then I restarted the platform, with only the M15 expert trading and then it placed the trade.
So my guess is that a mutex is being kept all the time.
For the H1 expert I put a "Trade access" message at the beginning of the code,
and when testing it with this m15 expert, it never appeared in my logs.
Both experts have the IsTradeAllowed check before OrderSend and OrderModify statements.

Does the tradingAllowed mutex get released when trading functions return 0, or is it erroneously kept down even if they return an error ?
Did you consider placing trading functions in a thread monitor ?

Because for two threads running the sequence :

if(IsTradeAllowed())
OrderSend()

a race condition may occur if the preemption comes after isTradeAllowed.
 
what the build and what the date? it should be build 183 07 Oct 2005
Reason: