Fix issue EA mql4

MQL5 Uzman Danışmanlar

İş tamamlandı

Tamamlanma süresi: 1 gün
Müşteri tarafından geri bildirim
very good and fast
Geliştirici tarafından geri bildirim
Thank you very much, super customer!

İş Gereklilikleri

Hello,

 

i have 1 issue with my stop loss, when the order is passed, there is 1 case where the stop loss does not activate.

The case is :

For short position :

- when the order is passed and the entry is below the close of the bar, the stop loss is not activated

For long position :

- when the order is passed and the entry is above the close of the bar, the stop loss is not activated

here the exit code :

input int InpNormalizeDouble = 4;
input int atrlength = 48;
double vAtr;
 vAtr = iATR(NULL,0,atrlength,0);
input double factorSL = 1.00; 

//--- it is important to enter the market correctly, but it is more important to exit it correctly...   
      for(cnt=0;cnt<total;cnt++)
        {
         if(!OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
            continue;
         if(OrderType()<=OP_SELL &&   // check for opened position 
            OrderSymbol()==Symbol())// && // check for symbol
           {
            //--- long position is opened
            if(OrderType()==OP_BUY)
              {
              //Print(""+OrderMagicNumber());
                 switch(OrderMagicNumber())
                 {
                  case 1:
                   //int mtime = iBarShift(_Symbol, 0, OrderOpenTime());
                   //iClose(_Symbol,0,0)
                   //iTime(_Symbol,0,0)
                   //if((bRegHigh1 < High[0] && xbars1L < xNumberbars) || bRegHigh1 == 0)
                   //{
                   //  bRegHigh1 = High[0];
                   //  xbars1L++;
                   //}
                    bRegHigh1 = HHsinceEntry(OrderOpenTime());
                    //exitpriceL1 = NormalizeDouble(bRegHigh1 - (bRegHigh1 *(vAtr / OrderOpenPrice())*1.55),InpNormalizeDouble);
                    exitpriceL1 = bRegHigh1 - (bRegHigh1 *(vAtr / OrderOpenPrice())*factorSL);
                    //Print("bRegHigh1: "+bRegHigh1);
                    //Print("exitpriceL1: "+exitpriceL1);
                    //Print("vAtr: "+vAtr);
                    //Print("OrderOpenPrice(): "+OrderOpenPrice());
                    //Print("===============================================");
                      if(MathAbs(Close[0]-OrderOpenPrice())>MathAbs(exitpriceL1-OrderOpenPrice()))
                       {
                        if(OrderStopLoss()<exitpriceL1 || OrderStopLoss()==0)
                          {
                          //pips = profit / PipValuePerLot;
                          //NormalizeDouble(pips,1)
                           //--- modify order and exit
                           //Print("OrderModifyL: "+exitpriceL1);
                           //if(!OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green))
                           if(!OrderModify(OrderTicket(),OrderOpenPrice(),exitpriceL1,OrderTakeProfit(),0,Green))
                              Print("OrderModify error",GetLastError());
                           return;
                          }
                       }
                  break;
               
                 }
               
              }
            else // go to short position
              {
              
                 switch(OrderMagicNumber())
                 {
                  case 1:
                  
                  //if((sRegLow1 > Low[0] && xbars1S < xNumberbars) || sRegLow1 == 0)
                  //{
                  //   sRegLow1 = Low[0];
                  //   xbars1S++;
                  //}
                  //Print("sRegLow1: "+sRegLow1);
                     //exitpriceS1 = NormalizeDouble(sRegLow1 + (sRegLow1 *(vAtr / OrderOpenPrice())*1.55),InpNormalizeDouble);
                     sRegLow1 = LLsinceEntry(OrderOpenTime());
                     
                     exitpriceS1 = sRegLow1 + (sRegLow1 *(vAtr / OrderOpenPrice())*factorSL);
                     Print("sRegLow1: "+sRegLow1);
                     Print("exitpriceS1: "+exitpriceS1);
                     Print("vAtr: "+vAtr);
                     Print("OrderOpenPrice(): "+OrderOpenPrice());
                     Print("===============================================");
                      if(MathAbs(OrderOpenPrice()-Close[0])>MathAbs(OrderOpenPrice()-exitpriceS1))
                       {
                       
                        if(OrderStopLoss()>exitpriceS1 || OrderStopLoss()==0)
                          {
                          //Print("OrderModifyS: "+exitpriceS1);
                          //Print("OrderOpenPrice()-Close[0]: "+(OrderOpenPrice()-Close[0]));
                          //Print("OrderOpenPrice()-exitpriceS1: "+(OrderOpenPrice()-exitpriceS1));
                           //--- modify order and exit
                           //if(!OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red))
                           if(!OrderModify(OrderTicket(),OrderOpenPrice(),exitpriceS1,OrderTakeProfit(),0,Red))
                              Print("OrderModify error",GetLastError());
                           return;
                          }
                       }
                  break;
                 }
              }
           }
           else
           {
            bRegHigh1 = 0;
            
            sRegLow1 = 0;
         
           }
        }
     }
  }
//+------------------------------------------------------------------+


and below the variable to know bRegHigh1  and  sRegLow1 :

double HHsinceEntry(datetime)
{
   //datetime    OOT         = OrderOpenTime();          // Assumes OrderSelect() done already
   int         iOOT        = iBarShift(Symbol(),Period(),OrderOpenTime(), false);   // Bar of the open.
   #define     iBarBuy   0                        // Include current bar.
   int         nSince  = iOOT + 1;       // No. bars since open.
   int         iHi         = iHighest(Symbol(),Period(), MODE_HIGH, nSince, iBarBuy);
   double      HH = iHigh(Symbol(), Period(), iHi);
   // Highest high.iHi give the number of the bar with highest price.High[] return price high of the bar
   return HH;
}

double LLsinceEntry(datetime)
{
   //datetime    OOT         = OrderOpenTime();          // Assumes OrderSelect() done already
   int         iOOT        = iBarShift(Symbol(),Period(),OrderOpenTime(), false);   // Bar of the open.
   #define     iBarSell   0                         // Include current bar.
   int         nSince  = iOOT + 1;       // No. bars since open.
   int         iLi         = iLowest(Symbol(),Period(), MODE_LOW, nSince, iBarSell);
   double      LL = iLow(Symbol(), Period(), iLi);
   // Lowest low. 
   return LL;
}


i attach a screenshot for the short position



Price is nego in case


tom

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(586)
Projeler
1048
49%
Arabuluculuk
39
28% / 41%
Süresi dolmuş
49
5%
Serbest
2
Geliştirici 2
Derecelendirme
(188)
Projeler
212
58%
Arabuluculuk
9
11% / 89%
Süresi dolmuş
8
4%
Serbest
3
Geliştirici 3
Derecelendirme
(225)
Projeler
284
42%
Arabuluculuk
15
13% / 47%
Süresi dolmuş
67
24%
Serbest
4
Geliştirici 4
Derecelendirme
(563)
Projeler
932
47%
Arabuluculuk
302
59% / 25%
Süresi dolmuş
124
13%
Yüklendi
Benzer siparişler
I want have the possibility to increase lotsize not alone by Lot-multiplier rather I want add a fix-lot increase for excample for 0,05 lot. I want have this for buy / sell and hedge-buy and hedge sell
Hi, I want to make an automated system to take my place in making trading positions and closing it. But I want to ask , can you program it to draw a trend line in a specific chart and several moving averages should be in specific order, and when the price is near the trend line by few pips, we shift to 15 minutes chart and noticing a resistance or support action , then we take the trade ? can we do that
Develop EA to track performance metrics of strategies I would like to develop an EA that will track the performance metrics of the strategies I have running on a terminal, If any of the metrics start to under perform then the EA/Indictor should alert me with a pop up alert that specify's the metric that has triggered the alert. The EA should also display the metrics in a dashboard - please see my example screen shot
I would like to modify the RSI Epert Avisor with a developer. I would like to use the RSI Expert on the inverse mode and the base setting doesnt conatain this strategy mode
Profitable EA HFT 50 - 300 USD
From a long time i am searching for a profitable EA i have lost a lot , and now i have only 300$ to buy a profitable EA , i wish to say with 0 losses but some or most traders they don't want to hear this i am really tired of searching for a programmer to just create me a profitable EA with the least losses or zero losses maybe nearly 1 year i am searching i just need an HFT EA that can work very well on MT4,MT5
I need help fixing my EA for MT5. It’s a very simple EA, and I currently cannot solve an issue where webrequest communicates with OpenAi API without error. Please only apply if you can help solve this issue
p.p1 {margin: 0.0px 0.0px 12.0px 0.0px; font: 14.0px 'Trebuchet MS'; color: #313131} p.p1 {margin: 0.0px 0.0px 12.0px 0.0px; font: 14.0px 'Trebuchet MS'; color: #313131} li.li1 {margin: 0.0px 0.0px 12.0px 0.0px; font: 14.0px 'Trebuchet MS'; color: #313131} ol.ol1 {list-style-type: decimal} I have an EA that open trades when my entry conditions are met. It usually executes one trade per day. I'd like to add an option
у нас есть стратегия, нам нужно написать mql5-код ​​для тестера стратегий МТ5,Цена договорная. Мой контакт @abbosaliyev из Telegram Программист должен знать РУССКИЙ ИЛИ УЗБЕКСКИЙ язык. Задание: разработать тестер, который использует шаблон условий на открытие и проверит весь исторический график на всех доступных таймфреймах. Остальная информация будет предоставлена ​​после согласования цены
a coder is required to add an indicator to existing ea The new indicator will work as 1. option to combine with exiting indicator to open trade 2. it will be used as alternative BE point 3. It can also be used to close order or combine with other to close trade The second Job is telegram bot to get alert fr news trade and others Details when you apply i will test the ea work on live market and all bug is fixed before
Hello, I want to make an EA based on SMC and a developer that is familiar with the concept and full understanding of this. Must have done similar jobs before and be able show it. I only want to work with developer that has good track record and is precise. Further information will be handed when contact is made. Developers that has zero rating will not be considered. Listed price is a base point. The project can also

Proje bilgisi

Bütçe
30 - 200 USD
Geliştirici için
27 - 180 USD
Son teslim tarihi
to 10 gün