Average entry price line for multiple positions (exist and the pending positions,too)

MQL4 Indicadores

Trabalho concluído

Tempo de execução 2 minutos

Termos de Referência

I have an avg price indicator wich shows a thick line at the average entry price.

this line exactly same as the initial opening price at the first position,

and shifting towards between the more new positions, showing the cummulated new average price of the all positions. (untill the close.)

all of this is a very simple code ~40 rows,

  • but it have a problem:
    something make slowly the MT4.
    the first part of the job:
    fix this bug which makes it slowlier..

and the second part is:

  • I would like a new function:
    when I place a pending order, then appear a new line (a dotted with same colour) showing the estimated average price with the new pending (limit or stop) order position.
    so the indicator always shows a dotted line, when I place a pending order, and a thick line, when I have already opened positions, too..
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Coral

int gi_76 = 25;
double gda_80[];

int init() {
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, gda_80);
   SetIndexDrawBegin(0, gi_76);
   return (0);
}

int start() {
   int li_4;
   bool li_32;
   int li_12 = IndicatorCounted();
   double ld_16 = 0;
   double ld_24 = 0;
   if (Bars <= gi_76) return (0);
   if (li_12 < 1) for (int li_8 = 0; li_8 <= gi_76; li_8++) gda_80[Bars - li_8] = EMPTY_VALUE;
   int li_36 = Bars - li_12;
   for (li_8 = Bars; li_8 >= 0; li_8--) {
      li_32 = FALSE;
      li_4 = OrdersTotal();
      ld_24 = 0;
      ld_16 = 0;
      if (li_4 > 0) {
         for (int li_0 = 0; li_0 < li_4; li_0++) {
            OrderSelect(li_0, SELECT_BY_POS, MODE_TRADES);
            if (OrderSymbol() == Symbol()) {
               if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
                  li_32 = TRUE;
                  ld_24 += OrderLots();
                  ld_16 += OrderOpenPrice() * OrderLots();
               }
            }
         }
      }
      if (li_32 && ld_24 != 0.0) {
         Comment("\n\nLOTs = " + DoubleToStr(ld_24, 4) + " | AVG price = " + DoubleToStr(ld_16 / ld_24, 4) + "   -- (c)");
         gda_80[li_8] = ld_16 / ld_24;
      } else {
         Comment("\n\nLOTs = 0 | AVG price = -,  (c)");
         gda_80[li_8] = EMPTY_VALUE;
      }
   }
   return (0);
}

Respondido

1
Desenvolvedor 1
Classificação
(215)
Projetos
302
79%
Arbitragem
4
25% / 0%
Expirado
62
21%
Livre
2
Desenvolvedor 2
Classificação
(1235)
Projetos
2820
80%
Arbitragem
156
22% / 43%
Expirado
488
17%
Livre
Pedidos semelhantes
Software and EA 30 - 60 USD
i want someone who can code a trading bot for me.. with the candlestick range strategy.getting to know if you can be able to 1. identify Any higher time frame candle 2. wait for the next one to break either sell or buy side liquidity lets say it breaks the buy side 2.1 after breaking buy side the body of candle number 3 must close inside the wick of the candle we are looking for(taking buy or sell side LQD from) 3
I need a pivot indicator showing the standard levels R1 to R3 and the camarillo level breakout long and short R4 id like the indicator to work out the levels based on the cash chart times .. i use on indexes . so id like to input the times to work out the levels ie cash open at 8:00 close at 4:30 but this can be different on different brokers time so this i why i want to inmut the time period so it can be Auto
A custom indicator for mt5 with pice based Bollingerbands on Rsi in a separate window.rsi period 14, apply to close, levels 10 buy, 50 take profit, 90 sell. And for Bollingerbands period 25, shift 0, deviation 0.035, apply to close, shift 0. 1 minute time frame
Looking for someone who can teach me how to connect to Mt4 from phyton, code and backtest on phyton. This will be ongoing classes, once or twice a week for 1 hour
Patrex Pro Indicator 30 - 50 USD
I need patrex pro like indicator based on 2 Moving average crossover of 10 and 23 with timeframe in the dashboard. I am including the photos under and it shud nearly or exactly match as in the photo. Thank you
I'm planning on building/creating an mt4/5 trading indicator that use a break and retest strategy I will share a link for the idea strategy, Kindly message me to send you the link, I can't send it here
I am looking for a custom trading indicator for the Nasdaq 100 with the following requirements: Profit and Stop-Loss Targets: The system should aim to make $60 per trade and limit losses with a $30 stop-loss . High Win Rate: The target win rate should be 90% , based on the strategy and technical analysis. Daily Trading: The indicator should assess daily trends and place trades accordingly, ensuring trades are
I would like to request the development of a trading robot with the following specifications: High Win Rate: The robot should aim for a win rate between 80% and 90%. The strategy and algorithm used must be optimized for consistent performance and minimal drawdown. Weekly Market Direction: The robot needs to analyze the market at the beginning of the week and determine the overall direction (bullish or bearish). This
Hi, I need to get a new single Indicator , the result of the union of three already existing indicators (attached), let's call them "sub-indicators". Indicator must generate a continuous green/red output signal in a separate chart window . The 3 sub-indicators to combine are: Trend Arrows xSuperTrend MTF & alerts Wave Entry Alerts Multi TF These sub-indicators return, two of them continuous signal at each bar (
We are seeking an experienced developer to create a custom Expert Advisor (EA) for Forex trading, integrating Artificial Intelligence (AI). The EA should be capable of autonomously analyzing data, reading news feeds, and making intelligent trading decisions. Responsibilities: - Develop a Forex trading EA with AI integration. - The EA must fetch and analyze news from trusted sources to inform trading decisions. -

Informações sobre o projeto

Orçamento
10 - 20 USD
Desenvolvedor
9 - 18 USD
Prazo
de 1 para 2 dias