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.
類似した注文
1.Sinyal Perdagangan : Sinyal beli: garis MACD utama memotong garis sinyal ke atas (macd_current>signal_current && macd_previous<signal_previous). Sinyal jual: garis MACD utama memotong garis sinyal ke bawah (macd_current<signal_current && macd_previous>signal_previous). Gambar di bawah menunjukkan kasus beli dan jual. 2. Posisi ditutup pada sinyal yang berlawanan: Posisi beli ditutup pada sinyal jual, dan posisi
Require the development of a high-speed HFT, fully automated trading Expert Advisor (EA) for MetaTrader 5 , optimized for live trading on both Deriv and Exness . The EA must be designed for fast execution, low latency, and reliability on real-money accounts , with full compatibility across broker-specific contract specifications, tick sizes, tick values, pricing formats, and volume rules. It should automatically
generate or create me a python coded file that has mql5 language requirements for a trading bot under the following instructions. the bot must execute trades if necessary the bot must trade 24/7 the bot must trade gold and currency the bot must make unlimited profit hourly the bot must enter market with caution after market analysis of 98 percent of clear trade