Need program to close open position is the conditions are not valid on next candle

MQL5 Indicadores Asesores Expertos

Trabajo finalizado

Plazo de ejecución 1 hora
Comentario del Cliente
Gave the solution that I asked for and also helped with a few questions
Comentario del Ejecutor
5 star customer!

Tarea técnica

Hi,


Very simple code, lines in yellow need to execute on the next candle if the buy or sell signal is no longer valid, SL is just as backup if the market reverses to quickly. I am no programmer so excuse if this is not written eloquently. I have posted only the relevant bit.


      if(PriceInfo[1].close > EMA5[0] && EMA10[0] > EMA20[0] && EMA20[0] > EMA40[0] && RSI14[0] > RSI40[0] && RSI14[0] > 50 && RSI40[0] > 50) {

         if(PositionsTotal()==0) {
            trade.Buy(0.10,_Symbol,Ask,Ask-200*_Point,0,"BUY");
              if(PositionsTotal()>0 || PriceInfo[1].close < EMA5[0] || RSI14[0] < RSI40[0] ){
              trade.Sell(0.10,_Symbol,Bid,0,0,"BUY Close");    
              
              }  
         }
         //else if because we will always do either buy or sell, not both
      } else if(PriceInfo[1].close < EMA5[0] && EMA10[0] < EMA20[0] && EMA20[0] < EMA40[0] && RSI14[0] < RSI40[0] && RSI14[0] < 50 && RSI40[0] < 50) {
         if(PositionsTotal()==0) {
            trade.Sell(0.10,_Symbol,Bid,Bid+200*_Point,0,"SELL");
              if(PositionsTotal()>0 || PriceInfo[1].close > EMA5[0] || RSI14[0] > RSI40[0] ) {
              trade.Buy(0.10,_Symbol,Ask,0,0,"Sell Close");
            }
          }
       }
      Print("_________________Tick End__________________________");
   }

Han respondido

1
Desarrollador 1
Evaluación
(137)
Proyectos
160
23%
Arbitraje
7
0% / 43%
Caducado
4
3%
Trabajando
2
Desarrollador 2
Evaluación
(19)
Proyectos
26
27%
Arbitraje
3
0% / 100%
Caducado
2
8%
Libre
3
Desarrollador 3
Evaluación
(92)
Proyectos
109
34%
Arbitraje
5
40% / 20%
Caducado
5
5%
Trabaja
4
Desarrollador 4
Evaluación
(196)
Proyectos
200
28%
Arbitraje
0
Caducado
3
2%
Libre
5
Desarrollador 5
Evaluación
(30)
Proyectos
55
22%
Arbitraje
12
67% / 8%
Caducado
2
4%
Libre
Solicitudes similares
Indicator MT5 from Pine Script 5 (TradingView) indicators Request: Develop 1 Indicator mql5 from 2 TV (Pine script 5) indicators Get only basic features, I just need to get values in Copybuffer() for mql5 expert. Total MT5 indicator: 4 levels in the chart + 1 oscillator (line/histogram) =================================== TV Indicator 1: Smart Money Concepts Just get High/low levels from internal/externals (smaller /
I have a full code ,, There are some errors in this.It does not add to the chart, does not show arrow marks, does not alert ,, fix this problem and work properly,, Contact on telegram @Gw_rakib1
Starting from scratch, I need a solution to develop my own crypto trading and exchange platform. This platform should compare prices across various exchanges like Coinbase, Binance, KuCoin, and Unocoin, as well as different cryptocurrencies. The solution must identify opportunities to buy on one platform and sell on another for a profit, transferring funds to my personal wallet instantly for security. The bot should
I am looking for a programmer to do EA trader. If you can understand what I want from the video i do and you can do it, contact me because you will be able to do what I want. https://drive.google.com/file/d/1wbHxbUQQqCkdpr0-pHfIh2b288LzYTV2/view?usp=sharing
I have an indicator i will like to view in form of dashboard across various timeframes, i also will like a push notifications alert feature that will appear on my mt4 mobile to keep track of my trading pairs
Need a dashboard, which can monitor up to 30 selected pairs in selected time frames. It monitors AO, MACD and stochastic. In the cells of dashboard, if AO is positive in the relevant symbol/tf, it writes "UP". When one of AO is above 0 level AND Stochastic is in OS zone it writes "UPUP". When AO is above 0 and when stochastics is oversold minimum of two times,it will alert UPU2 if AO is negative below 0 in the
Looking for custom strength indicators I can add to my EA. An indicator that can measure the strength of buyer and sellers. Please show me what you have, thank you
Modify Indicator 30 - 40 USD
I need an expert who can assist me in modifying an open source PineScript indicator code to add additional features. Only applicants with prove of work should apply for more discussion
Hello i need an expert who can help me modify an open source PineScript indicator code to add additional features. ONLY EXPERT WITH PROVE OF WORK SHOULD CONTACT FOR FURTHER DISCUSSION ON THE PROJECT
احتاج شخص عربي يتكلم ويفهم العربية حتى يسهل شرح المطلوب للمؤشر لدي مؤشر واكسبيرت خاص بي بحاجة إلى تعديل الكود المصدري لدي والفكرة تحتاج فعم من المبرمج باختصار اريد مبرمج عربي يفهم ويتكلم العربية حتى يسهل الشرح وفي نفس الوقت صاحب خبرة وتجربة ومتداول على منصة ميتا تريدر حتى يضفي تحسينات على المؤشر ويستطيع عمل الفكرة بكل سهولة وإعطاء النصائح إذا وجد خطأ

Información sobre el proyecto

Presupuesto
30+ USD
Para el ejecutor
27 USD