//+------------------------------------------------------------------+ //| 20 indicators data.mq5 | //| Copyright 2023, Omega Joctan | //| https://www.mql5.com/en/users/omegajoctan | //+------------------------------------------------------------------+ #property copyright "Copyright 2023, Omega Joctan" #property link "https://www.mql5.com/en/users/omegajoctan" #property version "1.00" //#property script_show_inputs //The script collects all (37) builtin indicator data at default indicator values and the current chart timeframe; #define INDICATORS 38 input uint buffer_size = 100; struct buffer_info //Carry all the buffer information and values { matrix values; string names; int GetNames(string names_str, string &NamesArr[]) { ushort sep = StringGetCharacter(",", 0); return StringSplit(names_str,sep,NamesArr); } }; struct buffers_struct:public buffer_info { buffer_info _CopyRates(long handle, string buff_names, int start, int count) //Copy all buffers given available buffers from an indicatpr { string names_arr[]; int total_buffers = GetNames(buff_names, names_arr); //Buffer names == total buffers | this function extracts the number of buffers buffer_info buffers; buffers.values.Resize(count, total_buffers); vector v(count); v.Fill(0.0); for (int i=0; i bool WriteCsv(string csv_name, matrix &matrix_, string header_string, bool common=false, int digits=5) { FileDelete(csv_name); int handle = FileOpen(csv_name,FILE_WRITE|FILE_CSV|FILE_ANSI|(common?FILE_COMMON:FILE_ANSI),",",CP_UTF8); if(handle == INVALID_HANDLE) { printf("Invalid %s handle Error %d ",csv_name,GetLastError()); return (false); } string concstring; vector row = {}; datetime time_start = GetTickCount(), current_time; string header[]; ushort u_sep; u_sep = StringGetCharacter(",",0); StringSplit(header_string,u_sep, header); vector colsinrows = matrix_.Row(0); if (ArraySize(header) != (int)colsinrows.Size()) { printf("headers=%d and columns=%d from the matrix vary is size ",ArraySize(header),colsinrows.Size()); return false; } //--- string header_str = ""; for (int i=0; i0) || (axis == 1 && mat1.Rows() != mat2.Rows() && mat1.Rows()>0)) { Print(__FUNCTION__, "Err | Dimensions mismatch for concatenation"); return m_out; } if (axis == 0) { m_out.Resize(mat1.Rows() + mat2.Rows(), MathMax(mat1.Cols(), mat2.Cols())); for (ulong row = 0; row < mat1.Rows(); row++) { for (ulong col = 0; col < m_out.Cols(); col++) { m_out[row][col] = mat1[row][col]; } } for (ulong row = 0; row < mat2.Rows(); row++) { for (ulong col = 0; col < m_out.Cols(); col++) { m_out[row + mat1.Rows()][col] = mat2[row][col]; } } } else if (axis == 1) { m_out.Resize(MathMax(mat1.Rows(), mat2.Rows()), mat1.Cols() + mat2.Cols()); for (ulong row = 0; row < m_out.Rows(); row++) { for (ulong col = 0; col < mat1.Cols(); col++) { m_out[row][col] = mat1[row][col]; } for (ulong col = 0; col < mat2.Cols(); col++) { m_out[row][col + mat1.Cols()] = mat2[row][col]; } } } return m_out; } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+