Existing EA, integrate ATR trailingstop & bug fixing

MQL5 Experten

Auftrag beendet

Ausführungszeit 17 Tage
Bewertung des Kunden
GOOD JOB Recommend him

Spezifikation

 

the current code is a break out ea .

 

Stop opening Trades after the first trade. only the first trade after the breakout should be trade.

After that, the ea must wait untill the price breaks out and trade again. every entry must be recognized.

 

Input Variables ( tradehours) where I can put time in, like 08:00 untill 22:00 o'clock. (8 am to 10 pm)

integrate an ATR  trailing stop with enable - disable choice  ( period of ATR must be able to put in.

 

give your price / days 

 //////////////////////////////////////////////////code/////////////////////////////////////////////////////////

void OnTick(){

   double Ask=SymbolInfoDouble(_Symbol, SYMBOL_ASK);

   double Bid=SymbolInfoDouble(_Symbol, SYMBOL_BID);

   double Poin=SymbolInfoDouble(_Symbol, SYMBOL_POINT);

   int Dig=(int)SymbolInfoInteger(_Symbol, SYMBOL_DIGITS);

   int stopLevel=(int)SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL);

      

   MqlRates mrate[];

   CopyRates(_Symbol,_Period,0,4,mrate);


   double close3=mrate[0].close;  // bar 3

   double close2=mrate[1].close;  // bar 2

   double close1=mrate[2].close;  // bar 1

   double close0=mrate[3].close;  // bar 0


   double open3=mrate[0].open;    // bar 3

   double open2=mrate[1].open;    // bar 2

   double open1=mrate[2].open;    // bar 1

   double open0=mrate[3].open;    // bar 0

   

   double low3=mrate[0].low;    // bar 3

   double low2=mrate[1].low;    // bar 2

   double low1=mrate[2].low;    // bar 1

   double low0=mrate[3].low;    // bar 0

   

   double high3=mrate[0].high;    // bar 3

   double high2=mrate[1].high;    // bar 2

   double high1=mrate[2].high;    // bar 1

   double high0=mrate[3].high;    // bar 0

   

   datetime time3=mrate[0].time;

   datetime time2=mrate[1].time;

   datetime time1=mrate[2].time;

   datetime time0=mrate[3].time;


   double  upLine0=0,upLine1=0,upLine2=0, upLine3=0, dnLine0=0,dnLine1=0, dnLine2=0, dnLine3=0 ;

 

   if(ObjectFind(0,levels_sirname+"_UpName")>-1){

      upLine0=ObjectGetValueByTime(0,levels_sirname+"_UpName",time0);

      upLine1=ObjectGetValueByTime(0,levels_sirname+"_UpName",time1);

      upLine2=ObjectGetValueByTime(0,levels_sirname+"_UpName",time2);

      upLine3=ObjectGetValueByTime(0,levels_sirname+"_UpName",time3);

   } 


   if(ObjectFind(0,levels_sirname+"_DnName")>-1){

      dnLine0=ObjectGetValueByTime(0,levels_sirname+"_DnName",time0);

      dnLine1=ObjectGetValueByTime(0,levels_sirname+"_DnName",time1);

      dnLine2=ObjectGetValueByTime(0,levels_sirname+"_DnName",time2);

      dnLine3=ObjectGetValueByTime(0,levels_sirname+"_DnName",time3);

   } 

 

   if (trail_==TRFIX_){

      if (trailStop>0)

         fSimpleTrailing(trailStop);

   }

   

   if (trail_==TRSTOP_)

      fSimpleTrailing(slPp);

    

   if(PositionSelect(_Symbol)==false)

   {

      double sl=0,tp=0;

      if (time0!=lastOrder){

// dont change this settings below, they finde every entry

      if (upLine0>0 && close1>open1 && close0>open0 && low1>upLine1 && low1<low0 && Ask>high1 ){

         sl=low1;

         if ((Ask-sl)/Poin<stopLevel)

            sl=NormalizeDouble(Ask-stopLevel*Poin,Dig);

         slPp=(int)((Ask-sl)/Poin);

         if (tp_==EXITNO_) tp=0;

         if (tp_==EXIT11_) tp=NormalizeDouble(Ask+slPp*Poin,Dig); 

         if (tp_==EXIT12_) tp=NormalizeDouble(Ask+slPp*2*Poin,Dig);

         if (tp_==EXIT13_) tp=NormalizeDouble(Ask+slPp*3*Poin,Dig);

         if (tp_==EXIT14_) tp=NormalizeDouble(Ask+slPp*4*Poin,Dig);

         if (tp_==FIX_) 

            if(takeProfit>0) tp=NormalizeDouble(Ask+takeProfit*Poin,Dig); else sl=0;

         Trade.Buy(NormLot(_Symbol,lots),_Symbol,Ask,sl,tp,"");

         lastOrder=time0;

         return;

      }         

// dont change this settings below, they finde every entry

      if (dnLine0>0 && close1<open1 && close0<open0 && high1<dnLine1 && high1>high0 && Bid<low1  ){

         sl=high1;

         if ((sl-Bid)/Poin<stopLevel)

            sl=NormalizeDouble(Bid+stopLevel*Poin,Dig);

         slPp=(int)((sl-Bid)/Poin);

         if (tp_==EXITNO_) tp=0;

         if (tp_==EXIT11_) tp=NormalizeDouble(Bid-slPp*Poin,Dig); 

         if (tp_==EXIT12_) tp=NormalizeDouble(Bid-slPp*2*Poin,Dig);

         if (tp_==EXIT13_) tp=NormalizeDouble(Bid-slPp*3*Poin,Dig);

         if (tp_==EXIT14_) tp=NormalizeDouble(Bid-slPp*4*Poin,Dig);

         if (tp_==FIX_) 

            if (takeProfit>0) tp=NormalizeDouble(Bid-takeProfit*Poin,Dig); else sl=0;

         Trade.Sell(NormLot(_Symbol,lots),_Symbol,Bid,sl,tp,"");

         lastOrder=time0;

         return;

      }

      }         

   }

}

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

double NormLot( string symbol, double lot_)

  {

   double LOTSTEP=SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP);

   double MaxLot=SymbolInfoDouble(symbol,SYMBOL_VOLUME_MAX);

   double MinLot=SymbolInfoDouble(symbol,SYMBOL_VOLUME_MIN);

   if(!LOTSTEP || !MaxLot || !MinLot) return(0);

   double lot=LOTSTEP*MathFloor(lot_/LOTSTEP);

   if(lot<MinLot) lot=MinLot;

   if(lot>MaxLot) lot=MaxLot;

   return(lot);

  }

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

void fSimpleTrailing(int Trail){

   if(Trail<=0)  return;

   if(!PositionSelect(_Symbol)) return;

   double Ask=SymbolInfoDouble(_Symbol, SYMBOL_ASK);

   double Bid=SymbolInfoDouble(_Symbol, SYMBOL_BID);

   int stopLevel=(int)SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL);

   double nsl,tmsl,psl;  

   switch(Pos.PositionType()){

      case POSITION_TYPE_BUY:

         nsl=NormalizeDouble(Bid-_Point*Trail,_Digits);

            if(nsl>=NormalizeDouble(Pos.PriceOpen(),_Digits)){

               if(nsl>NormalizeDouble(Pos.StopLoss(),_Digits)){

                  tmsl=NormalizeDouble(Bid-_Point*stopLevel,_Digits);

                     if(nsl<tmsl){

                        Trade.PositionModify(_Symbol,nsl,Pos.TakeProfit());

                     }

               }

            }

      break;

      case POSITION_TYPE_SELL:

         nsl=NormalizeDouble(Ask+_Point*Trail,_Digits);

            if(nsl<=NormalizeDouble(Pos.PriceOpen(),_Digits)){

               psl=NormalizeDouble(Pos.StopLoss(),_Digits);

                  if(nsl<psl || psl==0){

                     tmsl=NormalizeDouble(Ask+_Point*stopLevel,_Digits);

                        if(nsl>tmsl){

                           Trade.PositionModify(_Symbol,nsl,Pos.TakeProfit());

                        }

                  }

            }      

      break;

   }

}

 

Bewerbungen

1
Entwickler 1
Bewertung
(647)
Projekte
1295
67%
Schlichtung
84
26% / 49%
Frist nicht eingehalten
338
26%
Frei
2
Entwickler 2
Bewertung
(90)
Projekte
159
61%
Schlichtung
40
18% / 63%
Frist nicht eingehalten
70
44%
Frei
3
Entwickler 3
Bewertung
Projekte
0
0%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
0
Frei
Ähnliche Aufträge
i have a ready made SMC EA and looking for optimizing and debugging and also adding back the missing things in the requirement file. Basically work with the current code and refine it to fit the requirement file. Most indicator is already in the EA and the requirement file below are mostly finish. here are the things need to add back and debug based on the requirement file 1. TP from the filter and need to check
If you think you can replicate EA ("reverse engineering") from Metarader's Market, and create a new EA from scratch that works 100% the same - please send an offer. I have already managed to find out many features of that EA (entry times, risk management, averaging, trailing...) but I still miss a few
Candle wick bot The bot will have a set amount of wick length to enter trade at candle open price, there will be a set Amount in points that the candle wick has to be to then enter that opposite of the wick direction Settings will look like this : Timeframe: (meaning which candles you’re using to measure open price from for the wick length ) If set to 5 min it’ll be using 5 min candles , if set to 15 it’ll use 15
Looking for a developer to create an MT4 EA based on a custom currency strength indicator and simple moving average. Will provide currency strength indicator code to the selected developer. Buy rules If the EA added in the EURUSD chart and EUR has a currency strength above or equal to 6 and USD has strength less than 2. Wait for the prices comes back to SMA and open the buy trade if the price closes above SMA. Place
I have an equity reporter. This equity reporter displays the maximum and minimum equity reached over a specific interval. So, if the interval is set to 24 hours, the script will generate data in the format: "Profit ATT" (profit AtThatTime) shows max./min. during the specific interval This specific report shows data in pips. It can also be set to display in price or percentages. The interval is also easily adjustable
Sistema HTF EFECTIVO 30 - 60 USD
Hola, me gustaría que un programador experimentado creea un sistema de trading EA que abra y cierre operaciones muy rápido en segundos (HFT). Sería óptimo tener una opción/botón para activar solo para comprar o solo para vender (operaciones unidireccionales). Con una buena interfaz gráfica de usuario. Se agradece la implementación de su propia experiencia con sistemas de trading HFT. Es para mercados volátiles como
Hello, I would like an experienced programmer to create an EA trading system which opens and closes trades very fast within seconds (HFT). To have an option/button to activate either for only buy or only sell (one way trading) would be optimal. With a nice GUI. Implementing your own experience with HFT trading systems is welcomed. It's for volatile markets such as XAUUSD or US30. Taking advantage of order placements
The strategy is a martingale type . i.e if it hits the stop loss , it will double the lot size and place again in that direction, and when it hits the take profit at any level of the martingale, it will start over from the first lot size used initially
I want you to make me an indicator in Training View. Its idea is very simple, and I want it to have an alarm. Here's a clearer step-by-step guide to checking the last 50 candles on your chart and applying Fibonacci retracement levels based on their colors: Identify Candle Color: Start from the 100th candle from the left on the chart and check its color. If the 100th candle is green (i.e., the close is higher than the
I'm looking for a developer to assist in creating an Expert Advisor (EA) for use in a prop firm. The EA should be designed for the MT4 trading platform and include the following features: Scalping strategy Maximum drawdown of 3% Please let me know if you're interested and capable of handling this project

Projektdetails

Budget