Errors, bugs, questions - page 56

 

I have Buf[0], Buf[1], and the function

Handle the initial position and number of required elements

intCopyBuffer(
intindicator_handle,// indicator handle
intbuffer_num,// indicator buffer number
intstart_pos,//where we start
intcount,// how many we copy
doublebuffer[]// array, where data will be copied to
);

CopyBuffer(M_Handl[In][AO_D],0,0,2,Buf);  // я копирую 0-й и 1-й бар по идее

But Buf doesn't contain 0th bar, it only has 1st and 2nd bar. Either there are ticks or not, but the last value of the indicator on the 0-th bar must be there, while its value is not even close to the value in Buf[1], but it is almost identical to the indicator value on bar 1.

 

Модератор
216

stringo 2010.07.19 15:59 2010.07.19 15:59:06

Keyword OnTimer.

Ok, I will think about it!
 
void OnDeinit(const int reason)
  {
//--   
   int LeftBar = ChartGetInteger(0,CHART_FIRST_VISIBLE_BAR);
   Print(LeftBar);  
  }

If reason is a timeframe change, LeftBar=0;

If reason is recompilation, then it's ok.

Should it be like this?

 

Tell me please.

Should the terminal retain its functionality for any errors in program code made by the trader?

For example division by zero, accessing non-existent array data, etc.

Function

bool  IndicatorRelease(
   int       indicator_handle,     // handle индикатора
   );

Deletes an indicator handle and releases the calculation part of the indicator, if it is not used anymore.

In the above example it is used in the void OnTick() body.

I decided to experiment with it in void OnDeinit.

In the help I haven't found information where to use it, although probably at deinitialization handles are automatically released and there's no need to use it there. But I still do not understand what a handle is.

So. The terminal crashes when deleting the Expert Advisor from the chart.

I am attaching the codes.

If you need it and it is a bug, I can do it via servicedesk.

Документация по MQL5: Доступ к таймсериям и индикаторам / IndicatorRelease
Документация по MQL5: Доступ к таймсериям и индикаторам / IndicatorRelease
  • www.mql5.com
Доступ к таймсериям и индикаторам / IndicatorRelease - Документация по MQL5
Files:
servis_2.mq5  1 kb
servis_3.mq5  2 kb
 

PS Thanks for the fixes in the 294 build, all the problems previously identified have been fixed.

Let's look for new ones )))

 
SHOOTER777:

PS Thanks for the fixes in the 294 build, all the problems previously identified have been fixed.

Let's look for new ones )))

Handle is a unique identifier (usually a number) which identifies a particular object (an instance of a class) for accessing it.

A handle can also identify certain types of data, with the exception of simple data (although there is a question here).


This term is the most widely used in the Windows API. It denotes the identifier of the resource allocated by the system. For example, if you open some file, you get the handle of the open file, if you load a DLL, you get the handle with which you can perform some actions with DLL. Similar objects exist in other operating systems API, for example in Linux. Handle itself (physically) is an index or pointer to system objects of OS. Handle acts as a system object identifier and is passed as an argument when API functions are called that perform actions on system object. There are also functions that create system objects, such as CreateFile in the Windows API or socket() in Linux. Such functions return a handle as a result of their work or a special value, stipulated in documentation, if the function call was not successfully executed by OS for some reason.

In terms of programming language (e.g., C), a handle is just a data type (usually an integer). Creating it is as trivial as creating any other object of an existing type. But a handle has meaning only in the context of processes running in the OS. In other words, a handle with value 123456 will be perceived as erroneous and its use in API functions will be useless.

 

To the developers

Please, pay attention to my request 18959 (I can not understand the logic of swaps, and do not get a sensible response). Please tell me if it is a mistake, temporary difficulties or I am a fool? I am especially interested in the question of swaps accrual at the championship...

Also pay attention to my request19046 - there is a problem with rounding of opening price for some trades (buying and trimming of position volume).

 

Errors, MetaTrader 5 MQL, Opened, Started: 2010.07.20 09:38, #19056

Please note.

 

Afternoon...

bugs?

* Moving around in the editor ctrl+TAB or going to terminal-return, compiling by F7... can't see the text cursor until I click on a tabbed file name with the mouse...

*cannot do RenameALL on alt+A... again have to use mouse... which isn't there... //lang eng

 
EQU:

Afternoon...

bugs?

* Moving around in the editor ctrl+TAB or going to terminal-return, compiling by F7... can't see the text cursor until I click on the file name in the tab...

* can't do RenameALL by alt+A... again I have to use the mouse... which isn't there... //lang eng


1. Not able to repeat. Moving by Ctrl+Tab, Ctrl+Shift+Tab works, but the input focus remains in the editor window. Maybe there are some peculiarities of playback?

2. what should Alt+A do? If moving by edit and replace, it's done by Shift+Tab, Tab.