My approach. The core is the engine. - page 93

 

In short, it was not possible to read the content of the resource on the normal graph.

Maybe I did something wrong...

First, we create an EA for the tester. In it, create an object and bind it to the file:

int OnInit()
  {
   //----------------------------------------------
   if(!ObjectCreate(0,"Resource",OBJ_BITMAP_LABEL,0,0,0))Print("Object is not created!");
   else Print("Object created!");
   //-------------------------------
   if(!ObjectSetString(0,"Resource",OBJPROP_BMPFILE,"::Resource"))Print("BMPFILE is not created!");
   else Print("BMPFILE created!");
   //----------------------------------------------
   return(INIT_SUCCEEDED);
  }

Then we write the following code in the OnTick() function:

void OnTick()
  {
   uchar Arr[];
   uint  Data[];
   //---------------------------
   string price = (string)Bid;
   //---------------------------
   int width = StringToCharArray(price,Arr);
   //---------------------------
   ArrayResize(Data,width);
   //---------------------------
   ArrayCopy(Arr,Data);
   //---------------------------
   if(!ResourceCreate("::Resource",Data,width,1,0,0,0,COLOR_FORMAT_XRGB_NOALPHA))Print("Resource is not created!");
   //---------------------------
  }


Then create an indicator with the timer function and write in it:

void OnTimer()
  {
//---
   uint Data[],width,height;
   //-----------------------------
   if(!ResourceReadImage("::Resource",Data,width,height))Print("Failed to read resource!");
   else Print("Resource is readable!");
   //-----------------------------
   
  }

Run the Expert Advisor in the Strategy Tester, and then the indicator on the regular chart.

И... reads nothing. Says it could not read the resource.

 

So, what's wrong?

the error -

ERR_RESOURCE_NOT_FOUND

 
fxsaber:

Got out of the discussion.

No offence taken. Nothing personal. It's just that the article doesn't help me understand anything. The solution is too complicated.

Please tell me why the reading of the resource created by the Expert Advisor in the Strategy Tester by the indicator on a common chart is not working?

Have I made a mistake in the code, or it just does not work?

 

In short, the question remains open. Who knows what it is - now would be a good time to criticise my decision.)

I will accept any criticism. You just need to understand whether my mistake, or not working visibility of the resource created in the tester.

Then it will become clear whether the resource can be a universal solution for transferring information between programs.

I think this information will be useful to all.

 

It's not clear again.

Installed indicator and EA on the same chart. The indicator still does not see the resource.

Placed reading the resource in the Expert Advisor itself, right after it fills. The resource is visible.

It turns out that the resource is visible only to the program in which it is defined.

Or, it is not visible only from the indicator.

I will now check whether the resource is visible to the Expert Advisor on the other chart.

 
Реter Konow:

...

Now I'm going to check if the EA sees the resource on the other chart.

No, doesn't see the resource either.

And where have all the gurus disappeared to....

Obviously, I'm making a mistake. But in what...

Or maybe it's not working at all?


ZS. By the way, why does fxsaber use the chart description string to send a message to another program if resources work as a perfect communication tool?

 
I will try to save the resource in a file after it has been created.
 
Реter Konow:
I'll try to keep the resource on file, once it's created.

Beautiful monologue)

 
Vitaly Muzichenko:

Beautiful monologue)

Do you know what this is about?

 
I've been thinking. There is a way to use the resources of other programmes. The solution is probably in there. I'll look in the documentation.