Questions from a "dummy" - page 228

 
Rorschach:
you need to display one of the indicators as a background, is this possible?
Is there any other way of displaying them?
 
sergeev:
Are they displayed differently?
It's set up as either all background or all on top, but I couldn't find anything to make just 1.
 
yes, only all or there or thereabouts. they are not put individually. as this is a property of one chart, not one indicator.
 

Hello!

Please tell me what I'm doing wrong. The Expert in the attachment compiles successfully and runs for debugging. But it refuses to work in the tester.

int OnInit()
  {
int cl_ctx;
if((cl_ctx=CLContextCreate(CL_USE_ANY))==-1)
  {
    Print("OpenCL not found! Err: ", GetLastError());
    return(-1);
  }
Print("Ok!!!");
return(0);
  }

void OnTick() {}
Files:
Test_ROG.mq5  1 kb
 
MigVRN:

Hello!

Please tell me what I'm doing wrong. The Expert in the attachment compiles successfully and runs for debugging. But it refuses to work in the tester.

It will work only once at initialization.

The main code must be located in OnTick (in your case).

Right now it looks like something like a script, i.e. it renders the body of the code only when connected to a chart/beginning of a test.

 
lazarev-d-m:

You will have it worked out once during initialisation

The code is given as an example to show you exactly what does not work. Of course, it will not be used in this form. Why is it normally executed during debugging and not executed in the tester - that's the question!
 
MigVRN:
The code is cited as an example to show what exactly does not work. Of course, it will not be used in that form. Why does it work normally in debug and not in the tester? That's the question!

move the variable declaration beyond the OnInit function and assign a bool value - it worked for me both in the tester and in debugging

bool cl_ctx;
int OnInit()
  {

if((cl_ctx=CLContextCreate(CL_USE_ANY))==-1)
  {
    Print("OpenCL not found! Err: ", GetLastError());
    return(-1);
  }
Print("Ok!!!");
return(0);
  }

void OnTick() {}
 
MigVRN:

Hello!

Please tell me what I'm doing wrong. The Expert in the attachment compiles successfully and runs for debugging. But it refuses to work in the tester.

lazarev-d-m:

move the declaration of a variable beyond the OnInit function and assign a bool value - everything worked in my tester and in debugging at once

And when compiling, you don't get any questions, do you? ))
 
tol64:
And when compiling no questions arise? ))

It arises, but in practice the expression for some reason says it's OK

I don't care if it's OK, so why should I argue)))- although the question arises - why?

I think there's not enough else after if to check if everything is OK

 
lazarev-d-m:

It arises, but in practice the expression for some reason says - everything is OK

I don't care if it's OK, so why should I argue)))- although the question arises - why?

I think there's not enough else after if to check if everything is OK

)) I mean, why do we need to make the cl_ctx variable a bool type, if:

The return value

Handle to OpenCL context on successful creation, or -1 on error. Use GetLastError() to get the error information.