Monday, February 27, 2023

find last green and red candle in mt4

 //+------------------------------------------------------------------+

//                                 find-last-red-and-last-green-candle.mq4 |

//|                        Copyright 2022, MetaQuotes Software Corp. |

//|                                                           https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright 2022, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

#property strict

//+------------------------------------------------------------------+

//| Expert tick function                                             |

//+------------------------------------------------------------------+

void OnTick()

  {

int last_red_bar=-1;

double red_high=-1;

int last_green_bar=-1;

double green_high=-1;

for(int i=1;i<Bars-20;i++)

{

if(Close[i]<Open[i])

{

last_red_bar=i;

red_high=High[i];

break;

}

}

for(int g=1;g<Bars-20;g++)

{

if(Close[g]>Open[g])

{

last_green_bar=g;

green_high=High[g];

break;

}}

double redcandle =0;

for(int i=last_red_bar-1;i>=0 && last_red_bar>0;i--)

{

redcandle = Close[i]>Open[i];

if(High[i]>red_high)

{

if(i==0) Alert("Hihihhi",red_high);

break;

}

}

datetime last_Red_candle_time=0;

 while(true)

     {

      if(iOpen(Symbol(),0,last_red_bar)>iClose(Symbol(),0,last_red_bar))

        {

         last_Red_candle_time=iTime(Symbol(),0,last_red_bar);

         break;

        }}

 int      shift=iBarShift(Symbol(),0,last_Red_candle_time); 

 datetime newtime = iTime(Symbol(),0,shift);      

Comment("red high",red_high," green high ",green_high, " red candle ",last_Red_candle_time, " newtime ",newtime);

  }

//+------------------------------------------------------------------+


Wednesday, February 8, 2023

Two Candle Breakeout Strategy

 This startegy work on two candle pattern . In this strategy

Buy entry : 

last candle close > Second last close and  last candle low > Second last low and Ask > last candle high



Sell entry : 

last candle close < Second last close and  last candle high < Second last high and Bid < last candle low



take profit and stoploss set as per your wish.

MT4 EA Download for demo 

Price : USD 10 for singal account
Validity : lifetime
OS : Windows

NOTE : All fund are non refundable , Please before payment test demo EA on demo account . After satisfaction purchase real account EA 

We offering a free trial without any cost or commitment. You can test the EA before purchasing for free .

Just download the MT4 platform ( Windows Version ) from any broker and install. 

How to install EA on MT4:

Importent : Use EA at your own risk. Profit- loss your own responsibility.