How to get Highest Low from Last 10 Candle???

 

Dear Experts,

Could you help me to get the Highest Low of Last 10 candles!!

Actually I want to check Last 10 candles and get the Highest Low value of a candle within that 10 Candle!!


Thank you in advance for the Help

 
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
int candle=10;

int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
void OnDeinit(const int reason)
  {
  }
void OnStart()
  {
double c_candle[];
ArrayResize(c_candle,candle);

for(int i=0;i<candle;i++)
  {
   c_candle[i]=High[i];
  }

Print(" = "+c_candle[ArrayMinimum(c_candle,WHOLE_ARRAY,0)]);
  }
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
Dozens of new automated trading applications appear in the MQL5 Market every day. Choose the right app among 10,000 products and forget about unnecessary routine operations of manual trading. Sell your algorithmic trading programs through the largest store of trading applications! CreateGridOrdersTune A script for opening a grid of orders If...
 
Samuel Akinbowale:

Thank you so much Dear?

Can I request the same thing to be done in MT5?


With Best Regards!
 
//+------------------------------------------------------------------+
//|                              Highest Low from Last 10 Candle.mq5 |
//|                        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"
int candle=10;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
double c_candle[];
ArrayResize(c_candle,candle);

for(int i=0;i<candle;i++)
  {
//   c_candle[i]=High[i];
   c_candle[i]=iHigh(Symbol(),PERIOD_CURRENT,i);
Print("candle "+(i+1)+" :cC = "+c_candle[i]);
  }
int cC=ArrayMinimum(c_candle,0,WHOLE_ARRAY);
Print("candle "+(cC+1)+": is Highest Low from Last 10 Candle = "+(string)c_candle[cC]);
   
  }
//+------------------------------------------------------------------+
 
dbmlbm: Could you help me to get the Highest Low of Last 10 candles!!

Sorry @Samuel Akinbowale but that's not what you gave him (#1 or #3)

 
William Roeder:

Sorry @Samuel Akinbowale but that's not what you gave him (#1 or #3)

The lowest value among 10 values, ArrayMinimum should give this.

What do you think

 
William Roeder:

(#1 or #3)

1: mq4

3: mq5

 
Samuel Akinbowale:

The lowest value among 10 values, ArrayMinimum should give this.

What do you think

The OP is asking for the Highest Low, not the Lowest High.

 
//+------------------------------------------------------------------+
//|                              Highest Low from Last 10 Candle.mq5 |
//|                        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"
int candle=10;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
double c_candle[];
ArrayResize(c_candle,candle);

for(int i=0;i<candle;i++)
  {
   c_candle[i]=iLow(Symbol(),PERIOD_CURRENT,i);
//Print("candle "+(i+1)+" :cC = "+c_candle[i]);
  }
int cC=ArrayMaximum(c_candle,0,WHOLE_ARRAY);
Print("candle "+(cC+1)+": is Highest Low from Last 10 Candle = "+(string)c_candle[cC]);
   
  }
//+------------------------------------------------------------------+
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
Dozens of new automated trading applications appear in the MQL5 Market every day. Choose the right app among 10,000 products and forget about unnecessary routine operations of manual trading. Sell your algorithmic trading programs through the largest store of trading applications! CreateGridOrdersTune A script for opening a grid of orders If...
 
Samuel Akinbowale:

Thank you very very much!

It was very very helpful to me!


Thanks to other Commenters as well for their valuable feedback!

Reason: