Wishes for MT5 - page 42

 
Lizar:
You need to highlight the block and press shift+tab
Thank you)
 

Add to the tutorial in the section

MQL5 Reference Guide / Technical Indicators / iMA specific example after the description:

applied_price

[in] Price to be applied. Can be any of the price constants ENUM_APPLIED_PRICE or handle of another indicator.

how to use a handle of another indicator? what will it do? or is it possible to average only the values of standard technical indicators? and if there is a need to draw a custom indicator in indicator_separate_window and draw a moving average of this indicator in the same window,iMA() can do it? I have a vague suspicion that iMA() can achieve iMAOnArray() result, but I have no idea how, maybe I'm wrong

ZS: Maybe I want much from MT5, but on MT4 the built-in function iMAOnArray() was not present now, it is not difficult to write a user function for calculation of an average, but I would like to have standard functions to work with arrays, I spent more time searching for information about iMAOnArray() than it took to write my own function

 
IgorM:

Add to the tutorial in the section

MQL5 Reference Guide / Technical Indicators / iMA specific example after description:

how to use the handle of another indicator? what will it do? or is it possible to average only the values of standard technical indicators? and if there is a need to draw a custom indicator in indicator_separate_window and draw a moving average for this indicator in the same window,iMA() can do it? I have a vague suspicion that iMA () can achieve iMAOnArray() but I have no idea how, maybe I am wrong


Click on the link and you get to the section Price constants where below there is an example:

If a technical indicator uses price data whose type is set by ENUM_APPLIED_PRICE enumeration, a handle of any indicator (built-in terminal or written by a user) can be specified as an input price series. In this case, values of the indicator zero buffer will be used for calculations. This allows you to easily build the values of one indicator upon the values of another one. Handle of a custom indicator is created by calling iCustom() function.

Example:

#propertyindicator_separate_window
#propertyindicator_buffers 2
#propertyindicator_plots 2
//--- input parameters
inputint RSIperiod=14;//period for RSI calculation
inputint Smooth=8;// RSI smoothing period
inputENUM_MA_METHOD meth=MODE_SMMA;//smoothing method
//---- plot RSI
#propertyindicator_label1"RSI"
#propertyindicator_type1DRAW_LINE
#propertyindicator_color1Red
#property indicator_style1STYLE_SOLID
#propertyindicator_width1 1
//---- plot RSI_Smoothed
#property indicator_label2"RSI_Smoothed"
#property indicator_type2DRAW_LINE
#property indicator_color2Navy
#property indicator_style2STYLE_SOLID
#property indicator_width2 1
//--- indicator buffers
double RSIBuffer[];//we will store RSI values here
double RSI_SmoothedBuffer[];// smoothed RSI values will be stored here
int RSIhandle;// RSI indicator handle
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
voidOnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,RSIBuffer,INDICATOR_DATA);
SetIndexBuffer(1,RSI_SmoothedBuffer,INDICATOR_DATA);
IndicatorSetString(INDICATOR_SHORTNAME,"iRSI");
IndicatorSetInteger(INDICATOR_DIGITS,2);
//---
RSIhandle=iRSI(NULL,0,RSIperiod,PRICE_CLOSE);
//---
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function|
//+------------------------------------------------------------------+
intOnCalculate(constint rates_total,
constint prev_calculated,
constint begin,
constdouble&price[]
)

{
//--- reset to zero the value of the last error
ResetLastError();
//--- get RSI indicator data into RSIBuffer[] array
int copied=CopyBuffer(RSIhandle,0,0,rates_total,RSIBuffer);
if(copied<=0)
{
Print("Failed to copy RSI indicator values. Error = ",
GetLastError(),", copied = ",copied);
return(0);
}
//--- create Average indicator by RSI indicator values
int RSI_MA_handle=iMA(NULL,0,Smooth,0,meth,RSIhandle);
copied=CopyBuffer(RSI_MA_handle,0,0,rates_total,RSI_SmoothedBuffer);
if(copied<=0)
{
Print("Failed to copy RSI smoothed indicator. Error = ",
GetLastError(),",copied =",copied);
return(0);
}
//--- return value of prev_calculated for next call
return(rates_total);
}


You just didn't finish one paragraph.

 

I use the standard trailing stop extensively. A couple of requests in this regard.

1) Add possibility to select "Trailing Stop Level" in Columns menu. This, as far as I understand, is not difficult.

2) Add TS value as a position property with possibility (by user's choice) to broadcast/not to broadcast TS level for a particular position to the terminal. I understand that it is much more serious than point 1), and the implementation of TS completely on the server side seriously increases the load on the server.

For which I personally would like to use point 2):

- several terminals are connected to the same account (ideally through different servers and providers, e.g. at home and at work);

- one of the terminals manually opens a position and sets the TS level;

- When TS level is set on another terminal, TS on the first terminal remains unchanged, because now the trailing stop is implemented on the client side. This is what I would like to change, if the client wishes.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций - Документация по MQL5
 
Rosh:

Click on the link and you will be taken to the Price constants section with an example below:


You just didn't finish one paragraph

There are indeed examples, but often you can't find them intuitively, maybe you could just make an "example" link in such cases - it would be very handy, IMHO of course.
 
Rosh:

Click on the link and you will get to Price constants section, where below there is an example:


You just did not read one paragraph

I finished the paragraph, but the example uses only standard technical indicators, the question is about custom indicators and iMAOnArray() function

-I want to see if you can use moving averages for smoothing data of the custom indicator

- I think it would be useful to have links to obsolete f-functions, you don't have to search through the forum.

MQL4 Reference - Obsolete Functions

 
xeon:
There are indeed examples, but often you can't intuitively find them, maybe you could just make an "example" link in such cases - it would be very handy, IMHO of course.
You're absolutely right, I think it would be very nice to have an "EXAMPLE" link in the top right corner of each page, so you don't have to search through the whole document
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Способы привязки объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Способы привязки объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Способы привязки объектов - Документация по MQL5
 
IgorM:

I have read the paragraph, but the example uses only standard technical indicators, the question is about custom indicators and iMAOnArray() function

-I want to see if moving averages can be used for smoothing data of custom indicators


I gave above :

If a technical indicator for its calculations uses price data whose type is defined by ENUM_APPLIED_PRICE enumeration, then any indicator handle (built-in to the terminal orwritten by a user) can be specified as an input price series.

Read also articles:

 

If the community is interested, a modification of the existing testing and optimisation option could be considered. For example, I need to get testing/optimization data not on one period of history, but on several periods at once (say, to evaluate the uniformity of an Expert Advisor's performance). Of course, we can take turns in testing/optimization for all periods. But if one period takes from 0.5 to 1 hour, and you need 10, it's much more convenient to run all 10 periods at once (for example, overnight) and get all the results later. I currently specify "Date From", "Date To" as an input parameter in the Expert Advisor and specify the total optimization period in the external tab of the tester (Dates From/To is one of the optimization parameters). But in this case the optimization time of each run is actually equal to the time of the general optimization period (in the tester's tab - ticks are always moving - I checked it virtually). If it were possible to specify 2 periods in the tester at once: a general large period and a small one inside it, the problem would be solved.

 

There is ChartIndicatorAdd() function to add indicator to chart. Please make the function of removing the indicator from the chart. It looks like with the nuclear bomb: the bomb is invented, but there is no anti-bomb.

Документация по MQL5: Операции с графиками / ChartIndicatorAdd
Документация по MQL5: Операции с графиками / ChartIndicatorAdd
  • www.mql5.com
Операции с графиками / ChartIndicatorAdd - Документация по MQL5
Reason: