You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
CorrectTF() function.
I wrote this function after discovering that sometimes I can easily specify an incorrect timeframe, which is equal to a whole number of minutes, in the input parameters of an indicator or an EA. For example, I entered 50 for hourly instead of 60. Well... kind of missed. It turns out that iRSI() function returns zero for an incorrect timeframe. I cannot say anything about other functions, because I did not check them. To avoid misunderstandings resulting from my own inattentive mistakes, I wrote this function as a primitive foolproof one. It adjusts the input parameter to the nearest appropriate timeframe and returns its value.
Function DateBeginQuarter().
This function returns the start date of the quarter by its number. For example, if it is now 27.08.2008, then the date of the beginning of the current quarter will be 01.07.2008. The function takes only one parameter - the quarter number relative to the current quarter. For example, 0 is the current quarter, 1 is the next quarter and -1 is the previous quarter. That is, positive quarter numbers will request dates from the future, while zero and negative will request dates from the past. The value returned is the number of seconds elapsed since 00:00 1 January 1970.
The DateOfMonday() function.
This function returns the start date of the week (Monday) by its number. For example, if it is now 29.08.2008, the date of the beginning of the current week will be 25.08.2008. The function takes only one parameter - the number of week relative to the current week. For example, 0 is the current week, 1 is the next week and -1 is the previous week. That is, positive week numbers will request dates from the future, while zero and negative numbers will request dates from the past. The return value is the number of seconds elapsed since 00:00 1 January 1970.
The function Fibonacci().
This function returns an element of the Fibonacci series by its sequence number.
GetNameMA() function.
This function returns the MA method name(Moving Averages) by its identifier. This function is convenient to use in comments, indicators and Expert Advisors messages.
GetPriceDiffInPoint() function.
This function returns the price difference between two bars, which are specified by their numbers. The purpose of developing this function was to determine the value and direction of the price movement. The GetPriceDiffInPoint() function determines the reference points (Open or High or Low or Close) of the bars to take into account. The function accepts the following optional parameters:
Returned value:
The GetTypePrice() function
Returns the name of the price type. The function takes only one optional parameter. Valid values: PRICE_CLOSE, PRICE_OPEN, PRICE_HIGH, PRICE_LOW, PRICE_MEDIAN, PRICE_TYPICAL, PRICE_WEIGHTED. The default value is 0 - PRICE_CLOSE.
The ArrayLR() function.
This function generates an array of linear regression values. The function accepts the following mandatory parameters:
ArrayMo() function.
Returns Modu - the maximum of the distribution density curve. The function accepts the following optional parameters:
Function ExistOrdersByPrice().
Returns a flag for the existence of an order at the given set price. True - order exists (set), False - order does not exist (not set). You can limit the list of orders to be checked using the function parameters:
The ClosePosBySelect() function for the tester.
Executes closing of a single preselected position. This is a simplified version of the function of the same name that was previously described on page 13. Nothing superfluous. No extra features. In my practice, I have never had a position that was not closed in the tester. That is why there are no checks in this function. They are unnecessary in the tester.
The CountOrders() function for the tester.
In my test versions (intended exclusively for use in the tester of MT4), function CountOrders() replaces the following functions: ExistOrders(), ExistPositions(), NumberOfOrders() and NumberOfPositions(). So, it can give information about the existence of any position or order and the amount of trades of each type. Such an exchange has its own advantages, which is expressed in a one-time reference to the orders base for one tick and obtaining all necessary information at once. And the above mentioned functions, especially when used together, each of them works with one and the same order base independently, so they repeatedly make the same calls. As a result, the CountOrders() function can reduce the time of one pass by several seconds, which allows to save hours of optimization.
Function CountOrders() takes the following parameters:
The ModifyOrder() function for the tester.
This is a light version of the ModifyOrder() function, published on page 7, and is intended for changing the absolute price levels of one pre-selected order or position.
The ModifyOrder() function accepts the following parameters:
The IIFc() function.
A very handy function in terms of constructing forks. If so, this colour. And if it is not, then another colour. Function IIFc() takes three mandatory parameters:
IIFd() function.
Similar convenience for real numbers. If so, it is a real number. If it is not, it is a different number. The IIFd() function takes three mandatory parameters:
The IIFi() function.
Similar convenience for integers. If so, it is an integer. And if it is not, then another number. The IIFi() function takes three mandatory parameters:
IIFis() function.
A similar convenience for strings. If so, such a string. And if not, then another string. The IIFs() function takes three mandatory parameters:
The ExistInHistoryCloseBetween() function.
Returns a flag for the existence in the history of a position or order closed (deleted) between dates. Function ExistInHistoryCloseBetween() accepts the following parameters:
Function ExistInHistoryOpenBetween().
Returns the flag of existence in the history of a position or order opened (set) between dates. Function ExistInHistoryOpenBetween() receives the following parameters:
Function ExistInHistoryToDay().
Returns the flag of existence in the history of a position or order opened (set) today. Function ExistInHistoryToDay() receives the following parameters:
TakeProfitLastPos() function.
This function returns the price level of TakeProfit of the last open position or -1. The TakeProfitLastPos() function accepts the following optional parameters: