EA that trails my position

MQL4 Эксперты

Работа завершена

Время выполнения 1 час
Отзыв от заказчика
thx for all - very good job

Техническое задание

Hello,


you write an EA the trails the open position. For trailing stop you use "ATRStops" indicator in attachment.

1) If I set the EA to the chart the EA loads and show the indicator on chart
2) The ea checks if there is an open position
3) if there is an open buy position and the close is higher than the line, then you use line for trail (also for sell trades of curse)
4) You create an input that I can say that the position will be closed if the close is under the line,
or we modify the stoploss on broker. Position will be stop out directly on line



//+------------------------------------------------------------------+
//|                                                  ATRStops_v1.mq4 |
//|                                  Copyright © 2006, Forex-TSD.com |
//|                         Written by IgorAD,igorad2003@yahoo.co.uk |  
//|            http://finance.groups.yahoo.com/group/TrendLaboratory |                                      
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Forex-TSD.com "
#property link      "http://www.forex-tsd.com/"
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int    Length=8;
extern int    ATRperiod=14;
extern double Kv=3;
//---- indicator buffers
double UpBuffer1[];
double DnBuffer1[];
double smin[];
double smax[];
double trend[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
  int init()
  {
   string short_name;
//---- indicator line
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   IndicatorBuffers(5);
   SetIndexBuffer(0,UpBuffer1);
   SetIndexBuffer(1,DnBuffer1);
   SetIndexBuffer(2,smin);
   SetIndexBuffer(3,smax);
   SetIndexBuffer(4,trend);
//---- name for DataWindow and indicator subwindow label
   short_name="ATRStops("+Length+")";
   IndicatorShortName(short_name);
   SetIndexLabel(0,"Up");
   SetIndexLabel(1,"Dn");
//----
   SetIndexDrawBegin(0,Length);
   SetIndexDrawBegin(1,Length);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| ATRStops_v1                                                      |
//+------------------------------------------------------------------+
int start()
  {
   int shift,limit, counted_bars=IndicatorCounted();
//----
   if(counted_bars > 0) limit=Bars-counted_bars;
   if(counted_bars < 0) return(0);
   if(counted_bars ==0) limit=Bars-Length-1;
//----
   for(shift=limit;shift>=0;shift--)
     {
      smin[shift]=-100000; smax[shift]=100000;
      for(int i=Length-1;i>=0;i--)
        {
         smin[shift]=MathMax( smin[shift], High[shift+i] - Kv*iATR(NULL,0,ATRperiod,shift+i));
         smax[shift]=MathMin( smax[shift], Low[shift+i] + Kv*iATR(NULL,0,ATRperiod,shift+i));
        }
      trend[shift]=trend[shift+1];
      if(Close[shift] > smax[shift+1])trend[shift]= 1;
      if(Close[shift] < smin[shift+1])trend[shift]=-1;
      if(trend[shift] >0)
        {
         if(smin[shift]<smin[shift+1])smin[shift]=smin[shift+1];
         UpBuffer1[shift]=smin[shift];
         DnBuffer1[shift]=EMPTY_VALUE;
        }
      if(trend[shift] <0)
        {
         if(smax[shift]>smax[shift+1])smax[shift]=smax[shift+1];
         UpBuffer1[shift]=EMPTY_VALUE;
         DnBuffer1[shift]=smax[shift];
        }
     }
   return(0);
  }
//+------------------------------------------------------------------+


Откликнулись

1
Разработчик 1
Оценка
(600)
Проекты
935
46%
Арбитраж
31
39% / 29%
Просрочено
93
10%
Свободен
2
Разработчик 2
Оценка
(88)
Проекты
143
39%
Арбитраж
21
19% / 48%
Просрочено
30
21%
Свободен
Похожие заказы
I am developing a master EA that integrates several sub-EAs. The project is complex, and the documentation is thoroughly structured, spanning 50 pages with detailed step-by-step procedures. 1st sub-EA: This EA opens trades without using indicators. Instead, it opens a new trade based on the color or status of the last candle. For instance, if the last candle was green, a new buy trade is opened. 2nd sub-EA: This EA
Good Day I would like to order a trading robot. Pairs: XAUUSD (GOLD) EUR/USD USD/JPY The robot should be trading daily with TP/SL build in, would like to have trailing and stop loss, should execute up to 5 trades (preffarable setting choice) up to 10 trades Los sizes to be choise setting, must also trade major US vews events Like:US- PPI, CPI, NFP, Sales m/m and so on Must also show/display alert when opening
Hello Guys, I need a trading bot for the MT5 to place order based on my trading strategy which is based on - >> entry based on EMA with rejection from specific levels like support and resistance area - levels and time frame i will apply into the robot manually on daily basis. also need - trailing stoploss , shift to breakeven after gaining some points. need a highly expert developer
Trade Manger EA 30+ USD
Hello Programmer! I am looking to build an EA that will place my trade and manage it. Once i have manually found my setup, I will want an EA to open the trade, set the R:R and manage it according to my specifications. please take a look at the attached to get an Idea of what I would like. I will require the source code once completed
Hello there i need someone who will create a robot that will calculate the movement between buy/sell and show where to take profit the robot should work with all currency and indices including stock
EA to send account history to web request. It should send every 5 mins or when there is an update. It then sends the json to a web request where gain, drawdown, balance, equity will be displayed
I have a full strategy based on indicator and candle based on . i would like to make it into a robot which will trade for me on a specific time and specific rules. i need a person who can do this project for me. If you have done this type of job . you are most welcome for this. Apply only if you know binary trading option and binomo trading platform well and how it works
Preciso de um EA, que faça o fecho automático de operações abertas no final da sessão e nas notícias de alto impacto. Um EA simples com apenas 1 função. Fecho das operações abertas
Enter buy trade at close of candle when bar closes above the 3 emas. Emas are 34 ema, 64 ema and 128 ema. For a buy trade the 34 ema must be above the other two emas. The 64 ema should be in the middle. The 128 ema should be below the other two emas. For a buy trade the Awesome Oscillator should be above the middle line and colored green. Exit a buy trade when price touches 64 ema. Sell trade same conditions as buy
I want to make AI based on Attached Picture Swing High low. If you have experience can share demo first. Stop loss, take profit, trailing , break even ,DD etc. also amiable

Информация о проекте

Бюджет
30+ USD
VAT (19%): 5.7 USD
Итого: 35.7 USD
Исполнителю
27 USD
Сроки выполнения
до 1 дн.