Squeeze Momentum Indicator [LazyBear]

MQL5 专家

工作已完成

执行时间31 分钟
客户反馈
absolutely brilliant everything i ask for and more, and all done within a couple of hours. I would use again without hesitation
员工反馈
Very thanks for order! Please let me know if you need programmer!

指定

I would like someone who could change this indicator onto an expert adviser.

i want it to buy when the red histogram changes to green and see when green changes to red. i know that this is not a great strategy but i can add other indicators later.

I want the mql5 an ex5 files please

//+------------------------------------------------------------------+
//|                                     SqueezeMomentumIndicator.mq5 |
//|                                Copyright 2020, Andrei Novichkov. |
//|                                               http://fxstill.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, Andrei Novichkov."
#property description "Translate from Pine: Squeeze Momentum Indicator [LazyBear]"
/*********************************************************************************************************
This is a derivative of John Carter's 
"TTM Squeeze" volatility indicator, as discussed in his book "Mastering the Trade" (chapter 11).

Black crosses on the midline show that the market just entered a squeeze 
( Bollinger Bands are with in Keltner Channel).
This signifies low volatility , market preparing itself for an explosive move (up or down).
Gray crosses signify "Squeeze release".

Mr.Carter suggests waiting till the first gray after a black cross, and taking a position in the 
direction of the momentum (for ex., if momentum value is above zero, go long).
Exit the position when the momentum changes (increase or decrease - signified by a color change).

Mr.Carter uses simple momentum indicator , while I have used a different method (linreg based)
to plot the histogram.

More info:
- Book: Mastering The Trade by John F Carter 
*********************************************************************************************************/
#property link      "http://fxstill.com"
#property version   "1.00"


#property indicator_separate_window

#property indicator_buffers 5
#property indicator_plots   2

#property indicator_label1  "SqueezeMomentum"
#property indicator_type1   DRAW_COLOR_HISTOGRAM
#property indicator_color1  clrLimeGreen, clrGreen, clrRed, clrMaroon
#property indicator_style1  STYLE_SOLID
#property indicator_width1  3

#property indicator_label2  "SqueezeMomentumLine"
#property indicator_type2   DRAW_COLOR_LINE
#property indicator_color2  clrDodgerBlue, clrBlack, clrGray
#property indicator_style2  STYLE_SOLID
#property indicator_width2  5

//--- input parameters
input int      lengthBB                 = 20;          // Bollinger Bands Period
input double   multBB                   = 2.0;         // Bollinger Bands MultFactor
input int      lengthKC                 = 20;          // Keltner Channel Period
input double   multKC                   = 1.5;         // Keltner Channel MultFactor
input ENUM_APPLIED_PRICE  applied_price = PRICE_CLOSE; // type of price or handle 


double iB[], iC[], lB[], lC[];
double srce[];
int kc, bb;

static int MINBAR = MathMax(lengthBB, lengthKC) + 1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit() {

   SetIndexBuffer(0, iB,    INDICATOR_DATA);
   SetIndexBuffer(1, iC,    INDICATOR_COLOR_INDEX);
   SetIndexBuffer(2, lB,    INDICATOR_DATA);
   SetIndexBuffer(3, lC,    INDICATOR_COLOR_INDEX);   
   SetIndexBuffer(4, srce,  INDICATOR_CALCULATIONS);
   
   ArraySetAsSeries(iB,    true);
   ArraySetAsSeries(iC,    true);
   ArraySetAsSeries(srce,   true);
   ArraySetAsSeries(lB, true);
   ArraySetAsSeries(lC,   true);   

   IndicatorSetString(INDICATOR_SHORTNAME,"SQZMOM");
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);
   
   kc = iCustom(NULL, 0, "KeltnerChannel", lengthKC, multKC, false, MODE_SMA, applied_price);
   if (kc == INVALID_HANDLE) {
      Print("Error while open KeltnerChannel");
      return(INIT_FAILED);
   }   
   bb = iBands(NULL, 0, lengthBB, 0, multBB, applied_price);
   if (bb == INVALID_HANDLE) {
      Print("Error while open BollingerBands");
      return(INIT_FAILED);
   }      
   return(INIT_SUCCEEDED);
}
  
void OnDeinit(const int reason) {

   IndicatorRelease(kc);
   IndicatorRelease(bb);     
}

void GetValue(const double& h[], const double& l[], const double& c[], int shift) {
   
   double bbt[1], bbb[1], kct[1], kcb[1];
   if (CopyBuffer(bb, 1,  shift, 1, bbt) <= 0) return;
   if (CopyBuffer(bb, 2,  shift, 1, bbb) <= 0) return;
   if (CopyBuffer(kc, 0,  shift, 1, kct) <= 0) return; 
   if (CopyBuffer(kc, 2,  shift, 1, kcb) <= 0) return; 
  
   bool sqzOn  = (bbb[0] > kcb[0]) && (bbt[0] < kct[0]);
   bool sqzOff = (bbb[0] < kcb[0]) && (bbt[0] > kct[0]);
   bool noSqz  = (sqzOn == false)  && (sqzOff == false); 
   
   int indh = iHighest(NULL, 0, MODE_HIGH, lengthKC, shift); 
   if (indh == -1) return;
   int indl = iLowest(NULL, 0, MODE_LOW, lengthKC, shift);
   if (indl == -1) return;       
   double avg = (h[indh] + l[indl]) / 2;
          avg = (avg + (kct[0] + kcb[0]) / 2) / 2;
   srce[shift] = c[shift] - avg; 
     
   double error;
   iB[shift] = LinearRegression(srce, lengthKC, shift, error);
   
   if (iB[shift] > 0){
      if(iB[shift] < iB[shift + 1]) iC[shift] = 1;
   } else {
      if(iB[shift] < iB[shift + 1]) iC[shift] = 2;
      else iC[shift] = 3;
   }
   
   if (!noSqz) {
      lC[shift] = (sqzOn)? 1: 2;
   }
}

double LinearRegression(const double& array[], int period, int shift, double& error) {
  
   double sx = 0, sy = 0, sxy = 0, sxx = 0, syy = 0, y = 0;
   
   int param = (ArrayIsSeries(array) )? -1: 1;
   
   for (int x = 0; x < period; x++) {
      y    = array[shift + param * x];
      sx  += x;
      sy  += y;
      sxx += x * x;
      sxy += x * y;
      syy += y * y;
   }//for (int x = 1; x <= period; x++)
               
   double slope = (period * sxy - sx * sy) / (sx * sx - period * sxx);
   double intercept = (sy - slope * sx) / period;
   error = MathSqrt((period * syy - sy * sy - slope * slope * (period * sxx - sx*sx)) / 
                    (period * (period - 2)) );
                    
   return intercept + slope * period;
}//double LinearRegression(const double& array[], int shift)

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
      if(rates_total <= 4) return 0;
      ArraySetAsSeries(close,true);    
      ArraySetAsSeries(high,true); 
      ArraySetAsSeries(low,true); 
      int limit = rates_total - prev_calculated;
      if (limit == 0)        {   //A new tick has come
      } else if (limit == 1) {   // A new bar is formed
         GetValue(high, low, close, 1);      
      } else if (limit > 1)  {   // The first call of the indicator, changing the timeframe, loading data from history
         ArrayInitialize(iB,    EMPTY_VALUE);
         ArrayInitialize(iC,    0);
         ArrayInitialize(lB,    0);
         ArrayInitialize(lC,    0);         
         ArrayInitialize(srce,  0);
         limit = rates_total - MINBAR;
         for(int i = limit; i >= 1 && !IsStopped(); i--){
            GetValue(high, low, close, i);
         }//for(int i = limit + 1; i >= 0 && !IsStopped(); i--)
         return(rates_total);         
      }
//      GetValue(high, low, close, 0);          
   return(rates_total);
  
  
}
//+------------------------------------------------------------------+


反馈

1
开发者 1
等级
(1156)
项目
1462
63%
仲裁
21
57% / 10%
逾期
43
3%
空闲
2
开发者 2
等级
(8)
项目
16
0%
仲裁
8
13% / 75%
逾期
3
19%
空闲
3
开发者 3
等级
(361)
项目
643
26%
仲裁
92
72% / 14%
逾期
12
2%
工作中
发布者: 1 代码
4
开发者 4
等级
(87)
项目
114
26%
仲裁
7
29% / 57%
逾期
5
4%
空闲
5
开发者 5
等级
(54)
项目
53
17%
仲裁
7
0% / 100%
逾期
5
9%
空闲
相似订单
Nestalink.EA 30 - 100000 USD
//+------------------------------------------------------------------+ //| Prop Firm Challenge EA – Fully Automated (MT5) | //+------------------------------------------------------------------+ #property strict #include <Trade/Trade.mqh> CTrade trade; // ================= INPUTS ================= input double RiskPerTradePct = 0.5; // 0.5% risk (prop firm safe) input double MaxDailyLossPct = 2.0; // Daily loss limit
Я ищу уже существующего, прибыльного советника Если у вас уже есть проверенный, стабильный и готовый к использованию советника, я бы хотел его протэстировать и получить. Обязательные требования ▪ Оригинальный код: Требуется полный исходный код в формате .mq5 (желательно чисто, читаемый и хорошо прокомментированный). ▪ Тестирование исторических данных: Минимальный срок тестирования — 5 лет (для проведения
i need a trading bot that can make 100% profit in 1 day. with capital less than $200 i know this is risky but am willing to take the risk. ea has to be backtestable and also i will test for just 5days to make sure it works. and make a purchase if am satisfied with the 5days results. send backtest results for me to consider and reply
I have EA Tema + Live Optimization. How it works: - If, after the close of a bullish candle, the TEMA value is equal to or greater than the index value, SELL. - If, after the close of a bearish candle, the TEMA value is equal to or less than the index value, BUY (roll). And so on ad infinitum... * I would like to build in the Heiken_Ashi candlestick indicator. There are 4 types of candles: 1.blue bullish 2.blue
Hello, The request is to create an EA based on following conditions. Kindly reach out to me if you are really interested. Forex : XAUUSD (Gold) from OANDA. Condition 1: Entry point should be in 2nd half of the 4 hours candle( if the 4 hour candle start at the 7:30 IST time then trade should be activated after 9:30 IST---> for all 6 Candles in a day) Condition 2: The first 5 mint high of 4 hour candle(7:30 IST) should
Tražim iskusnog MQL5 developera koji će napraviti POTPUNO AUTOMATIZIRANOG Expert Advisora (EA) za MetaTrader 5, posebno dizajniranog za financirane / prop račune firmi. Glavni cilj je dugoročna stabilnost i zaštita kapitala, a ne agresivno ili visokorizično trgovanje. EA mora koristiti strategiju praćenja trenda s unosima temeljenim na povlačenjima u smjeru glavnog trenda. Trebao bi poslovati u H1 ili H4 vremenskom
Automated Trading BOT 50 - 75 USD
🔹 Project: Auto Execution Bot for XAUUSD 🔹 Platform: TradingView + Broker (MT5/Exness) 🔹 Script Language: TradingView Pine Script v5 + webhook/API integration 🔹 Strategy: Price action based entry/exit logic 🔹 Requirements: • Auto execute trades based on price action signals • Stop loss / Take profit logic • Session filters, risk management • Alerts with webhooks to broker bridge • Backtesting + live
BotC# 34+ USD
//+------------------------------------------------------------------+ //| Notification.mq5 | //| Copyright 2012, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2012, MetaQuotes Software Corp."
I want to buy EA which works in proper sl and target by taking 0.5% or 1% per risk per trade,, no grid, no martingle,, i want minimum 10% to 25% profit monthly,, i want it for investor accoubt handling purpose,, it may follow any stategy or indicator i dont matter,, but i want consisten and maximum draqdown it can have 40 to 50% no prblm but i want regular monthly 10 to 25% return,, 👉 I want you to provide me ex5
I’m a trader looking to build a non-repainting indicator . I recently came across an indicator on the MQL5 Market called King Binary , but I’m not sure whether it can be used for automation. When I checked its settings, there are no adjustable parameters—only alert notifications

项目信息

预算
30+ USD