Buttons & Textfields on mt4 chart possible now - page 2

 
nice
 

Ghost, we have 0.3 which is working now. I am unsure about 0.2 but 0.3 for sure supports text and bgcolors on CHECKBOX and BUTTONS (rest not implemented yet).

To get Status of checkbox we will define new function but currently tbIsClicked(handle) can detect clicks, so you can make internal function to catch status since it can be 1 or 0. But next versions new function will come to manage checkbox status.

To get textbox value use

string tbGetText(handle)

There is no function planed to get Button value but you can Set button text via

tbSetText( obj, text, fontsize, fontname )

this function can also set value of label, text field etc.....

fx1

 
fx1.net:

Here i want to introduce a new free addon for mt4 as preview. I am currently testing a product called mt4gui. This product makes possible to place buttons, text fields, list fields directly onto chart; here is a preview screenshoot which is already working

http://fx1.net/wiki/uploads/img_7.png

Buttons react immediate after click without waiting for broker side tick. We are improving this product with more features next weeks. Why i post this is to get ideas from community whats needed. Of course not everything can be realised really but i ll filter interesting ideas here.

Here is an example very basic code demonstrates usage:

what about add object to lib aka diagram? winapi

be very usful

 

Britanec,

such an object is very complicated to implement at this stage since we want to release all common objects till version 1.0 then we can go to advanced topics but thank you for suggestions, let us know about new ideas


fx1.net

 

I think I was not very clear in my previous post. Let's try it again:

1) the way your function places buttons on screen is slightly different from ObjectCreate in mql. It is not tied to a corner. So to place an obect in relation to the lower corner there are negative coordinates. Additionally your placement goes from the whole window not a chart window. I have nothing against that, but placing text next to a button with negative coorditnate using general mql function is impossible, or maybe I could not do it. Your "pxy" function is as good as others for putting text in a chart window, but it did not do the job since coordinates are given differently.

2) colors did not work in version 2. Thank you very much for updating to version 3. Absolutely no issue with colors anymore. Excellent.

3) once again I would like to ask you if it is possible using tbPutObject function of your dll to place objects in a separate subwindow. Your product, in my view, would be 10 times more valuable if that was done. It will be something of a trade console, and be very manageble within a window. Additionally it will solve all the coordinate issues raised in point 1.

4) I do have the sample you posted here and the one from the fx1 site. And of course I do have tbRemove for each of the objects in deinit. It is just NOT removing the objects when the expert is removed. I have no idea why.

I would like to once again thank you for the product. It is truly excellent and exactly what I was looking for for a long time.

There is one issue though I wanted to bring to your attention. If ExpertAdvisor button of MT4 is in an OFF position and any of your buttons are clicked nothing happens which is correct, but the moment ExpertAdvisors button is turned ON again the EA performs all the commands from the clicks. Just for a test I clicked both Buy and Sell while ExpertAdvisor was off, the moment I tured it on it bought and sold. I think that is something to be fixed.

 

fx1.net: controls are flashing very often on the chart, can you solve this issue? I guess the frequency of blinking depends on tick data.

 
Ghost: see my videos; they dont flush at all. its matter of implementation. If you remove and re-apply on every tick this may happen but in other case they are static more or less. At least on my side. Can you post how you have implemented that please?
 
pro_:

I think I was not very clear in my previous post. Let's try it again:

1) the way your function places buttons on screen is slightly different from ObjectCreate in mql. It is not tied to a corner. So to place an obect in relation to the lower corner there are negative coordinates. Additionally your placement goes from the whole window not a chart window. I have nothing against that, but placing text next to a button with negative coorditnate using general mql function is impossible, or maybe I could not do it. Your "pxy" function is as good as others for putting text in a chart window, but it did not do the job since coordinates are given differently.


pro_: yes MQL is doing this through setting seperate property and keeps positions positive. I believe that you can do same better with negative coordinates, thats why i have implemented this that way. About pxy function, its able to understand - coordinates with slighly modification. Yes whole window because as .dll we cannot see the chart axis etc. On other hand they look like static, you may simply measure their width and height and place the texts x,y relative to that.

2) colors did not work in version 2. Thank you very much for updating to version 3. Absolutely no issue with colors anymore. Excellent.

v3 supports color in buttons,checkboxes yet.


3) once again I would like to ask you if it is possible using tbPutObject function of your dll to place objects in a separate subwindow. Your product, in my view, would be 10 times more valuable if that was done. It will be something of a trade console, and be very manageble within a window. Additionally it will solve all the coordinate issues raised in point 1.

well the main job was to place them onto chart window really. seperate window placing would be very easy but currently we have choosen a way. Its slightly diff implementation if we place them to chart or seprate window. In later versions we may support that. I have plans to beeing able to make CHART smaller without changing size of MDI window where chart sits inside. This way we could have seperate space on right or bottom to place additional buttons. They would look like buttons next to chart.


4) I do have the sample you posted here and the one from the fx1 site. And of course I do have tbRemove for each of the objects in deinit. It is just NOT removing the objects when the expert is removed. I have no idea why.

Yes i confirm that, this was working once. I ll be checking this important issue

There is one issue though I wanted to bring to your attention. If ExpertAdvisor button of MT4 is in an OFF position and any of your buttons are clicked nothing happens which is correct, but the moment ExpertAdvisors button is turned ON again the EA performs all the commands from the clicks. Just for a test I clicked both Buy and Sell while ExpertAdvisor was off, the moment I tured it on it bought and sold. I think that is something to be fixed.

Yes you right competly. I did not check this issue. I ll also be working on that.

Thank you very much for testing mt4gui!

 

fx1.net: before posting my code I'm going to check your sample code.

Can it be the problem that I use the tbSetText to update the text of labels in every tick?

Are you planning to add radiobuttons to the addon? If not, how can we change the checkstate of a checkbox?

 

tbRemove and tbRemoveAll bug has been fixed on v0.4

Checkbox support has been extended:

int tbSetChecked(int,bool);

int tbIsChecked(int);

Demo code on site has been updated.

Reason: