Errors, bugs, questions - page 3126
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
You form a data structure or an array of structures in an EA or in an indicator and send it to a resource.
Kanvas itself works with a graphical resource (OBJ_BITMAP_LABEL/ OBJ_BITMAP). So all that's left to do is to communicate the name of the resource to another application and it will easily access the pixels. It will also need to pass the pixel format. And you can read the pixels or change them with another CCanvas. It has a method, CCanvas::Attach, to attach it to an existing resource.
What's the problem, Andrei?
Forming a data structure or an array of structures
No problems at all! It's just the extra work, that's what I'm talking about.
Any buffered indicator can be read by any other indicator or Expert Advisor.
For example, I have an EA that gets a list of running indicators and then creates them on a specified list of instruments/TF and then collects signals from them (and sends them to telegram). So any buffer indicator can simply be run on a chart and it will be picked up automatically. But kanvas indicator will have to be connected manually and then the rest of the work should be done manually.
We need to unify the work with kanvas indicators. I am afraid that this unification will result in ... buffer indicators))
What's the problem, Andrei?
I didn't find one and didn't even look for one
There's no problem! It's just unnecessary gestures, that's what I'm talking about.
Any buffer indicator can be read by any other indicator or EA, and a kanvas needs a kastum layer.
For example, I have an EA that gets a list of running indicators and then creates them on a specified list of instruments/TF and then collects signals from them (and sends them to telegram). So any buffer indicator can simply be run on a chart and it will be picked up automatically. But kanvas indicator will have to be connected manually and then the rest of the work should be done manually.
We need to unify the work with kanvas indicators. I am afraid that this unification will result in ... buffer indicators)).
Kanvas itself works with a graphical resource (OBJ_BITMAP_LABEL/ OBJ_BITMAP). So it remains to communicate the name of the resource to another application and it will easily access the pixels. It will also need to pass the pixel format. And you can read the pixels or change them with another CCanvas. It has a method called CCanvas::Attach to attach it to an existing resource.
I couldn't find it and I wasn't even looking.
I wonder in what cases if an indicator is running and its window doesn't exist? And when the window is inactive (the user has switched to another chart or minimized it), what resource is unloaded from memory, is it simply deleted?
I think I agree with you there. I had to create a multitasking robot. The first application instance creates tasks and creates charts for them, then applies a special template with the same robot. Then the first robot creates the tasks and the robots created by the automaton execute them. The data transfer is done through resources. The strings of numbers and structures are transferred there. There is an example of data transfer via http here on the website (if memory serves me correctly). But the data about structures, their sizes and types go there first, and then the data itself. I have decided to make it easier in my Expert Advisor by passing the strings and numbers through an array of uchar-types in the form of strings that greatly simplifies the process of reading/writing. But I've never written bytes to indicator buffers and read them from there. But I already see one disadvantage of this method - the limited number of indicator bars. Although, there are 8 bytes in each cell of the array. Maybe it's not such a great disadvantage. Who knows...
I wonder in what cases if an indicator is running but its window does not exist?
I meant using iCustom
And when the window is inactive (the user has switched to another chart or minimized it), what resource is unloaded from memory, is it simply deleted?
this was just my assumption, as there is no special point in forming images when the window is minimised. How it's implemented in MT - didn't check, but came across something similar. I've forgotten all the nuances.
Anyway it's unlikely that the resource is deleted, but it's not updated with time either. I.e. CCanvas::Update does not work
I meant using iCustom
It turns out, you can pass values through the resource and buffers, but not through Kanvas resource. It's an interesting task, to call an indicator with output to Kanvas usingiCustom. I have not tried it. It seems to me that in this case there may be errors. Maybe, such an indicator loaded through iCustom won't work at all?
I think ResourceCreate is working, but the result isn't rendered using ChartRedraw. Appeals to the function go, but the system understands that the chart doesn't need to be updated while it's inactive. But ifResourceCreate doesn't work,imagine that the indicator has updated data at a random tick when the chart is inactive, but Kanvas' resource has not been updated. And then the user has decided to activate this inactive chart and look at the indicator (Kanwa). And it turns out that there was a tick, but the Canva remains the same as it was before the user changed the chart. And what if during the period of inactivity there were a lot of ticks? Of course, the indicator would process them, but none of the results would be shown on the canvas.
I think ResourceCreate works, but the result is not displayed with ChartRedraw.
Yes, you're probably right. This is likely to be the case.
And to save resources, it would be right to monitor window activity and not generate a bitmap if the window is not active.
It's worth checking rather than making assumptions.