Macd sample

MQL5 Indicadores

Tarea técnica

//+------------------------------------------------------------------+
//|                                                  MACD Sample.mq4 |
//|                   Copyright 2005-2014, MetaQuotes Software Corp. |
//|                                              http://www.mql4.com |
//+------------------------------------------------------------------+
#property copyright   "2005-2014, MetaQuotes Software Corp."
#property link        "http://www.mql4.com"

input double TakeProfit    =50;
input double Lots          =0.1;
input double TrailingStop  =30;
input double MACDOpenLevel =3;
input double MACDCloseLevel=2;
input int    MATrendPeriod =26;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick(void)
  {
   double MacdCurrent,MacdPrevious;
   double SignalCurrent,SignalPrevious;
   double MaCurrent,MaPrevious;
   int    cnt,ticket,total;
//---
// initial data checks
// it is important to make sure that the expert works with a normal
// chart and the user did not make any mistakes setting external
// variables (Lots, StopLoss, TakeProfit,
// TrailingStop) in our case, we check TakeProfit
// on a chart of less than 100 bars
//---
   if(Bars<100)
     {
      Print("bars less than 100");
      return;
     }
   if(TakeProfit<10)
     {
      Print("TakeProfit less than 10");
      return;
     }
//--- to simplify the coding and speed up access data are put into internal variables
   MacdCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
   MacdPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);
   SignalCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);
   SignalPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);
   MaCurrent=iMA(NULL,0,MATrendPeriod,0,MODE_EMA,PRICE_CLOSE,0);
   MaPrevious=iMA(NULL,0,MATrendPeriod,0,MODE_EMA,PRICE_CLOSE,1);

   total=OrdersTotal();
   if(total<1)
     {
      //--- no opened orders identified
      if(AccountFreeMargin()<(1000*Lots))
        {
         Print("We have no money. Free Margin = ",AccountFreeMargin());
         return;
        }
      //--- check for long position (BUY) possibility
      if(MacdCurrent<0 && MacdCurrent>SignalCurrent && MacdPrevious<SignalPrevious &&
         MathAbs(MacdCurrent)>(MACDOpenLevel*Point) && MaCurrent>MaPrevious)
        {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"macd sample",16384,0,Green);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
               Print("BUY order opened : ",OrderOpenPrice());
           }
         else
            Print("Error opening BUY order : ",GetLastError());
         return;
        }
      //--- check for short position (SELL) possibility
      if(MacdCurrent>0 && MacdCurrent<SignalCurrent && MacdPrevious>SignalPrevious &&
         MacdCurrent>(MACDOpenLevel*Point) && MaCurrent<MaPrevious)
        {
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"macd sample",16384,0,Red);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
               Print("SELL order opened : ",OrderOpenPrice());
           }
         else
            Print("Error opening SELL order : ",GetLastError());
        }
      //--- exit from the "no opened orders" block
      return;
     }
//--- 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)
           {
            //--- should it be closed?
            if(MacdCurrent>0 && MacdCurrent<SignalCurrent && MacdPrevious>SignalPrevious &&
               MacdCurrent>(MACDCloseLevel*Point))
              {
               //--- close order and exit
               if(!OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet))
                  Print("OrderClose error ",GetLastError());
               return;
              }
            //--- check for trailing stop
            if(TrailingStop>0)
              {
               if(Bid-OrderOpenPrice()>Point*TrailingStop)
                 {
                  if(OrderStopLoss()<Bid-Point*TrailingStop)
                    {
                     //--- modify order and exit
                     if(!OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green))
                        Print("OrderModify error ",GetLastError());
                     return;
                    }
                 }
              }
           }
         else // go to short position
           {
            //--- should it be closed?
            if(MacdCurrent<0 && MacdCurrent>SignalCurrent &&
               MacdPrevious<SignalPrevious && MathAbs(MacdCurrent)>(MACDCloseLevel*Point))
              {
               //--- close order and exit
               if(!OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet))
                  Print("OrderClose error ",GetLastError());
               return;
              }
            //--- check for trailing stop
            if(TrailingStop>0)
              {
               if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                 {
                  if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
                    {
                     //--- modify order and exit
                     if(!OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red))
                        Print("OrderModify error ",GetLastError());
                     return;
                    }
                 }
              }
           }
        }
     }
//---
  }
//+------------------------------------------------------------------+

Han respondido

1
Desarrollador 1
Evaluación
(138)
Proyectos
198
80%
Arbitraje
17
29% / 47%
Caducado
10
5%
Trabaja
2
Desarrollador 2
Evaluación
(2)
Proyectos
3
33%
Arbitraje
0
Caducado
0
Libre
3
Desarrollador 3
Evaluación
(1067)
Proyectos
1409
45%
Arbitraje
47
72% / 13%
Caducado
35
2%
Trabaja
Solicitudes similares
Hello, i need professionalthat can help me handle this, I want used replica to of my trading From trading view And copy to my tradovate this is exactly i need https://youtu.be/WOMA8Ift9r8?si=PPf0CHNrZkZ0InHN
I need to Convert the TradingView Indicator to the MT5 Indicator with some custom padding. This EA is done(open source) on TradingView and must be created identically for MT5 from the start(so will not have bugs). The name of the indicator on TradingView is Smart Money Concept done by LuxAlgo, this indicator must be converted and work identically in MT5 Indicator additional requirements: -Non-repaint - Must work on
need a skilled programmer to input parameters in existing indicator. Adding timeframes in the indicator. I have source code file for this indicator. More details will be provided upon selection of job
I would like to have indicator that can alert/popup when there is 3 bullish/bearish candle in a row. For example ; 1st candle bullish 2nd bullish and when the 3rd close as bullish then the indicator popup/alert on chart. Same colour candlestick. Can extend to 5 or more candlestick can be setting
Strategy To Be Used 1. Order Blocks (4HR, Daily And Weekly) 2. FVG (For Entry) 3. Fibonacci Levels (TP) 4. HH/LL ( SL) Works in 1HR & 4HR (TF) Risk to reward minimum 2:1 (Default) Winrate 53.21% (Accuracy) tested on Live account of 1000$ May 14th to May 31st You can change the risk per trade percent Per day DD Limit *it should takes multiple entries at the same price point when the price touches weekly/ daily
Find a good Indicator 30 - 100 USD
As the title says, I need to find an Indicator with the function of scanning Accurate SMC signals on backtest with a nice control panel and can report signals to phone/email. Includes source code and export license for business. Please send Demo or pictures
I am seeking an experienced MQL4 developer to create a custom Triple SuperTrend indicator for MetaTrader 4 (MT4). This indicator will be incorporated into an EA in the near future, so I will need this to delivered as an mq4 file so the source code is readable. A future EA will make trading decisions based on whether the 3 SuperTrend lines are in uptrend/downtrend, so it is crucial this indicator is coded in such a
So the requirements are:- 1. To convert the pinescript code to MT5 code 2. Then implement the strategy shown on the 2 videos above to identify the SnR Levels in 4H and 15 minutes 3. Enhance the strategy to work in different timeframes [ We can discuss this on a call so I explain more]
Looking for a profitable universal scalping custom indicator. Needs to have SL and TP with high win rate with notifications for ENTRY, SL and TP. Preferably to work with all pairs. Please don't sell me widely available indicators from tradingview. Needs to be custom indicator or a personal indicator
BOM DIA programadores, gostaria de alterar o eixo Y de um gráfico de velas, e fazê-lo funcionar automaticamente fora da plataforma da corretora seria possível, gostaria de fazer esse trabalho como freelancer, entre em contato com Neylor, email: neylorcecchi @yahoo.com.br Valor a combinar

Información sobre el proyecto

Presupuesto
30+ USD
Para el ejecutor
27 USD