Incorporate an array into fractals

MQL4 Indicators Consultation

Job finished

Execution time 31 minutes
Feedback from customer
Fantastic. Quick, efficient and even annotated the script so i could follow it more easily. 5 stars.
Feedback from employee
Great customer from the Great Britain.

Specification

I've been working on other things but over the past month been back and forward with this. 

I need to store fractals in an array to compare them. 

Recent fractal lower than last fractal and last fractal higher than third last fractal. Plot a buffer on the middle fractal.

The same for low fractals.

(image included).

So the dots are fractals that plot fine if a fractal has a higher/lower pair of fractals either side plot another buffer on it.

The fractal indicator i have works fine i just want to add this extra feature to make it clearer when trend changes direction.

So store last three fractal values and compare them. I don't want to use Ifractals as that limits me to only 2 bars either side of the fractal.

Code is below:

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 Yellow

//---- input parameters

//---- buffers
double ExtUpFractalsBuffer[];
double ExtDownFractalsBuffer[];
double TOP[];


double UP_ARRAY[3];
double DOWN_ARRAY[3];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicator buffers mapping  
    SetIndexBuffer(0,ExtUpFractalsBuffer);
    SetIndexBuffer(1,ExtDownFractalsBuffer); 
    SetIndexBuffer(2,TOP);
 
//---- drawing settings
    SetIndexStyle(0,DRAW_ARROW);
    SetIndexArrow(0,119);
    SetIndexStyle(1,DRAW_ARROW);
    SetIndexArrow(1,119);
    SetIndexStyle(2, DRAW_ARROW,0,4);
    SetIndexArrow(2,119);

//----
    SetIndexEmptyValue(0,0.0);
    SetIndexEmptyValue(1,0.0);
    SetIndexEmptyValue(2,0.0);

//---- name for DataWindow
    SetIndexLabel(0,"Fractal Up");
    SetIndexLabel(1,"Fractal Down");
    SetIndexLabel(2, "TOP");

    

//---- initialization done   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    i,nCountedBars;
   bool   bFound;
   double dCurrent;
   nCountedBars=IndicatorCounted();
//---- last counted bar will be recounted    
   if(nCountedBars<=2)
      i=Bars-nCountedBars-3;
   if(nCountedBars>2)
     {
      nCountedBars--;
      i=Bars-nCountedBars-1;
     }      
          
//----Up and Down Fractals
   while(i>=2)
     {
      //----Fractals up
      bFound=false;
      dCurrent=Close[i];
      
        if(dCurrent>Close[i+1] && dCurrent>Close[i-1])
        {
         bFound=true;
         ExtUpFractalsBuffer[i]=dCurrent;
         
         
         int TotalUp =3;
     for(int j=TotalUp-1;j>=0;j--)
     {
      if(ExtUpFractalsBuffer[i]!=0)
        {
         UP_ARRAY[j]=dCurrent;
         UP_ARRAY[j]=UP_ARRAY[j-1]; 
        }
     }
        if(UP_ARRAY[0]<UP_ARRAY[1] && UP_ARRAY[1]>UP_ARRAY[2])
        {
         TOP[i]=dCurrent;
         }
        }
      
                                         

      //----Fractals down
      bFound=false;
      dCurrent=Close[i];
      if(dCurrent<Close[i+1] && dCurrent<Close[i-1] )
        {
        bFound=true;
        ExtDownFractalsBuffer[i]=dCurrent;
        
        }                                   
      i--;
     }
     //----------------
    
     //----------------
     return(0);
     }

The yellow is the array and plotting buffer part I've had a shot at but no luck.

If you could make it run and perhaps a brief summary of these sections and how you got it to work so i can learn from it.

Thank you in advance.

Torexvir

Responded

1
Developer 1
Rating
(499)
Projects
749
63%
Arbitration
33
27% / 45%
Overdue
23
3%
Free
2
Developer 2
Rating
(460)
Projects
686
56%
Arbitration
43
30% / 33%
Overdue
110
16%
Working
3
Developer 3
Rating
(51)
Projects
66
30%
Arbitration
2
0% / 0%
Overdue
0
Free
Similar orders
NinjaTrader 8 indicator that plots open prices of higher time frame bars. Time frames to choose from in the properties: 15sec, 30sec, 1min, 5min, 15min, 30min, 1hr, 4hr, 1day, 1week, 1month, 1 year (or any time based periods if that would make the development easier). Ability to customize lines is needed (style, color, thickness, etc.). Also, ability to extend certain lines all the way to the right by clicking on
"Looking for a proficient developer to bring my custom NT8 strategy to life. Your expertise is pivotal for the project's success. Interested in joining forces for a fruitful collaboration? Let's delve into the specifics together. Appreciate it!"
"Seeking a skilled developer to code my custom NT8 strategy. Your expertise is crucial for this project's success. If interested, let's discuss further details and ensure a mutually beneficial collaboration. Thank you!"
I need to convert a trading view indicator to mt4. the code was copied from here: Find it here ABC Finder by Melodicfish tv search on goo gl. It is a ABC Pattern finding tool. You can adjust the "Bars Back" setting to include more or less bars in the pattern. I usually have it set to 10 or 15 these settings seem to work well on most assets. The scripts allows you to set up a trade box automatically and has a call out
Looking for a tradingview expert to quickly code a 8 lined description for me (alert based) Apply if you are a proven expert in tradingview and have time to deliver this project under 2_3 days. I'll provide the file to the expert
Hi, I need an Indicator for my EA based on the VWAP and Standard deviation bands. Best if you have it already ready / working. It can look like this: https://ninjatrader.com/futures/blogs/what-is-volume-weighted-average-price-vwap/ https://www.sr-analyst.com/page_studydetail.php?prod=TV0015 It would need to have 2 modes: 1- Anchored one (in between some given hours) - reseting each day. 2- Continous
The future of the traders be a good traders and patient and humble person faithful loyalty to your job and last be a professional traders and helping a dream of us how to trade and etc,,,,,,,,,,,,,,,,,🤑
Firstly Indicator (1) or the first part \\ Draw a red line at the top of the zero candle _ M1 \\ Draw a blue line at the bottom of the zero _ M1 candle \\ Draw a red line at the top of the zero _ M2 candle \\ Draw a blue line at the bottom of the zero _ M2 candle \\ Draw a red line at the top of the zero candle _ M3 \\ Draw a blue line at the bottom of the zero _ M3 candle \\ Draw a red line at the top of the zero
Description of the work to be done: Two tradingview scripts (3rd Wave and Zigzag) from the creator Lonesometheblue will need to be converted to a single EA for mt4. This EA must consist of the indicator that implements these two tradingview and also be capable of placing the orders that the indicator alerts you to. Description of the indicator: The mt4 indicator must have the same configurable parameters as that of
I am searching for an indicator that can effectively identify market structure components such as order blocks, which may or may not include a retest, and fair value gaps. This indicator should offer customizable options where I can specify the size of the order block and fair value gap in pips. Additionally, it should be able to highlight order blocks and fair value gaps that have been filled. I would also like the

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
to 4 day(s)