Convert Halftrend indicator into pinescript tradingview.

MQL5 Indicadores Conversão

Trabalho concluído

Tempo de execução 6 dias

Termos de Referência

I need to convert mt4 indicator into pinescript , version should be exactly as mt4 and not repainting and without any error.



//+----------------------------------------------------------------------+
//|                                             tradelikemarketmaker.mq4 |
//|                             Copyright 2020, tradelikemarketmaker.com |
//|                                     http://tradelikemarketmaker.com/ |
//+----------------------------------------------------------------------+
#property copyright "Copyright © 2020 tradelikemarketmaker.com"
#property link      "http://tradelikemarketmaker.com/"
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Blue  // up[]
#property indicator_width1 2
#property indicator_color2 Red       // down[]
#property indicator_width2 2
#property indicator_color3 DodgerBlue  // atrlo[]
#property indicator_width3 1
#property indicator_color4 Red       // atrhi[]
#property indicator_width4 1
#property indicator_color5 Gold  // arrup[]
#property indicator_width5 3
#property indicator_color6 Gold      // arrdwn[]
#property indicator_width6 3

extern string  SSI             = "Broker Order Book Readings";
extern int     Oanda           = 1;
extern int     IGGroup         = 1;
extern int     Dukas           = 1;
extern int     Saxo            = 1;
extern int     Alpari          = 1;
extern int     Myfxbook        = 1;
extern int     FiboGroup       = 1;  
extern int    Gravitational    = 2;
extern int    Amplitude        = 2;
extern bool   ShowBars         = false;
extern bool   ShowArrows       = true;
extern int   FiboSignalRange   = 45;
extern int    StoppClusterSet  = 77;
extern int    CurrentRatioSet  = 33000;
extern int    ProfitRatioSet   = 94000;
extern int    ScalpRatioSet    = 45;
extern bool   ScalpModel       = false;
extern bool   NeuralBuffer     = false;
extern int  NeuralBufferSizeMB = 10;
extern bool   MarketMakerMode  = false;
extern bool   alertsOn         = true;
extern bool   alertsOnCurrent  = false;
extern bool   alertsMessage    = true;
extern bool   alertsSound      = true;
extern bool   alertsEmail      = true;

bool nexttrend;
double minhighprice,maxlowprice;
double up[],down[],atrlo[],atrhi[],trend[];
double arrup[],arrdwn[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {if (AccountNumber()!=170145)  return(INIT_PARAMETERS_INCORRECT);
 
    //codes}
   Comment("    Copyright © 2020 | Tradelikemarketmaker.com");
   IndicatorBuffers(7); // +1 buffer - trend[]
   
   SetIndexBuffer(0,up);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(1,down);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(2,atrlo);
   SetIndexBuffer(3,atrhi);
   SetIndexBuffer(6,trend);
   SetIndexBuffer(4,arrup);
   SetIndexBuffer(5,arrdwn);
   SetIndexEmptyValue(0,0.0);
   SetIndexEmptyValue(1,0.0);
   SetIndexEmptyValue(6,0.0);
   
   if(ShowBars)
   {
      SetIndexStyle(2,DRAW_HISTOGRAM, STYLE_SOLID);
      SetIndexStyle(3,DRAW_HISTOGRAM, STYLE_SOLID);
   }
   else
   {
      SetIndexStyle(2,DRAW_NONE);
      SetIndexStyle(3,DRAW_NONE);
   }
   if(ShowArrows)
   {
     SetIndexStyle(4,DRAW_ARROW,STYLE_SOLID); SetIndexArrow(4,110);
     SetIndexStyle(5,DRAW_ARROW,STYLE_SOLID); SetIndexArrow(5,110);
   }
   else
   {
     SetIndexStyle(4,DRAW_NONE);
     SetIndexStyle(5,DRAW_NONE);
   } 
          
     
   nexttrend=0;
   minhighprice= High[Bars-1];
   maxlowprice = Low[Bars-1];
   return (0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class CFix { } ExtFix;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   double atr,lowprice_i,highprice_i,lowma,highma;
   int workbar=0;
   int counted_bars=IndicatorCounted();
      if(counted_bars<0) return(-1);
      if(counted_bars>0) counted_bars--;
         int limit = MathMin(Bars-counted_bars,Bars-1);
   
   for(int i=Bars-1; i>=0; i--)
     {
      lowprice_i=iLow(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_LOW,Amplitude,i));
      highprice_i=iHigh(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_HIGH,Amplitude,i));
      lowma=NormalizeDouble(iMA(NULL,0,Amplitude,0,MODE_SMA,PRICE_LOW,i),Digits());
      highma=NormalizeDouble(iMA(NULL,0,Amplitude,0,MODE_SMA,PRICE_HIGH,i),Digits());
      trend[i]=trend[i+1];
      atr=iATR(Symbol(),0,100,i)/2;

      arrup[i]  = EMPTY_VALUE;
      arrdwn[i] = EMPTY_VALUE;
      if(nexttrend==1)
        {
         maxlowprice=MathMax(lowprice_i,maxlowprice);

         if(highma<maxlowprice && Close[i]<Low[i+1])
           {
            trend[i]=1.0;
            nexttrend=0;
            minhighprice=highprice_i;
           }
        }
      if(nexttrend==0)
        {
         minhighprice=MathMin(highprice_i,minhighprice);

         if(lowma>minhighprice && Close[i]>High[i+1])
           {
            trend[i]=0.0;
            nexttrend=1;
            maxlowprice=lowprice_i;
           }
        }
      if(trend[i]==0.0)
        {
         if(trend[i+1]!=0.0)
           {
            up[i]=down[i+1];
            up[i+1]=up[i];
            arrup[i] = up[i] - 2*atr;
           }
         else
           {
            up[i]=MathMax(maxlowprice,up[i+1]);
           }
         atrhi[i] = up[i] - atr;
         atrlo[i] = up[i];
         down[i]=0.0;
        }
      else
        {
         if(trend[i+1]!=1.0)
           {
            down[i]=up[i+1];
            down[i+1]=down[i];
            arrdwn[i] = down[i] + 2*atr;           
           }
         else
           {
            down[i]=MathMin(minhighprice,down[i+1]);
           }
         atrhi[i] = down[i] + atr;
         atrlo[i] = down[i];
         up[i]=0.0;
        }
     }
     manageAlerts();
   return (0);
  }
//+------------------------------------------------------------------+
//+-------------------------------------------------------------------
//|                                                                  
//+-------------------------------------------------------------------
//
//
//
//
//

void manageAlerts()
{
   if (alertsOn)
   {
      if (alertsOnCurrent)
           int whichBar = 0;
      else     whichBar = 1; 
         if (arrup[whichBar]  != EMPTY_VALUE) doAlert(whichBar,"LONG");
         if (arrdwn[whichBar] != EMPTY_VALUE) doAlert(whichBar,"SHORT");
   }
}

//
//
//
//
//

void doAlert(int forBar, string doWhat)
{
   static string   previousAlert="nothing";
   static datetime previousTime;
   string message;
   
   if (previousAlert != doWhat || previousTime != Time[forBar]) {
       previousAlert  = doWhat;
       previousTime   = Time[forBar];

       //
       //
       //
       //
       //

       message =  StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," Possible Trend ",doWhat);
          if (alertsMessage) Alert(message);
          if (alertsEmail)   SendMail(StringConcatenate(Symbol(),"HalfTrend "),message);
          if (alertsSound)   PlaySound("alert2.wav");
   }
}


Respondido

1
Desenvolvedor 1
Classificação
(800)
Projetos
1371
72%
Arbitragem
112
29% / 48%
Expirado
341
25%
Trabalhando
2
Desenvolvedor 2
Classificação
(1)
Projetos
1
0%
Arbitragem
0
Expirado
1
100%
Livre
Pedidos semelhantes
Hello, This is pretty simple and its an indicator with On/Off button 1-Off will remove all indicator from the chart. 2-On will put them all back again with the same settings
Trading bot 300+ USD
We need bot that trades when medium and low impact news hits It will release pending order both directions few min prior to news impact And will have certain risk management strategy attached Example If Monday and Tuesday news successful clears profits It will reduce risk for next news events until new week starts each week message on tg: Dstatewealthtrading NOTE: 4 YAERS OF EXPERIENCE UPWORD, YOU MUST BE A
I need someone the create a supertrend indicator based on Heikin Ashi candles instead of normal candles. Needs to be exactly the same as the supertrend (original one) + ha from tradingview. In m1,m5,m15 the indicator must have the same values ​​found with the tradingview. Work that meets this requirement will be accepted ( depending on the broker and spread, however, a few pips of difference will be accepted)
Here is a detailed instruction for the coder to implement the vertical lines based on the BrainTrainSignalAlert indicator: --- **Task: Implement Vertical Lines for Alerts from BrainTrainSignalAlert Indicator** **Objective:** Create a system that adds vertical lines on specified timeframes (M5 or M30) whenever an alert is generated by the BrainTrainSignalAlert indicator on the H1, H4, and D1 timeframes. The lines
Hello Guys! I want to modify/fix the indicator that uses sequential type of entries (it calculates from 1 to 9) and if the conditions are met it provides an arrow (signal) with alert. The problem is that, sometimes (for unknown for me reasons) it repaints arrow signal. Like on the picture: Signal 1 - correct signal Signal 2 - correct signal Signal 3 - correct signal Signal 4 - repaints (signal 3 arrow dissapeared
Hi, I have a Live Data feature for my trading accounts that lets me check details like total open positions, number of lots, profits, etc. I need someone to add the number of pending orders to this live data. This is important for me to ensure that all accounts have the same number of pending orders, since I use a copy trading system. Also, there is a website where I check all the data. In this case, you would need
I came across an indicator that's perfectly good in catching spikes in boom amd crash but i would want it to be modified and to improve accuracy As a professional you will have to go through the indicator and explain to me the strategy with which the indicator was buid and tell me the possibility of improving it better
An EA that executes when the 21 and 55 SMA Cross on certain time frame also the EA will understand supply and demand levels and executes when price reacts on this levels specified and target/stoploss levels will be predetermined...also the robot will also comprise stochastic oscillator
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

Informações sobre o projeto

Orçamento
40+ USD
Desenvolvedor
36 USD