작업 종료됨
명시
Hello, look at the entire code, check that it is programmed correctly, that there are no functions that are useless! Add a function so that there is only 1 order per currency pair. Currently it can happen that there are 2 or 3 orders per currency pair, I want to limit the number of orders to 1 per currency pair.
Add a code like this example :
int TotalOrders(string symbol="", ulong magic = -1) {
int cnt = 0;
int pos_total = PositionsTotal();
for(int pos =pos_total-1;pos>=0;pos--) {
ulong pos_ticket = PositionGetTicket(pos);
if(PositionSelectByTicket(pos_ticket) && (symbol=="" || PositionGetSymbol(POSITION_SYMBOL)==symbol) && ( magic==-1 || PositionGetInteger(POSITION_MAGIC)==magic) ) {
cnt++;
}
}
return(cnt);
}
it's just an example of what I want, it can be programmed differently.