Looking for a coder to modify a loop

Tâche terminée

Temps d'exécution 21 heures
Commentaires du client
The best developer I have used here.
Commentaires de l'employé
It was nice to work with the client. Thank you for the project.

Spécifications

The loop will calculate consecutive losing trades and reset to zero once a winning trade is met. 

For example: A trade is closed as a losing trade, the loop will count 5 losing trades and return the value 5, then once a trade has closed in profit the loop will reset.

I am looking for very concise code that I will add to an existing EA.


This is the code I have as an example which does not function the way I am proposing.

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int ConsecutiveLosses()
  {
//Calculate the no of winners and losers from today's trading. These are held in the history tab.
   int LosingTrades = 0;
   int loss_count = 5;

// (BA) Get the start second of the current day (server time)
   for(int cc = 0; cc <= OrdersHistoryTotal(); cc++)
     {
      if(!OrderSelect(cc, SELECT_BY_POS, MODE_HISTORY))
        {
         continue;
        }
      if(OrderSymbol() != Symbol())
        {
         continue;
        }
      if(OrderMagicNumber() != MagicNumber)
        {
         continue;
        }
      if(OrderType() > 1)
        {
         continue;
        }
      if(OrderProfit() < 0)
        {
         LosingTrades++;
         if(LosingTrades > loss_count)
            break;
        }
     }//for (int cc = 0; cc <= tot -1; cc++)
   return(LosingTrades);
  }//End void CalculateDailyResult()

Répondu

1
Développeur 1
Évaluation
(137)
Projets
162
22%
Arbitrage
7
29% / 43%
En retard
4
2%
Travail
2
Développeur 2
Évaluation
(92)
Projets
110
34%
Arbitrage
5
40% / 20%
En retard
5
5%
Gratuit
3
Développeur 3
Évaluation
(376)
Projets
398
31%
Arbitrage
62
19% / 69%
En retard
50
13%
Travail
4
Développeur 4
Évaluation
(153)
Projets
225
58%
Arbitrage
3
100% / 0%
En retard
46
20%
Travail
5
Développeur 5
Évaluation
(41)
Projets
54
4%
Arbitrage
5
0% / 60%
En retard
4
7%
Gratuit
6
Développeur 6
Évaluation
(298)
Projets
427
26%
Arbitrage
18
61% / 33%
En retard
26
6%
Gratuit
7
Développeur 7
Évaluation
(97)
Projets
135
52%
Arbitrage
4
50% / 50%
En retard
0
Travail
Commandes similaires
Hi Everyone, I need a cloud based licensing system to protect my MT4 / MT5 Indicators and Expert advisors Secure an unlimited number of EAs, indicators, and scripts. Create and manage unlimited license keys for secured EAs, indicators, and scripts. Instantly suspend license keys in case of refund. Lock EA/indicator to specific accounts and time frame similar to this
Hi, i have a tos script i need converted to Ninja script, but someone who knows both coding. Cant be someone who is just going to paste into chat gpt, it requires more understanding for compatibility
Hi, i have a tos script i need converted to Ninja script, but someone who knows both coding. Cant be someone who is just going to paste into chat gpt, it requires more understanding for compatibility
EA Description: Box Identification: The EA allows users to manually mark consolidation zones on the chart with rectangular boxes. These boxes are distinguished by color: red for bearish zones and green for bullish zones. Entry Types: Aggressive Entry (True/False): Users can opt for aggressive entries, initiating trades at a specified percentage of the zone's range. Divergence Entry (True/False): The EA detects
I need MT4 and MT5 hedging locker expert advisors that hedge existing trades either with pending or market order hedging trades. With pending hedge trades the entry price may optionally be made to trail the existing open orders. There should be option for a breakeven and trailing of the hedge trade’s stop
I believe in Robotics as a major artificial intellect to function of growth of business.Therefore if you script there is a likelihood of bringing economies of scale.The retrospective of the dynamics of indulgence of work can be economics of scale
Just profitable Ea. 30 - 100 USD
Hello, I am looking for a good scalper that can operate on a single chart with multi-currency pairs, including gold and indices( MT4). It should support all brokers, leverage, and be capable of trading with a small deposit with SL and TP.It's important that the robot does not use risky strategies and, most importantly, is profitable. Thank you
MT4 INDICATOR 30 - 35 USD
Looking for a proven MT4 indicator that is highly consistent and profitable preferably that you have developed and are able to share with me. If you have some indicator that is valuable for making consistent profit please bid and show me trading history from using it in your MT4 account. Thanks
I need a EA to open 2 trades 1. one trade with a SL and a TP 2. one trade with a SL no TP if the 1st trade takes TP the 2nd trade SL needs to move on break even and trail the trade thereafter. will need the lot size Number of trades
there I hope you're doing well I want to convert the tradingview indicator to make an indicator for mt5. And in that, I want to make an automatic robot on the base of the indicator. I have the pine script of that indicator

Informations sur le projet

Budget
30+ USD
Pour le développeur
27 USD
Délais
de 1 à 10 jour(s)