Participe de nossa página de fãs
Coloque um link para ele, e permita que outras pessoas também o avaliem
Avalie seu funcionamento no terminal MetaTrader 5
- Visualizações:
- 9399
- Avaliação:
- Publicado:
- 2016.10.27 13:41
-
Precisa de um robô ou indicador baseado nesse código? Solicite-o no Freelance Ir para Freelance
This small cross-platform library allows to compare the 'double' values of the "price" conveniently and quickly.
For example, before placing a SellLimit, it is sometimes useful to check if the opening price is below the current Bid price.
// if (NormalizeDouble(OpenPrice, Digits()) >= NormalizeDouble(Bid, Digits())) // this method was the most frequently used if (CP(OpenPrice) >= Bid) // now it can be done like this OrderSend...;
Not only is this much clearer and more concise than the standard type check, but also the execution speed is several times higher! Such efficient usage of computational resources sometimes grants a noticeable boost in the tester/optimizer.
It is also possible to set the precision for comparing the 'double' values. For example
if ((CP(Lots, 0.01) >= MinLot) && ((CP(Lots, 0.01) <= MaxLot))) // compare with the precision up to the second decimal place OrderSend...;
All the comparison operators (==, !=, >=, <=, >, <) are handled in a similar fashion.
The library contains a faster method of the NormalizeDouble implementation. To improve the execution speed of the standard function, it is sufficient to add the following at the beginning
// Almost four times faster than the corresponding standard function (build 1395) #define NormalizeDouble PRICE_COMPARE::MyNormalizeDouble
As an example, the attached script shows the results of comparison and normalization method for different price values.
Traduzido do russo pela MetaQuotes Ltd.
Publicação original: https://www.mql5.com/ru/code/16177
![Indicator for monitoring the lot and profit](https://c.mql5.com/i/code/indicator.png)
The indicator displays the total lot and profit for the current instrument.
![VATicks](https://c.mql5.com/i/code/library.png)
Class for working with ticks in the MetaTrader 4. It is suitable for creating experts that make decisions on trading based on the analysis of tick data.
![Sigma Bands](https://c.mql5.com/i/code/indicator.png)
Advanced Bollinger Bands indicator.
![Multi Timeframe Moving Average](https://c.mql5.com/i/code/indicator.png)
The indicator displays the moving average for the selected timeframe.