TradeMUX SDK Documentation  1.0
TradeMUX SDK Documentation
CSharpProgram Class Reference

Base class for Expert/Advisor, Script and indicator programs More...

Inherits IProgram.

Public Member Functions

int ArrayBsearch< T > (TMXArray< T > array, T value, int count=WHOLE_ARRAY, int start=0, int direction=MODE_ASCEND)
 Searches for a specified value in a one-dimension array More...
 
int ArrayCopy< T > (TMXArray< T > dest, TMXArray< T > source, int start_dest=0, int start_source=0, int count=WHOLE_ARRAY)
 Copies an array into another one More...
 
int ArrayCopyRates (TMXArray< double > dest_array, string symbol=null, int timeframe=0)
 Copies rates data to the array and returns the amount of bars copied More...
 
int ArrayCopyRates (out TMXRates[] rates_array, string symbol=null, int timeframe=0)
 Copies rates data to the array and returns the amount of bars copied More...
 
int ArrayCopySeries< T > (TMXArray< T > array, int series_index, string symbol=null, int timeframe=0)
 Copies a series array to another one and returns the count of the copied elements More...
 
int ArrayDimension< T > (TMXArray< T > array)
 Returns the multidimensional array rank More...
 
bool ArrayGetAsSeries< T > (TMXArray< T > array)
 Checks direction of an array index More...
 
int ArrayInitialize< T > (TMXArray< T > array, T value)
 initializes an array by a preset value More...
 
bool ArrayIsSeries< T > (TMXArray< T > array)
 Checks whether an array is a timeseries More...
 
int ArrayMaximum< T > (TMXArray< T > array, int count=WHOLE_ARRAY, int start=0)
 searches a maximal element in a one-dimension array More...
 
int ArrayMinimum< T > (TMXArray< T > array, int count=WHOLE_ARRAY, int start=0)
 searches a minimal element in a one-dimension array More...
 
int ArrayRange< T > (TMXArray< T > array, int range_index)
 Returns the number of elements in a selected array dimension More...
 
int ArrayResize< T > (TMXArray< T > array, int new_size, int reserve_size=0)
 sets a new size for the first dimension More...
 
bool ArraySetAsSeries< T > (TMXArray< T > array, bool set)
 Sets the AS_SERIES flag to a selected object of a dynamic array, and elements will be indexed like in timeseries More...
 
int ArraySize< T > (TMXArray< T > array)
 returns the number of elements of an array More...
 
int ArraySort< T > (TMXArray< T > array, int count=WHOLE_ARRAY, int start=0, int sort_dir=MODE_ASCEND)
 Sorts array by first dimension More...
 
int ArrayCompare< T > (T[] array1, T[] array2, int start1=0, int start2=0, int count=WHOLE_ARRAY)
 Retunrs result of comparing two arrays of the same type More...
 
void ArrayFill< T > (ref T[] array, int start, int count, T value)
 Fills an array with the specified value More...
 
void ArrayFree< T > (ref TMXArray< T > array)
 Frees up a buffer of any dynamic array and sets the size of the zero dimension to 0 More...
 
bool ArrayIsDynamic< T > (TMXArray< T > array)
 Checks whether an array is dynamic More...
 
string TerminalCompany ()
 Returns the name of company owning the client terminal. More...
 
string TerminalName ()
 Returns client terminal name More...
 
string TerminalPath ()
 Returns the directory, from which the client terminal was launched More...
 
string CharToStr (int char_code)
 Преобразование кода символа в односимвольную строку. More...
 
string DoubleToStr (double value, int digits)
 Converting numeric value into text string More...
 
double NormalizeDouble (double value, int digits)
 Rounding floating point number to a specified accuracy More...
 
double StrToDouble (string value)
 Converts string containing a symbol representation of number into number of double type More...
 
int StrToInteger (string value)
 Converts string containing a symbol representation of number into number of int (integer) type More...
 
DateTime StrToTime (string value)
 Converts a string containing time or date into DateTime type More...
 
string TimeToStr (DateTime value, int mode)
 Converting a value containing date/time into a string representation in "yyyy.mm.dd hh:mi" format More...
 
int Day ()
 Returns the current day of the month, i.e., the day of month of the last known server time More...
 
int DayOfWeek ()
 Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time More...
 
int DayOfYear ()
 Returns the current day of the year (1 means 1 January,..,365(6) does 31 December), i.e., the day of year of the last known server time More...
 
int Hour ()
 Returns the hour (0,1,2,..23) of the last known server time More...
 
int Minute ()
 Returns the current minute (0,1,2,..59) of the last known server time More...
 
int Month ()
 Returns the current month as number (1-January,2,3,4,5,6,7,8,9,10,11,12), i.e., the number of month of the last known server time More...
 
int Seconds ()
 Returns the amount of seconds elapsed from the beginning of the current minute of the last known server time More...
 
DateTime TimeCurrent ()
 Returns the last known server time, time of the last quote receipt for one of the symbols selected in the "Market Watch" window. In the OnTick() handler, this function returns the time of the received handled tick. In other cases (for example, call in handlers OnInit(), OnDeinit(), OnTimer() and so on) this is the time of the last quote receipt for any symbol available in the "Market Watch" window, the time shown in the title of this window. The time value is formed on a trade server and does not depend on the time settings on your computer. There are 2 variants of the function. More...
 
DateTime TimeCurrent (out TmxDateTime dt_struct)
 Returns the last known server time, time of the last quote receipt for one of the symbols selected in the "Market Watch" window. In the OnTick() handler, this function returns the time of the received handled tick. In other cases (for example, call in handlers OnInit(), OnDeinit(), OnTimer() and so on) this is the time of the last quote receipt for any symbol available in the "Market Watch" window, the time shown in the title of this window. The time value is formed on a trade server and does not depend on the time settings on your computer. There are 2 variants of the function. More...
 
int TimeDay (DateTime date)
 Returns the day of month (1 - 31) of the specified date More...
 
int TimeDayOfWeek (DateTime date)
 Returns the zero-based day of week (0 means Sunday,1,2,3,4,5,6) of the specified date More...
 
int TimeDayOfYear (DateTime date)
 Returns the day of year of the specified date More...
 
int TimeHour (DateTime time)
 Returns the hour of the specified time More...
 
DateTime TimeLocal ()
 Returns the local time of a computer, where the client terminal is running. More...
 
DateTime TimeLocal (out TmxDateTime dt_struct)
 Returns the local time of a computer, where the client terminal is running. More...
 
int TimeMinute (DateTime time)
 Returns the minute of the specified time More...
 
int TimeMonth (DateTime time)
 Returns the month number of the specified time (1..12) More...
 
int TimeSeconds (DateTime time)
 Returns the amount of seconds elapsed from the beginning of the minute of the specified time More...
 
int TimeYear (DateTime time)
 Returns year of the specified date More...
 
int Year ()
 Returns the current year, i.e., the year of the last known server time More...
 
DateTime StructToTime (ref TmxDateTime dt_struct)
 Converts a structure variable TmxDateTime into a value of datetime type More...
 
int TimeDaylightSavings ()
 Returns correction for daylight saving time in seconds, if the switch to summer time has been made. It depends on the time settings of your computer. More...
 
void TimeToStruct (DateTime dt, out TmxDateTime dt_struct)
 Converts a value of datetime type (number of seconds since 01.01.1970) into a structure variable TmxDateTime. More...
 
DateTime TimeGMT ()
 Returns the GMT, which is calculated taking into account the DST switch by the local time on the computer where the client terminal is running More...
 
DateTime TimeGMT (out TmxDateTime dt_struct)
 Returns the GMT, which is calculated taking into account the DST switch by the local time on the computer where the client terminal is running More...
 
int TimeGMTOffset ()
 Returns the current difference between GMT time and the local computer time in seconds, taking into account switch to winter or summer time. Depends on the time settings of your computer More...
 
bool EventSetTimer (int seconds)
 The function indicates to the client terminal, that for this script, events from the timer must be generated with the specified periodicity. More...
 
void EventKillTimer ()
 Specifies the client terminal that is necessary to stop the generation of events from Timer. More...
 
bool EventSetMillisecondTimer (int milliseconds)
 The function indicates to the client terminal that timer events should be generated at intervals less than one second for this Expert Advisor or indicator. More...
 
void FileClose (int handle)
 Closes the file previously opened by FileOpen() More...
 
bool FileDelete (string filename, int common_flag=0)
 Deletes the specified file More...
 
void FileFlush (int handle)
 Writes to a disk all data remaining in the input/output file buffer More...
 
bool FileIsEnding (int handle)
 Defines the end of a file in the process of reading More...
 
bool FileIsLineEnding (int handle)
 Defines the line end in a text file in the process of reading More...
 
int FileOpen (string filename, int open_flags, char delimiter= ';', uint codepage=CP_ACP)
 Opens the file with the specified name and flag More...
 
int FileOpenHistory (string filename, int mode, char delimiter= ';')
 Opens file in the current history directory More...
 
int FileReadArray< T > (int handle, TMXArray< T > array, int start, int count)
 Reads from a file of BIN type arrays of any type More...
 
double FileReadDouble (int handle, int size)
 Reads a double-precision floating point number (double) from the current position of the binary file More...
 
int FileReadInteger (int handle, int size)
 reads int, short or char value from the current position of the file pointer depending on the length specified in bytes More...
 
double FileReadNumber (int handle)
 The function reads from the CSV file a string from the current position till a separator (or till the end of a text string)
and converts the read string to a value of double type More...
 
string FileReadString (int handle, int length)
 Reads a string from the current position of a file pointer in a file More...
 
bool FileSeek (int handle, int offset, int origin)
 Moves the position of the file pointer by a specified number of bytes relative to the specified position More...
 
int FileSize (int handle)
 Returns the file size in bytes More...
 
int FileTell (int handle)
 Returns the current position of the file pointer of an open file More...
 
int FileWrite (int handle, params object[] args)
 Function is intended for writing of data into a CSV file, delimiter being inserted automatically unless it is equal to 0.
After writing into the file, the line end character "\r\n" will be added More...
 
int FileWriteArray< T > (int handle, TMXArray< T > array, int start, int count)
 Writes arrays of any type except for string to a BIN file More...
 
int FileWriteDouble (int handle, double value)
 Writes the value of a double parameter to a file, starting from the current position of the file pointer More...
 
int FileWriteInteger (int handle, int value, int size)
 Writes the value of the int parameter to a bin-file, starting from the current position of the file pointer More...
 
int FileWriteString (int handle, string value, int size)
 Writes the value of a string-type parameter into a BIN, CSV or TXT file starting from the current position of the file pointer.
When writing to a CSV or TXT file: if there is a symbol in the string '
' (LF) without previous character '' (CR),
then before '
' the missing '' is added. More...
 
bool FileCopy (string src_file_name, int common_flag, string dst_file_name, int mode_flags)
 Copies the original file to another file More...
 
bool FileMove (string src_file_name, int common_flag, string dst_file_name, int mode_flags)
 Moves/renames a file to another folder More...
 
long FileFindFirst (string file_filter, out string returned_filename, int common_flag=0)
 Starts the search of files or subdirectories in a directory in accordance with the specified filter More...
 
bool FileFindNext (long search_handle, out string returned_filename)
 Continues the search started by FileFindFirst() More...
 
void FileFindClose (long search_handle)
 Closes the search handle opened by FileFindFirst() function More...
 
long FileGetInteger (int file_handle, int property_id)
 Gets an integer property of a file More...
 
long FileGetInteger (string file_name, int property_id, bool common_folder=false)
 Gets an integer property of a file More...
 
bool FileIsExist (string file_name, int common_flag=0)
 Checks the existence of a file More...
 
bool FolderDelete (string folder_name, int common_flag=0)
 Removes the specified directory. If the folder is not empty, then it can't be removed More...
 
bool FolderCreate (string folder_name, int common_flag=0)
 Creates a folder More...
 
bool FolderClean (string folder_name, int common_flag=0)
 Deletes all files in a specified folder More...
 
float FileReadFloat (int file_handle)
 Reads the single-precision floating point number (float) from the current position of the binary file More...
 
float FileReadLong (int file_handle)
 Reads an integer of long type (8 bytes) from the current position of the binary file More...
 
uint FileReadStruct< T > (int file_handle, ref T struct_object, int size=-1)
 Reads contents into a structure passed as a parameter from a binary-file, starting with the current position of the file pointer More...
 
uint FileWriteFloat (int file_handle, float value)
 Writes the value of the float parameter to a bin-file, starting from the current position of the file pointer More...
 
uint FileWriteLong (int file_handle, long value)
 Writes the value of the long parameter to a bin-file, starting from the current position of the file pointer More...
 
uint FileWriteStruct< T > (int file_handle, T struct_object, int size=-1)
 Writes into a bin-file contents of a structure passed as a parameter, starting from the current position of the file pointer. More...
 
bool FileReadBool (int file_handle)
 Reads from the file of CSV type string from the current position to a delimiter (or till the end of the text line) and converts the read string to a bool type value More...
 
DateTime FileReadDatetime (int file_handle)
 Reads and parses from the file of CSV type a DateTime value More...
 
bool GlobalVariableCheck (string name)
 Checks the existence of a global variable with the specified name More...
 
bool GlobalVariableDel (string name)
 Deletes a global variable from the client terminal More...
 
double GlobalVariableGet (string name)
 Returns the value of the global variable More...
 
bool GlobalVariableGet (string name, out double double_var)
 Returns the value of the global variable More...
 
string GlobalVariableName (int index)
 Returns the name of a global variable by its ordinal number More...
 
DateTime GlobalVariableSet (string name, double value)
 Sets a new value for a global variable. If the variable does not exist, the system creates a new global variable More...
 
bool GlobalVariableSetOnCondition (string name, double value, double check_value)
 Sets the new value of the existing global variable if the current value equals to the third parameter check_value.
If there is no global variable, the function will generate an error ERR_GLOBALVARIABLE_NOT_FOUND (4501) and return false. More...
 
int GlobalVariablesDeleteAll (string prefix_name=null, DateTime limit_data=default(DateTime))
 Deletes global variables of the client terminal More...
 
int GlobalVariablesTotal ()
 Returns the total number of global variables of the client terminal More...
 
DateTime GlobalVariableTime (string name)
 Returns the time when the global variable was last accessed More...
 
bool GlobalVariableTemp (string name)
 The function attempts to create a temporary global variable. If the variable doesn't exist, the system creates a new temporary global variable More...
 
void GlobalVariablesFlush ()
 Forcibly saves contents of all global variables to a disk More...
 
double MathAbs (double value)
 Returns the absolute value (modulus) of the specified numeric value More...
 
double MathArccos (double x)
 Returns the arccosine of x within the range 0 to π in radians More...
 
double MathArcsin (double x)
 Returns the arc sine of x within the range of -π/2 to π/2 radians More...
 
double MathArctan (double x)
 Returns the arctangent of x. If x is equal to 0, the function returns 0 More...
 
double MathCeil (double x)
 Returns integer numeric value closest from above More...
 
double MathCos (double value)
 Returns the cosine of an angle More...
 
double MathExp (double value)
 Returns the value of e raised to the power of passed parameter value More...
 
double MathFloor (double x)
 Returns integer numeric value closest from below More...
 
double MathLog (double x)
 Returns a natural logarithm More...
 
double MathMax (double value1, double value2)
 Returns the maximal value of two value More...
 
double MathMin (double value1, double value2)
 Returns the minimal value of two values More...
 
double MathMod (double value, double value2)
 Returns the real remainder of division of two numbers More...
 
double MathPow (double base1, double exponent)
 Raises a base to a specified power More...
 
int MathRand ()
 Returns a pseudorandom integer within the range of 0 to 32767 More...
 
double MathRound (double value)
 Returns a value rounded off to the nearest integer of the specified numeric value More...
 
double MathSin (double value)
 Returns the sine of a specified angle More...
 
double MathSqrt (double x)
 Returns the square root of a number More...
 
void MathSrand (int seed)
 Sets the starting point for generating a series of pseudorandom integers More...
 
double MathTan (double x)
 Returns a tangent of a number More...
 
double acos (double x)
 Returns the arccosine of x within the range 0 to π in radians More...
 
double asin (double x)
 Returns the arcsine of x within the range of -π/2 to π/2 radians More...
 
double atan (double x)
 Returns the arctangent of x. If x is equal to 0, the function returns 0 More...
 
double ceil (double x)
 Returns integer numeric value closest from above More...
 
double cos (double x)
 Returns the cosine of an angle More...
 
double exp (double x)
 Returns the value of e raised to the power of passed parameter value More...
 
double fabs (double x)
 Returns the absolute value (modulus) of the specified numeric value More...
 
double floor (double x)
 Returns integer numeric value closest from below More...
 
double fmax (double value1, double value2)
 Returns the maximal value of two value More...
 
double fmin (double value1, double value2)
 Returns the minimal value of two values More...
 
double fmod (double value1, double value2)
 Returns the real remainder of division of two numbers More...
 
double log (double x)
 Returns a natural logarithm More...
 
double MathLog10 (double x)
 Returns the logarithm of a number by base 10 More...
 
double log10 (double x)
 Returns the logarithm of a number by base 10 More...
 
double pow (double base1, double exponent)
 Raises a base to a specified power More...
 
int rand ()
 Returns a pseudorandom integer within the range of 0 to 32767 More...
 
double round (double x)
 Returns a value rounded off to the nearest integer of the specified numeric value More...
 
double sin (double x)
 Returns the sine of a specified angle More...
 
double sqrt (double x)
 Returns the square root of a number More...
 
void srand (int seed)
 Sets the starting point for generating a series of pseudorandom integers More...
 
double tan (double x)
 Returns a tangent of a number More...
 
bool MathIsValidNumber (double number)
 Checks the correctness of a real number More...
 
double SignalBaseGetDouble (int property_id)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
int SignalBaseGetInteger (int property_id)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
int SignalBaseGetString (int property_id)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
bool SignalBaseSelect (int index)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
int SignalBaseTotal ()
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
double SignalInfoGetDouble (int property_id)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
int SignalInfoGetInteger (int property_id)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
int SignalInfoGetString (int property_id)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
bool SignalInfoSetDouble (int property_id, double value)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
bool SignalInfoSetInteger (int property_id, int value)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
bool SignalSubscribe (long signal_id)
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
bool SignalUnsubscribe ()
 Unsupported in current version. For compatibility purposes only. Do not use in new projects. More...
 
string StringConcatenate (params string[] str)
 Returns the string formed by concatenation of parameters transformed into string type More...
 
int StringFind (string text, string matched_text, int start_pos=0)
 Searches for a substring in a string More...
 
int StringGetChar (string text, int pos)
 Returns character from the specified position in the string More...
 
int StringLen (string text)
 Returns the number of symbols in a string More...
 
string StringSetChar (string text, int pos, int value)
 Returns the string copy with changed character in the specified position More...
 
string StringSubstr (string text, int start, int length)
 Extracts a substring from a text string starting from the specified position More...
 
string StringTrimLeft (string text)
 Cuts line feed characters, spaces and tabs in the left part of the string till the first meaningful symbol More...
 
string StringTrimRight (string text)
 Cuts line feed characters, spaces and tabs in the right part of the string after the last meaningful symbol More...
 
string CharArrayToString (char[] array, int start=0, int count=-1, uint codepage=CP_ACP)
 Copies and converts part of array of uchar type into a string More...
 
string CharToStr (char char_code)
 Converting a symbol into a one-character string More...
 
string CharToString (char char_code)
 Converting a symbol into a one-character string More...
 
string DoubleToString (double value, int digits=8)
 Converting numeric value into text string More...
 
double StringToDouble (string value)
 Converts string containing a symbol representation of number into number of double type More...
 
string IntegerToString (long number, int str_len=0, char fill_symbol= ' ')
 Converts value of integer type into a string of a specified length More...
 
long StringToInteger (string value)
 Converts string containing a symbol representation of number into number of int (integer) type More...
 
string ShortToString (ushort symbol_code)
 Converts the symbol code (unicode) into one-symbol string More...
 
int StringToCharArray (string text_string, ref char[] array, int start=0, int count=-1, uint codepage=CP_ACP)
 Symbol-wise copies a string converted from Unicode to ANSI, to a selected place of array of char type More...
 
string ShortArrayToString (ushort[] array, int start=0, int count=-1)
 Copies part of array of character codes into a string More...
 
int StringToShortArray (string text_string, ref ushort[] array, int start=0, int count=-1)
 Symbol-wise copy of a string into a specified place of an array of ushort type More...
 
string TimeToString (DateTime value, int mode=TIME_DATE|TIME_MINUTES)
 Converting a value containing date/time into a string representation in "yyyy.mm.dd hh:mi" format More...
 
DateTime StringToTime (string value)
 Converts a string containing time or date into DateTime type More...
 
string StringFormat (string Format, params object[] Parameters)
 Formats obtained parameters and returns a string More...
 
Color StringToColor (string color_string)
 Converts "R,G,B" string or string with color name into color type value More...
 
string ColorToString (Color color_value, bool color_name)
 Converts color value into string of "R,G,B" form More...
 
string EnumToString (object value)
 Converting an enumeration value of any type to a text form More...
 
int ColorToARGB (Color clr, byte alpha=255)
 Converts Color type into uint type to get ARGB representation of the color More...
 
bool StringAdd (ref string string_var, string add_substring)
 Adds a substring to the end of a given string More...
 
int StringBufferLen (string string_var)
 Returns the size of buffer allocated for the string More...
 
int StringCompare (string string1, string string2, bool case_sensitive=true)
 Compares two strings and returns the comparison result in form of an integer More...
 
bool StringFill (ref string string_var, char character)
 Fills out a selected string by specified symbols More...
 
char StringGetCharacter (string string_value, int pos)
 Returns value of a symbol, located in the specified position of a string More...
 
bool StringInit (out string string_var, int new_len=0, char character= '\0')
 Initializes a string by specified symbols and provides the specified string size More...
 
int StringReplace (ref string str, string find, string replacement)
 Replaces all the found substrings of a string by a set sequence of symbols More...
 
bool StringSetCharacter (ref string string_var, int pos, char character)
 Returns copy of a string with a changed character in a specified position More...
 
int StringSplit (string string_value, char separator, out string[] result)
 Gets substrings by a specified separator from the specified string, returns the number of substrings obtained More...
 
bool StringToLower (ref string string_var)
 Transforms all symbols of a selected string into lowercase More...
 
bool StringToUpper (ref string string_var)
 Transforms all symbols of a selected string into capitals More...
 
int Bars (string symbol_name, int timeframe)
 Returns the number of bars count in the history for a specified symbol and period More...
 
int Bars (string symbol_name, int timeframe, DateTime start_time, DateTime stop_time)
 Returns the number of bars count in the history for a specified symbol and period More...
 
int iBars (string symbol, int timeframe)
 Returns the number of bars on the specified chart More...
 
int iBarShift (string symbol, int timeframe, DateTime time, bool exact)
 Search for a bar by its time. The function returns the index of the bar which covers the specified time More...
 
double iClose (string symbol, int timeframe, int shift)
 Returns Close price value for the bar of specified symbol with timeframe and shift More...
 
double iHigh (string symbol, int timeframe, int shift)
 Returns High price value for the bar of specified symbol with timeframe and shift More...
 
int iHighest (string symbol, int timeframe, int type, int count=WHOLE_ARRAY, int start=0)
 Returns the shift of the maximum value over a specific number of bars depending on type More...
 
double iLow (string symbol, int timeframe, int shift)
 Returns Low price value for the bar of specified symbol with timeframe and shift More...
 
int iLowest (string symbol, int timeframe, int type, int count=WHOLE_ARRAY, int start=0)
 Returns the shift of the lowest value over a specific number of bars depending on type More...
 
double iOpen (string symbol, int timeframe, int shift)
 Returns Open price value for the bar of specified symbol with timeframe and shift More...
 
DateTime iTime (string symbol, int timeframe, int shift)
 Returns Time value for the bar of specified symbol with timeframe and shift More...
 
double iVolume (string symbol, int timeframe, int shift)
 Returns Tick Volume value for the bar of specified symbol with timeframe and shift More...
 
long SeriesInfoInteger (string symbol_name, int timeframe, int prop_id)
 Returns information about the state of historical data More...
 
bool SeriesInfoInteger (string symbol_name, int timeframe, int prop_id, out long long_var)
 Returns information about the state of historical data More...
 
int CopyOpen (string symbol_name, int timeframe, int start_pos, int count, out double[] open_array)
 Returns into open_array the history data of bar open prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyOpen (string symbol_name, int timeframe, DateTime start_time, int count, out double[] open_array)
 Returns into open_array the history data of bar open prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyOpen (string symbol_name, int timeframe, DateTime start_time, DateTime stop_time, out double[] open_array)
 Returns into open_array the history data of bar open prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyClose (string symbol_name, int timeframe, int start_pos, int count, out double[] close_array)
 Returns into close_array the history data of bar close prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyClose (string symbol_name, int timeframe, DateTime start_time, int count, out double[] close_array)
 Returns into close_array the history data of bar close prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyClose (string symbol_name, int timeframe, DateTime start_time, DateTime stop_time, out double[] close_array)
 Returns into close_array the history data of bar close prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyHigh (string symbol_name, int timeframe, int start_pos, int count, out double[] high_array)
 Returns into high_array the history data of highest bar prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyHigh (string symbol_name, int timeframe, DateTime start_time, int count, out double[] high_array)
 Returns into high_array the history data of highest bar prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyHigh (string symbol_name, int timeframe, DateTime start_time, DateTime stop_time, out double[] high_array)
 Returns into high_array the history data of highest bar prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyLow (string symbol_name, int timeframe, int start_pos, int count, out double[] low_array)
 Returns into low_array the history data of lowest bar prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyLow (string symbol_name, int timeframe, DateTime start_time, int count, out double[] low_array)
 Returns into low_array the history data of lowest bar prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyLow (string symbol_name, int timeframe, DateTime start_time, DateTime stop_time, out double[] low_array)
 Returns into low_array the history data of lowest bar prices for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyTickVolume (string symbol_name, int timeframe, int start_pos, int count, out long[] volume_array)
 Returns into volume_array the history data of tick volumes for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyTickVolume (string symbol_name, int timeframe, DateTime start_time, int count, out long[] volume_array)
 Returns into volume_array the history data of tick volumes for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyTickVolume (string symbol_name, int timeframe, DateTime start_time, DateTime stop_time, out long[] volume_array)
 Returns into volume_array the history data of tick volumes for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyTime (string symbol_name, int timeframe, int start_pos, int count, out DateTime[] time_array)
 Returns into time_array the history data of bar opening time for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyTime (string symbol_name, int timeframe, DateTime start_time, int count, out DateTime[] time_array)
 Returns into time_array the history data of bar opening time for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyTime (string symbol_name, int timeframe, DateTime start_time, DateTime stop_time, out DateTime[] time_array)
 Returns into time_array the history data of bar opening time for the selected symbol-period pair in the specified quantity.
It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar More...
 
int CopyRates (string symbol_name, int timeframe, int start_pos, int count, out TMXRates[] rates_array)
 Gets history data of TMXRates structure of a specified symbol-period in specified quantity into the rates_array array.
The elements ordering of the copied data is from present to the past, i.e., starting position of 0 means the current bar. More...
 
int CopyRates (string symbol_name, int timeframe, DateTime start_time, int count, out TMXRates[] rates_array)
 Gets history data of TMXRates structure of a specified symbol-period in specified quantity into the rates_array array.
The elements ordering of the copied data is from present to the past, i.e., starting position of 0 means the current bar. More...
 
int CopyRates (string symbol_name, int timeframe, DateTime start_time, DateTime stop_time, out TMXRates[] rates_array)
 Gets history data of TMXRates structure of a specified symbol-period in specified quantity into the rates_array array.
The elements ordering of the copied data is from present to the past, i.e., starting position of 0 means the current bar. More...
 
void IndicatorBuffers (int count)
 Allocates memory for buffers used for custom indicator calculations More...
 
int IndicatorCounted ()
 The function returns the amount of bars not changed after the indicator had been launched last More...
 
void IndicatorDigits (int digits)
 Sets precision format (the count of digits after decimal point) to visualize indicator values More...
 
void IndicatorShortName (string name)
 Sets the "short" name of a custom indicator to be shown in the DataWindow and in the chart subwindow More...
 
void SetIndexArrow (int index, int code)
 Sets an arrow symbol for indicators line of the DRAW_ARROW type More...
 
bool SetIndexBuffer (int index, ref TMXArray< double > array)
 binds a specified indicator buffer with one-dimensional dynamic array of the double type More...
 
bool SetIndexBuffer (int index, ref TMXArray< double > array, int data_type)
 binds a specified indicator buffer with one-dimensional dynamic array of the double type More...
 
void SetIndexDrawBegin (int index, int begin)
 Sets the bar number (from the data beginning) from which the drawing of the given indicator line must start More...
 
void SetIndexEmptyValue (int index, double value)
 Sets drawing line empty value More...
 
void SetIndexLabel (int index, string text)
 Sets drawing line description for showing in the DataWindow and in the tooltip More...
 
void SetIndexShift (int index, int shift)
 Sets offset for the drawing line More...
 
void SetIndexStyle (int index, int type, int style=EMPTY, int width=EMPTY, Color clr=default(Color))
 Sets the new type, style, width and color for a given indicator line More...
 
void SetLevelStyle (int draw_style, int line_width, Color clr)
 The function sets a new style, width and color of horizontal levels of indicator to be output in a separate window More...
 
void SetLevelValue (int level, double value)
 The function sets a value for a given horizontal level of the indicator to be output in a separate window More...
 
bool IndicatorSetString (int prop_id, int prop_modifier, string prop_value)
 The function sets the value of the corresponding indicator property. Indicator property must be of the string type More...
 
bool IndicatorSetString (int prop_id, string prop_value)
 The function sets the value of the corresponding indicator property. Indicator property must be of the string type More...
 
bool IndicatorSetDouble (int prop_id, int prop_modifier, double prop_value)
 Sets the value of the corresponding indicator property. Indicator property must be of the double type More...
 
bool IndicatorSetDouble (int prop_id, double prop_value)
 Sets the value of the corresponding indicator property. Indicator property must be of the double type More...
 
bool IndicatorSetInteger (int prop_id, int prop_modifier, int prop_value)
 Sets the value of the corresponding indicator property. Indicator property must be of the int type More...
 
bool IndicatorSetInteger (int prop_id, int prop_value)
 Sets the value of the corresponding indicator property. Indicator property must be of the int type More...
 
double AccountBalance ()
 Returns balance value of the current account More...
 
double AccountCredit ()
 Returns credit value of the current account More...
 
string AccountCompany ()
 Returns the brokerage company name where the current account was registered More...
 
string AccountCurrency ()
 Returns currency name of the current account More...
 
double AccountEquity ()
 Returns equity value of the current account. Equity calculation depends on trading server settings More...
 
double AccountFreeMargin ()
 Returns free margin value of the current account More...
 
double AccountFreeMarginCheck (string symbol, int cmd, double volume)
 Returns free margin that remains after the specified order has been opened at the current price on the current account More...
 
double AccountFreeMarginMode ()
 Returns the calculation mode of free margin allowed to open orders on the current account. More...
 
int AccountLeverage ()
 Returns leverage of the current account More...
 
double AccountMargin ()
 Returns margin value of the current account More...
 
string AccountName ()
 Returns the current account name More...
 
int AccountNumber ()
 Returns the current account number More...
 
double AccountProfit ()
 Returns profit value of the current account More...
 
string AccountServer ()
 Returns the connected server name More...
 
int AccountStopoutLevel ()
 Returns the value of the Stop Out level More...
 
int AccountStopoutMode ()
 Returns the calculation mode for the Stop Out level More...
 
double AccountInfoDouble (int property_id)
 Returns the value of the corresponding account property More...
 
long AccountInfoInteger (int property_id)
 Returns the value of the integer properties of the account More...
 
string AccountInfoString (int property_id)
 Returns the value of the corresponding account string property More...
 
void HideTestIndicators (bool hide)
 Sets a flag hiding indicators called by the Expert Advisor More...
 
int Period ()
 Returns the current chart timeframe More...
 
bool RefreshRates ()
 Refreshing of data in pre-defined variables and series arrays. More...
 
string Symbol ()
 Returns the name of a symbol of the current chart More...
 
int WindowBarsPerChart ()
 Returns the amount of bars visible on the chart More...
 
string WindowExpertName ()
 Returns the name of the executed Expert Advisor, script, custom indicator, or library More...
 
int WindowFind (string name)
 Returns the window index containing this specified indicator More...
 
int WindowFirstVisibleBar ()
 Returns index of the first visible bar in the current chart window More...
 
int WindowHandle (string symbol, int timeframe)
 Returns the system handle of the chart window More...
 
bool WindowIsVisible (int index)
 Returns the visibility flag of the chart subwindow More...
 
int WindowOnDropped ()
 Returns the window index where Expert Advisor, custom indicator or script was dropped More...
 
double WindowPriceMax (int index)
 Returns the maximal value of the vertical scale of the specified subwindow of the current chart More...
 
double WindowPriceMin (int index)
 Returns the minimal value of the vertical scale of the specified subwindow of the current chart More...
 
double WindowPriceOnDropped ()
 Returns the price of the chart point where Expert Advisor or script was dropped More...
 
void WindowRedraw ()
 Redraws the current chart forcedly More...
 
bool WindowScreenShot (string filename, int size_x, int size_y, int start_bar=-1, int chart_scale=-1, int chart_mode=-1)
 Saves current chart screen shot as a GIF file More...
 
DateTime WindowTimeOnDropped ()
 Returns the time of the chart point where Expert Advisor or script was dropped More...
 
int WindowsTotal ()
 Returns total number of indicator windows on the chart More...
 
int WindowXOnDropped ()
 Returns the value at X axis in pixels for the chart window client area point at which the Expert Advisor or script was dropped More...
 
int WindowYOnDropped ()
 Returns the value at Y axis in pixels for the chart window client area point at which the Expert Advisor or script was dropped More...
 
long ChartFirst ()
 Returns the ID of the first chart of the client terminal More...
 
long ChartID ()
 Returns the ID of the current chart More...
 
long ChartNext (long chart_id)
 Returns the chart ID of the chart next to the specified one More...
 
int ChartPeriod (long chart_id=0)
 Returns the timeframe period of specified chart More...
 
string ChartSymbol (long chart_id=0)
 Returns the symbol name for the specified chart More...
 
int ChartIndicatorsTotal (long chart_id, int sub_window)
 Returns the number of all indicators applied to the specified chart window More...
 
string ChartIndicatorName (long chart_id, int sub_window, int index)
 Returns the short name of the indicator by the number in the indicators list on the specified chart window More...
 
int ChartWindowFind (long chart_id, string indicator_shortname)
 searches in the indicated chart for the subwindow with the specified "short name" of the indicator (the short name
is displayed in the left top part of the subwindow), and it returns the subwindow number in case of success More...
 
int ChartWindowFind ()
 Must be called from a custom indicator. It returns the number of the subwindow where the indicator is working More...
 
bool ChartClose (long chart_id=0)
 Closes the specified chart More...
 
void ChartRedraw (long chart_id=0)
 Forciblly redraws specified chart More...
 
int ChartWindowOnDropped ()
 Returns the number (index) of the chart subwindow the Expert Advisor or script has been dropped to. 0 means the main chart window More...
 
int ChartXOnDropped ()
 Returns the X coordinate of the chart point the Expert Advisor or script has been dropped to More...
 
int ChartYOnDropped ()
 Returns the Y coordinateof the chart point the Expert Advisor or script has been dropped to More...
 
DateTime ChartTimeOnDropped ()
 Returns the time coordinate corresponding to the chart point the Expert Advisor or script has been dropped to More...
 
double ChartPriceOnDropped ()
 Returns the price coordinate corresponding to the chart point the Expert Advisor or script has been dropped to More...
 
bool ChartXYToTimePrice (long chart_id, int x, int y, out int sub_window, out DateTime time, out double price)
 Converts the X and Y coordinates on a chart to the time and price values More...
 
bool ChartTimePriceToXY (long chart_id, int sub_window, DateTime time, double price, out int x, out int y)
 Converts the coordinates of a chart from the time/price representation to the X and Y coordinates More...
 
bool ChartGetString (long chart_id, int prop_id, out string string_var)
 Returns the value of a corresponding property of the specified chart. Chart property must be of string type More...
 
string ChartGetString (long chart_id, int prop_id)
 Returns the value of a corresponding property of the specified chart. Chart property must be of string type More...
 
bool ChartSetString (long chart_id, int prop_id, string string_var)
 Sets a value of a corresponding property of the specified chart. Chart property must be of string type More...
 
long ChartOpen (string symbol, int period)
 Opens a new chart with the specified symbol and period More...
 
bool ChartNavigate (long chart_id, int position, int shift=0)
 Performs shift of the specified chart by the specified number of bars relative to the specified position in the chart More...
 
bool ChartIndicatorDelete (long chart_id, int sub_window, string indicator_shortname)
 Removes an indicator with a specified name from the specified chart window More...
 
bool ChartGetDouble (long chart_id, int prop_id, int sub_window, out double double_var)
 Returns the value of a corresponding property of the specified chart. Chart property must be of double type More...
 
double ChartGetDouble (long chart_id, int prop_id, int sub_window=0)
 Returns the value of a corresponding property of the specified chart. Chart property must be of double type More...
 
bool ChartSetDouble (long chart_id, int prop_id, double value)
 Sets the value of a corresponding property of the specified chart. Chart property must be of double type More...
 
bool ChartGetInteger (long chart_id, int prop_id, int sub_window, out long long_var)
 Returns the value of a corresponding property of the specified chart. Chart property must be of datetime, int or bool type. More...
 
long ChartGetInteger (long chart_id, int prop_id, int sub_window=0)
 Returns the value of a corresponding property of the specified chart. Chart property must be of datetime, int or bool type. More...
 
bool ChartSetInteger (long chart_id, int prop_id, int sub_window, long value)
 Sets the value of a corresponding property of the specified chart. Chart property must be of datetime, int or bool type. More...
 
bool ChartSetInteger (long chart_id, int prop_id, long value)
 Sets the value of a corresponding property of the specified chart. Chart property must be of datetime, int or bool type. More...
 
bool ChartSetSymbolPeriod (long chart_id, string symbol, int period)
 Changes the symbol and period of the specified chart More...
 
bool ChartApplyTemplate (long chart_id, string filename)
 For backward compatibility only. More...
 
bool ChartSaveTemplate (long chart_id, string filename)
 For backward compatibility only. More...
 
bool ChartScreenShot (long chart_id, string filename, int width, int height, int align_mode=CSharpProgram.ALIGN_RIGHT)
 Saves current chart screen shot as a file More...
 
bool EventChartCustom (long chart_id, ushort custom_event_id, long lparam, double dparam, string sparam)
 Generates a custom event for the specified chart More...
 
void Alert (params object[] args)
 Displays a message in a separate window. More...
 
void Comment (params object[] args)
 This function outputs a comment defined by a user in the top left corner of a chart. More...
 
int GetTickCount ()
 Returns the number of milliseconds that elapsed since the system start. More...
 
double MarketInfo (string symbol, int type)
 Returns various data about securities listed in the "Market Watch" window More...
 
int MessageBox (string text=null, string caption=null, int flags=EMPTY)
 Creates and shows a message box and manages it. A message box contains a message and header, any combination of predefined signs and command buttons. More...
 
bool PlaySound (string filename)
 Plays a sound file. More...
 
void Print (params object[] args)
 Prints a message in the Expert Advisor log. More...
 
bool SendFTP (string filename, string ftp_path)
 Sends a file at the address, specified in the setting window of the "Publication" tab. More...
 
bool SendMail (string subject, string some_text)
 Sends an email at the address specified in the settings window of the "Email" tab More...
 
void Sleep (int milliseconds)
 Suspends execution of the current Expert Advisor or script within a specified interval. More...
 
bool SendNotification (string message)
 Unsupportted. Only for backward compatibility. More...
 
void DebugBreak ()
 It is a program breakpoint in debugging. More...
 
void ExpertRemove ()
 The function stops an Expert Advisor and unloads it from a chart. More...
 
int PeriodSeconds (int period=PERIOD_CURRENT)
 Returns number of seconds in a period. More...
 
void PrintFormat (string format_string, params object[] Parameters)
 Format and print sets of symbols and values in the Expert Advisor log in accordance with a preset format. More...
 
void ResetLastError ()
 Sets the value of the predefined variable _LastError into zero. More...
 
bool TerminalClose (int ret_code)
 The function commands the terminal to complete operation. More...
 
void ZeroMemory< T > (ref T variable)
 The function resets a variable passed to it by reference. More...
 
int WebRequest (string method, string url, string cookie, string referer, int timeout, char[] data, int data_size, out char[] result, out string result_headers)
 Sends an HTTP request to a specified server. Requests are of type "key=value" using the header Content-Type: application/x-www-form-urlencoded More...
 
int WebRequest (string method, string url, string headers, int timeout, char[] data, out char[] result, out string result_headers)
 Sends an HTTP request to a specified server. Requests may be of any type specifying the custom set of headers for a more flexible interaction with various Web services More...
 
bool ResourceCreate (string resource_name, string path)
 Creates a resource based on a file More...
 
bool ResourceCreate (string resource_name, int[] data, uint img_width, uint img_height, uint data_xoffset, uint data_yoffset, uint data_width, int color_format)
 Creates a resource based on the array of pixels More...
 
bool ResourceFree (string resource_name)
 Deletes dynamically created resource (freeing the memory allocated for it). More...
 
bool ResourceReadImage (string resource_name, out int[] data, out uint width, out uint height)
 Reads data from the graphical resource created by ResourceCreate() function More...
 
bool ResourceSave (string resource_name, string file_name)
 Saves a resource into the specified file. More...
 
double TesterStatistics (int statistic_id)
 Unsupported. Do not use anyway. More...
 
int CryptEncode (int method, char[] data, char[] key, out char[] result)
 Transforms the data from array with the specified method. More...
 
int CryptDecode (int method, char[] data, char[] key, out char[] result)
 Performs the inverse transformation of the data from array, tranformed by CryptEncode(). More...
 
bool SymbolInfoDouble (string name, int prop_id, out double double_var)
 Returns the corresponding property of a specified symbol More...
 
double SymbolInfoDouble (string name, int prop_id)
 Returns the corresponding property of a specified symbol More...
 
bool SymbolInfoInteger (string name, int prop_id, out long long_var)
 Returns the corresponding long property of a specified symbol More...
 
long SymbolInfoInteger (string name, int prop_id)
 Returns the corresponding long property of a specified symbol More...
 
bool SymbolInfoString (string name, int prop_id, out string string_var)
 Returns the corresponding string property of a specified symbol More...
 
string SymbolInfoString (string name, int prop_id)
 Returns the corresponding string property of a specified symbol More...
 
int SymbolsTotal (bool selected)
 Returns the number of available (selected in Market Watch or all) symbols More...
 
bool SymbolSelect (string name, bool select)
 Selects a symbol in the Market Watch window or removes a symbol from the window More...
 
string SymbolName (int pos, bool selected)
 Returns the name of a symbol More...
 
bool SymbolInfoTick (string symbol, out TMXTick tick)
 The function returns current prices of a specified symbol in a variable of the TMXTick type More...
 
bool SymbolInfoSessionTrade (string name, int day_of_week, uint session_index, out DateTime from, out DateTime to)
 Allows receiving time of beginning and end of the specified trading sessions for a specified symbol and day of week More...
 
bool SymbolInfoSessionQuote (string name, int day_of_week, uint session_index, out DateTime from, out DateTime to)
 Allows receiving time of beginning and end of the specified quoting sessions for a specified symbol and day of week More...
 
unsafe int CheckPointer (IntPtr anyobject)
 The function returns the type of the object pointer. More...
 
unsafe IntPtr GetPointer (void *anyobject)
 The function returns the object pointer. More...
 
bool ObjectCreate (long chart_id, string name, int type, int sub_window, DateTime time1, double price1, DateTime time2, double price2, DateTime time3, double price3)
 Creates an object with the specified name, type, and the initial coordinates in the specified chart subwindow More...
 
bool ObjectDelete (string name)
 Removes the object with the specified name at the current chart More...
 
bool ObjectDelete (long chart_id, string name)
 Removes the object with the specified name at the specified chart More...
 
string ObjectDescription (string name)
 Returns the object description More...
 
int ObjectFind (string name)
 Searches for an object having the specified name More...
 
int ObjectFind (long chart_id, string name)
 Searches for an object having the specified name More...
 
double ObjectGet (string name, int prop_id)
 Returns the value of the specified object property More...
 
string ObjectGetFiboDescription (string name, int index)
 Returns the level description of a Fibonacci object More...
 
int ObjectGetShiftByValue (string name, double value)
 Calculates and returns bar index (shift related to the current bar) for the given price More...
 
double ObjectGetValueByShift (string name, int shift)
 Calculates and returns the price value for the specified bar (shift related to the current bar) More...
 
bool ObjectMove (string name, int point, DateTime time1, double price1)
 Changes coordinates of the specified anchor point of the object at the specified chart More...
 
bool ObjectMove (long chart_id, string name, int point, DateTime time1, double price1)
 Changes coordinates of the specified anchor point of the object at the specified chart More...
 
string ObjectName (int index)
 Returns the name of the corresponding object by its index in the objects list. More...
 
int ObjectsDeleteAll (long chart_id, string prefix, int window=EMPTY, int type=EMPTY)
 Removes all objects from the specified chart, specified chart subwindow, of the specified type More...
 
int ObjectsDeleteAll (long chart_id, int window=EMPTY, int type=EMPTY)
 Removes all objects from the specified chart, specified chart subwindow, of the specified type More...
 
int ObjectsDeleteAll (int window=EMPTY, int type=EMPTY)
 Removes all objects from specified chart subwindow, of the specified type More...
 
bool ObjectSet (string name, int prop_id, double value)
 Changes the value of the specified object property More...
 
bool ObjectSetFiboDescription (string name, int index, string text)
 Sets a new description to a level of a Fibonacci object. More...
 
bool ObjectSetText (string name, string text, int font_size, string font_name, Color text_color)
 Changes the object description More...
 
int ObjectsTotal (long chart_id, int sub_window=EMPTY, int type=EMPTY)
 Returns the number of objects of the specified type in the specified chart More...
 
int ObjectsTotal (int type=EMPTY)
 Returns the number of objects of the specified type in the current chart More...
 
int ObjectType (string name)
 Returns object type More...
 
bool ObjectGetString (long chart_id, string object_name, int prop_id, int prop_modifier, out string string_var)
 Returns the value of the corresponding object property. The object property must be of the string type More...
 
string ObjectGetString (long chart_id, string object_name, int prop_id, int prop_modifier=0)
 Returns the value of the corresponding object property. The object property must be of the string type More...
 
bool ObjectGetDouble (long chart_id, string object_name, int prop_id, int prop_modifier, out double double_var)
 Returns the value of the corresponding object property. The object property must be of the double type More...
 
double ObjectGetDouble (long chart_id, string object_name, int prop_id, int prop_modifier=0)
 Returns the value of the corresponding object property. The object property must be of the double type More...
 
  bool ObjectGetInteger (long chart_id, string object_name, int prop_id, int prop_modifier, out long long_var)
 Returns the value of the corresponding object property. The object property must be of the datetime, int, color, bool or char type More...
 
double ObjectGetInteger (long chart_id, string object_name, int prop_id, int prop_modifier=0)
 Returns the value of the corresponding object property. The object property must be of the datetime, int, color, bool or char type More...
 
bool ObjectSetString (long chart_id, string object_name, int prop_id, int prop_modifier, string string_var)
 Sets the value of the corresponding object property. The object property must be of the string type More...
 
bool ObjectSetString (long chart_id, string object_name, int prop_id, string string_var)
 Sets the value of the corresponding object property. The object property must be of the string type More...
 
bool ObjectSetDouble (long chart_id, string object_name, int prop_id, int prop_modifier, double double_var)
 Sets the value of the corresponding object property. The object property must be of the double type More...
 
bool ObjectSetDouble (long chart_id, string object_name, int prop_id, double double_var)
 Sets the value of the corresponding object property. The object property must be of the double type More...
 
bool ObjectSetInteger (long chart_id, string object_name, int prop_id, int prop_modifier, long long_var)
 Sets the value of the corresponding object property. The object property must be of the datetime, int, color, bool or char type More...
 
bool ObjectSetInteger (long chart_id, string object_name, int prop_id, long long_var)
 Sets the value of the corresponding object property. The object property must be of the datetime, int, color, bool or char type More...
 
DateTime ObjectGetTimeByValue (string object_name, double value, int line_id=0)
 Returns the time value for the specified price value of the specified object More...
 
double ObjectGetValueByTime (long chart_id, string object_name, DateTime time, int line_id=0)
 Returns the price value for the specified time value of the specified object More...
 
bool TextSetFont (string name, int size, uint flags=0, int orientation=0)
 Sets the font for displaying the text using drawing methods and returns the result of that operation More...
 
bool TextGetSize (string text, out uint width, out uint height)
 Returns the line width and height at the current font settings. More...
 
bool TextOut (string text, int x, int y, uint anchor, out uint[] data, uint width, uint height, uint color, int color_format)
 Draws a text in a custom array (buffer) and returns the result of that operation More...
 
int GetLastError ()
 Returns the contents of the system variable _LastError. More...
 
bool IsConnected ()
 Checks connection between client terminal and server More...
 
bool IsDemo ()
 Checks if the Expert Advisor/Script/Indicator runs on a demo account More...
 
bool IsDllsAllowed ()
 Checks if the DLL function call is allowed for the Expert Advisor More...
 
bool IsExpertEnabled ()
 Checks if Expert Advisors/Scripts are enabled for running. More...
 
bool IsLibrariesAllowed ()
 Checks if the Expert Advisor can call library function More...
 
bool IsOptimization ()
 Checks if Expert Advisor runs in the Strategy Tester optimization mode More...
 
bool IsStopped ()
 Checks the forced shutdown of Script/Expert Advisor/Indicator More...
 
bool IsTesting ()
 Checks if the Expert Advisor runs in the testing mode More...
 
bool IsTradeAllowed ()
 Checks if the Expert Advisor is allowed to trade and trading context is not busy More...
 
bool IsTradeAllowed (string symbol, DateTime tested_time)
 Checks trade status for the specified symbol in the specified time More...
 
bool IsTradeContextBusy ()
 Returns the information about trade context More...
 
bool IsVisualMode ()
 Checks if the Expert Advisor is tested in visual mode More...
 
int UninitializeReason ()
 Returns the code of a reason for deinitialization. More...
 
string TerminalInfoString (int property_id)
 Returns the value of a corresponding property of the program environment. The property must be of string type More...
 
int TerminalInfoInteger (int property_id)
 Returns the value of a corresponding property of the program environment More...
 
double TerminalInfoDouble (int property_id)
 Returns the value of a corresponding property of the program environment More...
 
void TMXSetInteger (int property_id, int property_value)
 Sets the value of the TMX_CODEPAGE property in a program environment More...
 
int TMXInfoInteger (int property_id)
 Returns the value of a corresponding property of a running program More...
 
string TMXInfoString (int property_id)
 Returns the value of a corresponding property of a running program More...
 
double iAC (string symbol, int timeframe, int shift)
 Calculates the Bill Williams' Accelerator/Decelerator oscillator and returns its value More...
 
double iAD (string symbol, int timeframe, int shift)
 Calculates the Accumulation/Distribution indicator and returns its value More...
 
double iAlligator (string symbol, int timeframe, int jaw_period, int jaw_shift, int teeth_period, int teeth_shift, int lips_period, int lips_shift, int ma_method, int applied_price, int mode, int shift)
 Calculates the Alligator indicator and returns its value More...
 
double iADX (string symbol, int timeframe, int period, int applied_price, int mode, int shift)
 Calculates the Average Directional Movement Index indicator and returns its value More...
 
double iATR (string symbol, int timeframe, int period, int shift)
 Calculates the Average True Range indicator and returns its value More...
 
double iAO (string symbol, int timeframe, int shift)
 Calculates the Awesome oscillator and returns its value More...
 
double iBearsPower (string symbol, int timeframe, int period, int applied_price, int shift)
 Calculates the Bears Power indicator and returns its value More...
 
double iBands (string symbol, int timeframe, int period, int deviation, int bands_shift, int applied_price, int mode, int shift)
 Calculates the Bollinger Bands® indicator and returns its value More...
 
double iBandsOnArray (TMXArray< double > array, int total, int period, int deviation, int bands_shift, int mode, int shift)
 Calculates the Bollinger Bands® indicator on data, stored in array, and returns its value More...
 
double iBullsPower (string symbol, int timeframe, int period, int applied_price, int shift)
 Calculates the Bulls Power indicator and returns its value More...
 
double iCCI (string symbol, int timeframe, int period, int applied_price, int shift)
 Calculates the Commodity Channel Index indicator and returns its value More...
 
double iCCIOnArray (TMXArray< double > array, int total, int period, int shift)
 Calculates the Commodity Channel Index indicator on data, stored in array, and returns its value More...
 
double iCustom (string symbol, int timeframe, string name, int mode, int shift, params object[] args)
 Calculates the specified custom indicator and returns its value More...
 
double iDeMarker (string symbol, int timeframe, int period, int shift)
 Calculates the DeMarker indicator and returns its value More...
 
double iEnvelopes (string symbol, int timeframe, int ma_period, int ma_method, int ma_shift, int applied_price, double deviation, int mode, int shift)
 Calculates the Envelopes indicator and returns its value More...
 
double iEnvelopesOnArray (TMXArray< double > array, int total, int ma_period, int ma_method, int ma_shift, double deviation, int mode, int shift)
 Calculates the Envelopes indicator on data, stored in array, and returns its value More...
 
double iForce (string symbol, int timeframe, int period, int ma_method, int applied_price, int shift)
 Calculates the Force Index indicator and returns its value More...
 
double iFractals (string symbol, int timeframe, int mode, int shift)
 Calculates the Fractals indicator and returns its value More...
 
double iGator (string symbol, int timeframe, int jaw_period, int jaw_shift, int teeth_period, int teeth_shift, int lips_period, int lips_shift, int ma_method, int applied_price, int mode, int shift)
 Calculates the Gator oscillator and returns its value More...
 
double iIchimoku (string symbol, int timeframe, int tenkan_sen, int kijun_sen, int senkou_span_b, int mode, int shift)
 Calculates the Ichimoku Kinko Hyo indicator and returns its value More...
 
double iBWMFI (string symbol, int timeframe, int shift)
 Calculates the Market Facilitation Index indicator and returns its value More...
 
double iMomentum (string symbol, int timeframe, int period, int applied_price, int shift)
 Calculates the Momentum indicator and returns its value More...
 
double iMomentumOnArray (TMXArray< double > array, int total, int period, int shift)
 Calculates the Momentum indicator on data, stored in array, and returns its value More...
 
double iMFI (string symbol, int timeframe, int period, int shift)
 Calculates the Money Flow Index indicator and returns its value More...
 
double iMA (string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)
 Calculates the Moving Average indicator and returns its value More...
 
double iMAOnArray (TMXArray< double > array, int total, int period, int ma_shift, int ma_method, int shift)
 Calculates the Moving Average indicator on data, stored in array, and returns its value More...
 
double iOsMA (string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int shift)
 Calculates the Moving Average of Oscillator indicator and returns its value More...
 
double iMACD (string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int mode, int shift)
 Calculates the Moving Averages Convergence/Divergence indicator and returns its value More...
 
double iOBV (string symbol, int timeframe, int applied_price, int shift)
 Calculates the On Balance Volume indicator and returns its value More...
 
double iSAR (string symbol, int timeframe, double step, double maximum, int shift)
 Calculates the Parabolic Stop and Reverse system indicator and returns its value More...
 
double iRSI (string symbol, int timeframe, int period, int applied_price, int shift)
 Calculates the Relative Strength Index indicator and returns its value More...
 
double iRSIOnArray (TMXArray< double > array, int total, int period, int shift)
 Calculates the Relative Strength Index indicator on data, stored in array, and returns its value More...
 
double iRVI (string symbol, int timeframe, int period, int mode, int shift)
 Calculates the Relative Vigor Index indicator and returns its value More...
 
double iStdDev (string symbol, int timeframe, int ma_period, int ma_shift, int ma_method, int applied_price, int shift)
 Calculates the Standard Deviation indicator and returns its value More...
 
double iStdDevOnArray (TMXArray< double > array, int total, int ma_period, int ma_shift, int ma_method, int shift)
 Calculates the Standard Deviation indicator on data, stored in array, and returns its value More...
 
double iStochastic (string symbol, int timeframe, int kPeriod, int dPeriod, int slowing, int method, int price_field, int mode, int shift)
 Calculates the Stochastic Oscillator and returns its value More...
 
double iWPR (string symbol, int timeframe, int period, int shift)
 Calculates the Larry Williams' Percent Range and returns its value More...
 
bool OrderClose (int ticket, double lots, double price, int slippage, Color color)
 Closes opened order More...
 
bool OrderCloseBy (int ticket, int opposite, Color color)
 Closes an opened order by another opposite opened order More...
 
double OrderClosePrice ()
 Returns close price of the currently selected order More...
 
DateTime OrderCloseTime ()
 Returns close time of the currently selected order More...
 
string OrderComment ()
 Returns comment of the currently selected order More...
 
double OrderCommission ()
 Returns calculated commission of the currently selected order More...
 
bool OrderDelete (int ticket, Color arrow_color)
 Deletes previously opened pending order More...
 
DateTime OrderExpiration ()
 Returns expiration date of the selected pending order More...
 
double OrderLots ()
 Returns amount of lots of the selected order More...
 
int OrderMagicNumber ()
 Returns an identifying (magic) number of the currently selected order More...
 
bool OrderModify (int ticket, double price, double stoploss, double takeprofit, DateTime expiration, Color arrow_color)
 Modification of characteristics of the previously opened or pending orders More...
 
double OrderOpenPrice ()
 Returns open price of the currently selected order More...
 
DateTime OrderOpenTime ()
 Returns open time of the currently selected order More...
 
void OrderPrint ()
 Prints information about the selected order in the log in the following format: #ticket number; open time; trade operation; amount of lots; symbol; open price; Stop Loss; Take Profit; close time; close price; commission; swap; profit; comment; magic number; pending order expiration date. More...
 
double OrderProfit ()
 Returns profit of the currently selected order More...
 
bool OrderSelect (int index, int select, int pool)
 The function selects an order for further processing More...
 
int OrderSend (string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=null, int magic=0, DateTime expiration=default(DateTime), int arrow_color=0)
 The main function used to open market or place a pending order More...
 
int OrdersHistoryTotal ()
 Returns the number of closed orders in the account history loaded into the terminal More...
 
double OrderStopLoss ()
 Returns stop loss value of the currently selected order More...
 
int OrdersTotal ()
 Returns the number of market and pending orders More...
 
double OrderSwap ()
 Returns swap value of the currently selected order More...
 
string OrderSymbol ()
 Returns symbol name of the currently selected order More...
 
double OrderTakeProfit ()
 Returns take profit value of the currently selected order More...
 
int OrderTicket ()
 Returns ticket number of the currently selected order More...
 
int OrderType ()
 Returns order operation type of the currently selected order More...
 

Properties

double Ask [get]
 The latest known seller's price (ask price) for the current symbol. The RefreshRates() function must be used to update More...
 
int _Bars [get, set]
 Number of bars in the current chart More...
 
double Bid [get]
 The latest known buyer's price (offer price, bid price) of the current symbol. The RefreshRates() function must be used to update More...
 
TMXArray< double > Close [get]
 Series array that contains close prices for each bar of the current chart More...
 
int Digits [get]
 Number of digits after decimal point for the current symbol prices More...
 
TMXArray< double > High [get]
 Series array that contains the highest prices of each bar of the current chart More...
 
TMXArray< double > Low [get]
 Series array that contains the lowest prices of each bar of the current chart More...
 
TMXArray< double > Open [get]
 Series array that contains open prices of each bar of the current chart More...
 
TMXArray< int > Time [get]
 Series array that contains open time of each bar of the current chart More...
 
TMXArray< double > Volume [get]
 Series array that contains tick volumes of each bar of the current chart More...
 
int _Digits [get]
 The _Digits variable stores number of digits after a decimal point, which defines the price accuracy of the symbol of the current chart More...
 
double _Point [get]
 The _Point variable contains the point size of the current symbol in the quote currency More...
 
double Point [get]
 The current symbol point value in the quote currency More...
 
int _LastError [get]
 Contains code of the last error, that occurred during the program run. Its value can be reset to zero by ResetLastError().
To obtain the code of the last error, you may also use the GetLastError() function More...
 
int _Period [get]
 The _Period variable contains the value of the timeframe of the current chart More...
 
bool _StopFlag [get]
 The _StopFlag variable contains the flag of the program stop. When the client terminal is trying to stop the program,
it sets the _StopFlag variable to true. To check the state of the _StopFlag you may also use the IsStopped() function. More...
 
string _Symbol [get]
 The _Symbol variable contains the symbol name of the current chart More...
 
int _UninitReason [get]
 The _UninitReason variable contains the code of the program uninitialization reason More...
 
int _RandomSeed [get]
 Variable for storing the current state when generating pseudo-random integers.
_RandomSeed changes its value when calling MathRand(). Use MathSrand() to set the required initial condition More...
 

Detailed Description

Base class for Expert/Advisor, Script and indicator programs