Last_10_bars_table

Author: Peter Konow
Price Data Components
Series array that contains open prices of each barSeries array that contains close prices for each barSeries array that contains the highest prices of each barSeries array that contains the lowest prices of each barSeries array that contains tick volumes of each bar
0 Views
0 Downloads
0 Favorites
Last_10_bars_table
ÿþ//+------------------------------------------------------------------+

//|                                                   Last 10 bars   |

//|                                                      Peter Konow |

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

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

#property copyright "Peter Konow"

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

#property version   "1.00"

#property indicator_chart_window

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



//-----------------------------

//-----------------------------

//-----------------------------



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

//| 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[])

  {

//---

    /*

    //--------------------------------------------- 

    int q =  rates_total;

    static datetime currentBarTimeOpen = 0;

   //--------------------------------------------- 

   //#AB0=02;8205< ?0@0<5B@K =C;52>3> 10@0 2 =C;52>< @O4C B01;8FK =0 :064>< B8:5.

   //---------------------------------------------

   E_Last_10_bars_1_Open(Normalize_Double(open[q - 1], _Digits, _Point)); 

   E_Last_10_bars_1_Close(Normalize_Double(close[q - 1], _Digits, _Point));

   E_Last_10_bars_1_High(Normalize_Double(high[q - 1], _Digits, _Point));

   E_Last_10_bars_1_Low(Normalize_Double(low[q - 1], _Digits, _Point));

   E_Last_10_bars_1_Volume((string)tick_volume[q - 1]);

   E_Last_10_bars_1_Points((string)((int)((high[q - 1] - low[q - 1])/_Point)));

   //---------------------------------------------

   E_Last_10_bars_Current_price((string)SymbolInfoDouble(Symbol(),SYMBOL_BID)); 

   //---------------------------------------------

   //0 A>1KB88 =>2>3> 10@0 2K7K205< 2A5 OG59:8 B01;8FK >B ?5@2>3> @O40 8 =865

   //8 CAB0=02;8205< 8< =>2K5 7=0G5=8O.

   //---------------------------------------------

   if(currentBarTimeOpen!=time[q - 1]) 

     {

     currentBarTimeOpen = time[q - 1];

     //----------------------------

     E_Last_10_bars_2_Open(Normalize_Double(open[q - 2], _Digits, _Point));

     E_Last_10_bars_3_Open(Normalize_Double(open[q - 3], _Digits, _Point));

     E_Last_10_bars_4_Open(Normalize_Double(open[q - 4], _Digits, _Point));

     E_Last_10_bars_5_Open(Normalize_Double(open[q - 5], _Digits, _Point));

     E_Last_10_bars_6_Open(Normalize_Double(open[q - 6], _Digits, _Point));

     E_Last_10_bars_7_Open(Normalize_Double(open[q - 7], _Digits, _Point));

     E_Last_10_bars_8_Open(Normalize_Double(open[q - 8], _Digits, _Point));

     E_Last_10_bars_9_Open(Normalize_Double(open[q - 9], _Digits, _Point));

     E_Last_10_bars_10_Open(Normalize_Double(open[q - 10], _Digits, _Point));

     //----------------------------

     E_Last_10_bars_2_Close(Normalize_Double(close[q - 2], _Digits, _Point));

     E_Last_10_bars_3_Close(Normalize_Double(close[q - 3], _Digits, _Point));

     E_Last_10_bars_4_Close(Normalize_Double(close[q - 4], _Digits, _Point));

     E_Last_10_bars_5_Close(Normalize_Double(close[q - 5], _Digits, _Point));

     E_Last_10_bars_6_Close(Normalize_Double(close[q - 6], _Digits, _Point));

     E_Last_10_bars_7_Close(Normalize_Double(close[q - 7], _Digits, _Point));

     E_Last_10_bars_8_Close(Normalize_Double(close[q - 8], _Digits, _Point));

     E_Last_10_bars_9_Close(Normalize_Double(close[q - 9], _Digits, _Point));

     E_Last_10_bars_10_Close(Normalize_Double(close[q - 10], _Digits, _Point));

     //----------------------------

     E_Last_10_bars_2_High(Normalize_Double(high[q - 2], _Digits, _Point));

     E_Last_10_bars_3_High(Normalize_Double(high[q - 3], _Digits, _Point));

     E_Last_10_bars_4_High(Normalize_Double(high[q - 4], _Digits, _Point));

     E_Last_10_bars_5_High(Normalize_Double(high[q - 5], _Digits, _Point));

     E_Last_10_bars_6_High(Normalize_Double(high[q - 6], _Digits, _Point));

     E_Last_10_bars_7_High(Normalize_Double(high[q - 7], _Digits, _Point));

     E_Last_10_bars_8_High(Normalize_Double(high[q - 8], _Digits, _Point));

     E_Last_10_bars_9_High(Normalize_Double(high[q - 9], _Digits, _Point));

     E_Last_10_bars_10_High(Normalize_Double(high[q - 10], _Digits, _Point));

     //----------------------------

     E_Last_10_bars_2_Low(Normalize_Double(low[q - 2], _Digits, _Point));

     E_Last_10_bars_3_Low(Normalize_Double(low[q - 3], _Digits, _Point));

     E_Last_10_bars_4_Low(Normalize_Double(low[q - 4], _Digits, _Point));

     E_Last_10_bars_5_Low(Normalize_Double(low[q - 5], _Digits, _Point));

     E_Last_10_bars_6_Low(Normalize_Double(low[q - 6], _Digits, _Point));

     E_Last_10_bars_7_Low(Normalize_Double(low[q - 7], _Digits, _Point));

     E_Last_10_bars_8_Low(Normalize_Double(low[q - 8], _Digits, _Point));

     E_Last_10_bars_9_Low(Normalize_Double(low[q - 9], _Digits, _Point));

     E_Last_10_bars_10_Low(Normalize_Double(low[q - 10], _Digits, _Point));

     //-----------------------------

     E_Last_10_bars_2_Volume((string)tick_volume[q - 2]);

     E_Last_10_bars_3_Volume((string)tick_volume[q - 3]);

     E_Last_10_bars_4_Volume((string)tick_volume[q - 4]);

     E_Last_10_bars_5_Volume((string)tick_volume[q - 5]);

     E_Last_10_bars_6_Volume((string)tick_volume[q - 6]);

     E_Last_10_bars_7_Volume((string)tick_volume[q - 7]);

     E_Last_10_bars_8_Volume((string)tick_volume[q - 8]);

     E_Last_10_bars_9_Volume((string)tick_volume[q - 9]);

     E_Last_10_bars_10_Volume((string)tick_volume[q - 10]); 

     //----------------------------

     E_Last_10_bars_2_Points((string)((int)((high[q - 2] - low[q - 2])/_Point)));

     E_Last_10_bars_3_Points((string)((int)((high[q - 3] - low[q - 3])/_Point)));

     E_Last_10_bars_4_Points((string)((int)((high[q - 4] - low[q - 4])/_Point)));

     E_Last_10_bars_5_Points((string)((int)((high[q - 5] - low[q - 5])/_Point)));

     E_Last_10_bars_6_Points((string)((int)((high[q - 6] - low[q - 6])/_Point)));

     E_Last_10_bars_7_Points((string)((int)((high[q - 7]- low[q - 7])/_Point)));

     E_Last_10_bars_8_Points((string)((int)((high[q - 8] - low[q - 8])/_Point)));

     E_Last_10_bars_9_Points((string)((int)((high[q - 9] - low[q - 9])/_Point)));

     E_Last_10_bars_10_Points((string)((int)((high[q - 10] - low[q - 10])/_Point)));

     //----------------------------

 } 

 //--K7K205< ?5@5@8A>2:C B01;8FK. 

 RMSG(1); 

 */ 

//------------------------------

 return(rates_total);

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

}

//===================================================================================================================================================



//===================================================================================================================================================



//===================================================================================================================================================



//===================================================================================================================================================

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---