Hi
Im using the following code to limit only 1 trade open per asset but I have noticed that sometimes two trades are opened for a single asset. Does anyone have any ideas why this is happening or a better way to control number of open trades per asset?

int tradelimit = 1;
int tradecount;
string CurrentAsset;

function run (){
BarPeriod = 1;
LookBack = 60;
Lots = 10;
Hedge = 2;
Stop = 100*PIP;
asset("EUR/USD");
tradecount = 0; //reset trade count
CurrentAsset = Asset;
for (open_trades) if(strstr(Asset,CurrentAsset) and TradeIsOpen) tradecount++; // count number of trades
if (tradecount<tradelimit) enterShort(); // if number of trades is less than trade limit of 1 enter short trade
}

Last edited by trader6363; 05/20/16 12:40.