first pullback from High first pullback from low on current bar point out with Dot

 

Its very difficult for me to explain it in English but I hope u guys can understand me:

example:

  1. candle0 open=1euro close=1euro low=1euro high=1euro 
  2. candle0 open=1euro close=2euro low=1euro high=2euro (price rises to 2 euro)
  3. candle0 open=1euro close=3euro low=1euro high=3euro (price rises to 3 euro)
  4. candle0 open=1euro close=5euro low=1euro high=5euro (price rises to 5 euro)
  5. candle0 open=1euro close=4euro low=1euro high=5euro (price falls from 5 euro to 4 euro)

i want to mark the point where the course stops getting new highs starts falling back example

course falls from high 5 euro to 4 euro I want a Dot sign exactly on 4 euro on the current candle

no further dots (I mean if price rises now to 9 euro and falls back to 8 euro no more dot)


//+------------------------------------------------------------------+
//|                                   sellHigherLow_buyLowerhigh.mq4 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 clrAqua
#property indicator_color2 clrMagenta
#property indicator_width1 2
#property indicator_width2 2

double pullbackLowest_Dot[];
double pullbackHighest_Dot[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   //pullbackLowest_Dot
   SetIndexBuffer(0,pullbackLowest_Dot);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,159);
   SetIndexLabel(0,"Sell Signal");
   //pullbackHighest_Dot
   SetIndexBuffer(1,pullbackHighest_Dot);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,159);
   SetIndexLabel(1,"Sell Signal");
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| 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[])
  {
//---
   //counting Bars
   int counted_bars, limit;
   counted_bars=IndicatorCounted();
   limit=Bars-counted_bars;
   
   //This is what i tried
   for(int i=0;i<limit;i++){
      if(Close[i]<High[i]){
         double pullbackHighest_DotPreis=Close[i]<High[i];
         pullbackHighest_Dot[i]=pullbackHighest_DotPreis;
      }else if(Close[i]>Low[i]){
         double pullbackLowest_DotPreis=Close[i]>Low[i];
         pullbackLowest_Dot[i]=pullbackLowest_DotPreis;
      }
   }
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
 
topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
 
Keith Watford:
topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
ok thx and sorry