stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Small coding request
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=33
Page 1 of 1
Author:  BigMack [ Thu Nov 17, 2011 7:38 pm ]
Post subject:  Small coding request

Hi all
Could someone please help me with the following coding problem.
I have written the attached ea that displays information in columns but as you can see from the attached picture the numbers move left and right across the screen depending on the number of digits in each column could some helpful person explain to me how to keep them in nice straight columns.
Many thanks for any help offered :) .
chart picture.JPG
Martins Indicator v1.mq4
Author:  magft [ Thu Nov 17, 2011 8:24 pm ]
Post subject:  Re: Small coding request

You could get fancy and measure the length of each item and pad with spaces to get uniform columns, you would also need a monospaced font to make it look ok.

All the other indicators i have seen use labels and then you can line up the coordinates. I have attached Basket stats and i-profittracker as an examples.

Mike
Author:  BigMack [ Thu Nov 17, 2011 9:08 pm ]
Post subject:  Re: Small coding request

Hi Mike many thanks :D looks promising will study these examples and hopefully figure it out.
Author:  SteveHopwood [ Thu Nov 17, 2011 11:04 pm ]
Post subject:  Re: Small coding request

BigMack wrote:Hi Mike many thanks :D looks promising will study these examples and hopefully figure it out.
Take a tip from me, cos I have learned this the hard way. Once you have it sorted out, save the code in a file whose name reflects what you have done. Then save it in a dedicated folder called 'Examplar code snippets' or 'Template code snippets' or some such. Then create a text file where you list the file name and a description of what the code does. Then back up the folder in 15 different places and repeat the backup process every time you add a file. Include an online upload facility such as mediafire.

Once I learn to follow my own advice, I will save myself hours of time hunting for that routine that I know I coded some time........................ :lol:

:D
Author:  hayseed [ Sat Nov 19, 2011 5:17 am ]
Post subject:  Re: Small coding request

hey mack..... as you see, our hands are pretty much tied when using the comment() function to display info.....

most of us move to text objects.... the flexibilty is endless.....

also, you might find arrays far more convienent to repetitive code..... many of the indicators sold on the net might contain thousands of line of repetitive code..... they can very often be reduced to a few dozen lines when using arrays.....

here is a quick "ea" example..... which could be still reduced 50%....... i left it long so you could better see the idea.......h
Author:  BigMack [ Sat Nov 19, 2011 10:03 pm ]
Post subject:  Re: Small coding request

Hi Hayseed many thanks for this it is much appreciated :D I have a book that I am working through but it doesn't mention these text objects so your example will be very helpful. I can see straight away they do exactly what I want to do. The arrays I am sort of aware of just have no idea yet how to use them its hopefully just a matter of time and practice..
Will let you know how I progress :D

Thanks again to Hayseed & magft & steveH for your assistance
Author:  SteveHopwood [ Sat Nov 19, 2011 11:59 pm ]
Post subject:  Re: Small coding request

BigMack wrote:Hi Hayseed many thanks for this it is much appreciated :D I have a book that I am working through but it doesn't mention these text objects so your example will be very helpful. I can see straight away they do exactly what I want to do. The arrays I am sort of aware of just have no idea yet how to use them its hopefully just a matter of time and practice..
Will let you know how I progress :D

Thanks again to Hayseed & magft & steveH for your assistance
Google is a huge resource when we are stuck.

I remember wanting to learn how to extract values from labels printed on the screen by an indi.
"values from labels" didn't help,so I tried:
"values from labels mql4"

and gained what I wanted from the search. Wonderful thingy, Google.

:D
Author:  KevinT [ Thu Mar 14, 2013 3:22 pm ]
Post subject:  Re: Small coding request

SteveHopwood wrote:
BigMack wrote:Hi Hayseed many thanks for this it is much appreciated :D I have a book that I am working through but it doesn't mention these text objects so ...
Google is a huge resource when we are stuck.

I remember wanting to learn how to extract values from labels printed on the screen by an indi.
"values from labels" didn't help,so I tried:
"values from labels mql4"

and gained what I wanted from the search. Wonderful thingy, Google.
:D

Hi OCCD's :mrgreen: all,

I too googled "prevent/skip/avoid/how not to/etc, display the dialog box mql" and no joy :(

So I ask a very naive, basic+simple question:

- How can I disable EA's from stopping & displaying the dialog box once dragged upon a chart (so they are executed immediately with the hard coded parameters...)

Post Scriptum: Durante solved half of the problem sugesting commenting out "#property show_inputs", and that nails it for the scripts :D, As for the EAs (at least some SH eas ;)) other method of calling the dialog box must have been used! :cry:

Regards, Kevin :|
Author:  fxprotrader [ Fri Mar 15, 2013 4:57 pm ]
Post subject:  Re: Small coding request

KevinT wrote:
SteveHopwood wrote:
BigMack wrote:Hi Hayseed many thanks for this it is much appreciated :D I have a book that I am working through but it doesn't mention these text objects so ...
Google is a huge resource when we are stuck.

I remember wanting to learn how to extract values from labels printed on the screen by an indi.
"values from labels" didn't help,so I tried:
"values from labels mql4"

and gained what I wanted from the search. Wonderful thingy, Google.
:D

Hi OCCD's :mrgreen: all,

I too googled "prevent/skip/avoid/how not to/etc, display the dialog box mql" and no joy :(

So I ask a very naive, basic+simple question:

- How can I disable EA's from stopping & displaying the dialog box once dragged upon a chart (so they are executed immediately with the hard coded parameters...)

Post Scriptum: Durante solved half of the problem as making a label of "#property show_inputs", nailed it for the scripts :D, As for the EAs (at least some SH eas ;)) other method of calling the dialog box must have been used! :cry:

Regards, Kevin :|
Kevin-
It would a helpful if you posted the EA's code in question.
All times are UTC Page 1 of 1