[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 230

 

Good day!

My question is very simple: when accessing the indicator buffer as an array (so that the first element has index 0), should ArraySetAsSeries be calledat each iteration - or is one call of this function sufficient, for example, in init()?

 
betmen >> :

I am using the following code for this:


bool Fun_New_bar()
/*
function is designed to detect if there is a new bar,
otherwise it returns "false".
===========
Variables:
===========
Test_Time - Test time
*/
{
static datetime Test_Time=0;
if(Test_Time!=Time[0])
{
Test_Time=Time[0];
return(true);
}
return(false);
}


For my question please help who knows or tell me if it's not possible... I've been looking for an answer for 3 days and so far no luck. :-(




Thank you very much. It helped.
 
betmen >> :

You offer to start an exe compiled from another IDE during initialization, as an alternative, it is really possible to run an exe file during initialization, but then there is another problem - how to pass data from the program in variables of the indicator itself?

i.e. how to transfer combobox1.text value converted to a number to MA_Method?

It's not aesthetically pleasing via file, and MetaTrader and "test.exe" created by me do not have common memory space.

No. I would not suggest that :-). This is rather complicated. I was talking about Dll, I described it in more or less detail.

The strings are passed. I'm just giving you a warning. Numbers are passed without any problems at all.

In metatrader it is imported like this: get(int & to[]), in C it is explained by get(int * to). Find an example.

 
xp3rienced >> :

Good day!

My question is very simple: when accessing the indicator buffer as an array (so that the first element has the index 0), should ArraySetAsSeries be calledat each iteration - or is one call of this function, for example, in init() sufficient?

Just put the data in there. If it is already an indicator buffer (SetIndexBuffer) - you don't need to do anything.

Why did the question arise? :-)

 
jartmailru >> :

Just enter the data there. If it is already an indicator buffer (SetIndexBuffer)- you don't need to do anything.

Why did the question arise? :-)


I just do it. Yes, the array is an indicator buffer. And I need it to be treated as an array, when the first element has a zero index. Or you want to say (by "do nothing"), that such addressing, for index buffers, is the default?

The question came up because I need to fill the buffer from "past" to "future", and I don't know if the array addressing mode is reset, and if it is, under what circumstances. That's all)

 
xp3rienced >> :

Or are you saying (by "don't do anything") that this addressing, for index buffers, is the default? o_O

Yep. You'll be fine.

 
jartmailru >> :

>> Yeah. It's gonna be all right.


>> Thank you very much!
 
jartmailru >> :

Nah. I'm not suggesting :-). It's complicated enough. I was talking about Dll, I wrote it more or less in details.

Strings are passed. I'm just giving you a warning. The numbers are passed without any problems.

Metatrader imports them in this way: get(int & to[]), while C explains get(int * to). Find an example.

Thanks, we'll keep digging...

 
There is also a question. The indicator may have more bars than on the current chart, and in this situation: there are new values in the index array, but the bars do not appear on the indicator. How to fix it? Without complete recalculation and index array resizing, preferably :)
 
Colleagues, what can error 130 mean when trying to set a delay? I have to check the min-distance before I place the pendulum! I understand that you are not all psychics, let's assume I keep the min-distance 100%, in this case what else could be the cause of the error 130?