Order Counter Debug

MQL5 Asesores Expertos

Trabajo finalizado

Plazo de ejecución 1 hora

Tarea técnica



input   bool   use_maxtrades     = false; // Use MaxTrades 

input   int    maxtrades         = 8; // Max numbers open until close no new orders


//+------------------------------------------------------------------+

//|          ONTICK PART                                             |

//+------------------------------------------------------------------+

void OnTick()

  {

      if(use_maxtrades && CountOpenTrades() >= maxtrades)  return; 


//+------------------------------------------------------------------+

//|          FUNCTION                                                |

//+------------------------------------------------------------------+

int CountOpenTrades()

 {

    int count = 0;

    for(int i = OrdersTotal() - 1; i >= 0; i--)

    {

        if(OrderSelect(i, SELECT_BY_POS) && OrderSymbol() == Symbol() && OrderMagicNumber() == Ii_002AC)

        {

            count++;

        }

    }

    return count;

 }



Currently when set to 100 it will close within 100 maxtrades


When a order is placed count will be upped by one


When maxtrades is set to 1 it won't close trades anymore cause it's of course a second order


When when maxtrades have been reached it should be able to close the trade.

Han respondido

1
Desarrollador 1
Evaluación
(158)
Proyectos
188
26%
Arbitraje
8
25% / 38%
Caducado
5
3%
Trabaja
2
Desarrollador 2
Evaluación
(169)
Proyectos
186
32%
Arbitraje
6
50% / 50%
Caducado
2
1%
Trabajando
3
Desarrollador 3
Evaluación
(99)
Proyectos
121
40%
Arbitraje
9
89% / 0%
Caducado
0
Trabaja
4
Desarrollador 4
Evaluación
(19)
Proyectos
25
36%
Arbitraje
0
Caducado
2
8%
Trabaja
Solicitudes similares
1. Knowledge and Expertise Forex Market Understanding : A strong understanding of how the forex market operates, including currency pairs, trading hours, spreads, liquidity, and other fundamental market dynamics. Trading Strategies : Knowledge of various trading strategies such as trend-following, scalping, arbitrage, hedging, and using indicators (e.g., moving averages, RSI, MACD, Fibonacci retracements). Risk
TIME FRAME: 15 MIN LOT SIZE: 0.01 CANDLE START TIME: 2:00 CANDLE END TIME: 2:14 ENTRY BUFFER: 1 SL BUFFER: 1 TARGET $: 10 MARTINGALE % : 200 (All the above data should be adjustable) Details: 1. We have to mention candle start time and end time (ie: 4.00 to 4.59). If the candle breaks the high of the given time it should go for buy. If it breaks the low of the given time it should go for sell. 2
We need to redesign the utility to work with Discord, we need a developer who has previously worked with Discord and knows how to link sending messages from the MetaTrader terminal to Discord. I will consider your suggestions
# Projeto do Robô de Trading "MeuRobot" ## Introdução O "MeuRobot" é um sistema automatizado de negociação desenvolvido para operar no mercado financeiro utilizando o indicador Parabolic SAR. Este robô foi projetado para facilitar a tomada de decisões de compra e venda, maximizar lucros e fornecer informações em tempo real ao operador. ## Objetivo O objetivo principal do "MeuRobot" é automatizar o processo de
An hft to pass prop firms sybthetic challengues fast. The bot has to be able to pass the challengues with no Dd. Please don't offer if You don't have what i post. I am not looking s friend. Ibwsnt tanto bebdone as soon as possible
Personnal programmer 30 - 31 USD
Hey there! I’m looking for a talented NinjaTrader programmer to partner with on some exciting projects. If you have a knack for NinjaScript and a passion for trading tech, let’s team up! What You Can Expect: A friendly collaboration on diverse projects Fair pay—50/50 split on all earnings An opportunity to dive deep into innovative trading strategies What I’m Hoping You Bring: Experience with NinjaTrader and
Здравствуйте. Я новичок в трейдинге. Ищу робота для торговли золотом и валютными парами. Так как я новичок в этом деле, то хотелось бы найти хорошего робота, который бы сам определял прибыльную сделку (неважно валютная пара это или золото) и сам бы ее совершал, хотя бы с точностью 90%. О цене поговорим позже. Жду ваших предложений
Mahlatse 50+ USD
I want to Trading to the real account and I need to work with robot so I don't how to find the robot so I need your help to find it or we can talk what's app my number 076 584 7256
Hello, i have a custom indicator on pinescript and i would like to convert it to a EA. Indicator basically gives buy sell signals and based on that orders to be placed and reversed. To give you complete requirement: 1. Use the TV pine script and convert it to EA 2. Reverse signals i.e. when buy order is running and sell signal shows then close previous order and open signal. 3. No
I need an EA that use the following Strategie. Please watch the videos on the Youtube channel. The EA should work on every Plattform https://www.youtube.com/@MXProfits/videos I need video call to explain

Información sobre el proyecto

Presupuesto
30+ USD
IVA (21%): 6.3 USD
Total: 36.3 USD
Para el ejecutor
27 USD
Plazo límite de ejecución
a 1 día(s)