How to update the external input entries with a new values ? please :) - page 2

 

Hello,

thanks for all answers,

There is no way to update the input value field, may be with a deep  way of C++, handle, ...... to catch the field and update the value with the new one.


for testing I post the file I wrote, may be it will be usefull.

How to use :

stick the indicator to the chart, clik okay

check the value  field value  / new value

open the indicator window -> go to properties input field -> Input1 -> change it to number  2

look at the top of the chart

value field Input1 = 2   /  new value for Input1 = 61

now click okay close all and open again all to check the Input1 field . It is allways to 2 not 61

I think the mt4 team forgot to automatically update extern value at the window opening.



So thanks for all :))


Laurent

Files:
 

Hello again :)


Maybe a way to get what I need :)))

We can load and save all input fields, so when I get a new external value by my program not the input field, I call a function to save that new value and load it immediately after and if I check my input field I normally get the new one.

If you have an idea how to make it, It will be usefull for all people and me of course.

So I have to check how to make it.....

Thanks for knowledge.


laurent

 
Fernando Carreiro:

Not entirely correct!

"extern" variables can be changed by the code during the execution. This will however not change the default value set in the properties dialog box, only its locally running value. They are initialised to default values when you access the properties window and change the values in the dialog box.

"input" variables, however cannot be changed by the code and any such attempt will be detected by the compiler and give an error.

How can anyone dispute these facts? It blows my mind...


Good explanation, Fernando. Clear, concise, accurate. 

 
boobyditbeber:

Hello,

thanks for all answers,

There is no way to update the input value field, may be with a deep  way of C++, handle, ...... to catch the field and update the value with the new one.


for testing I post the file I wrote, may be it will be usefull.

How to use :

stick the indicator to the chart, clik okay

check the value  field value  / new value

open the indicator window -> go to properties input field -> Input1 -> change it to number  2

look at the top of the chart

value field Input1 = 2   /  new value for Input1 = 61

now click okay close all and open again all to check the Input1 field . It is allways to 2 not 61

I think the mt4 team forgot to automatically update extern value at the window opening.



So thanks for all :))


Laurent

You don't understabnd how MQ designed the input variables. They store (remember and then show in the dialog again when it's open next time) all inputs entered by a user - in your case - 2. This is logical.

All what is changed internally by the program is not saved in the input variable (for next run). This is also logical because otherwise a user will be highly surprised how inputs are changed without his/her instructions.

 
Stanislav Korotky:

You don't understabnd how MQ designed the input variables. They store (remember and then show in the dialog again when it's open next time) all inputs entered by a user - in your case - 2. This is logical.

All what is changed internally by the program is not saved in the input variable (for next run). This is also logical because otherwise a user will be highly surprised how inputs are changed without his/her instructions.

Hi,

Maybe but I understood how the input variables works behind Mql language. for input (like constant) it is normal that they can not be modified, but for the special kind like external, they can be modified by the user. he is free to change the value.

I can' t follow your way when you say : "user will be highly surprised how inputs are changed without his/her instructions".

The input field has to be updated to follow the new value, for example when the window indicator is open. it is a normal because it is connected with that input field. if the user wants to go back to the first value, he will use the reset buton of course.

It is so strange that the field is not updated with the new one. so I will look at find a way to get what I want.

Thanks again for your helps.


laurent 

 

boobyditbeber: Maybe but I understood how the input variables works behind Mql language. for input (like constant) it is normal that they can not be modified, but for the special kind like external, they can be modified by the user. he is free to change the value.

I can' t follow your way when you say : "user will be highly surprised how inputs are changed without his/her instructions".

The input field has to be updated to follow the new value, for example when the window indicator is open. it is a normal because it is connected with that input field. if the user wants to go back to the first value, he will use the reset buton of course.

It is so strange that the field is not updated with the new one. so I will look at find a way to get what I want.

Thanks again for your helps.

As I already stated, the "extern" is only altered "internally" in the running values of the program. It does not affect the Dialog Box of User inputs. It is a one-way functionality.

 
Marco vd Heijden:
These are static values that will display only the start value that you assign to them upon creating the variable, they can not be changed after creation.
Why?

 
Abednigo1995:
Why?

Are you yet another one of those new registrations that come here just to waste everybody's time by posting illogical responses or just posting other people's posts?

 
Fernando Carreiro:

As I already stated, the "extern" is only altered "internally" in the running values of the program. It does not affect the Dialog Box of User inputs. It is a one-way functionality.

okay, it has been made like this.

Thanks everybodies about your helps and knowledge


laurent

 

First variable

input int start_price=-1;
int start_change_price;

OnInit ()
  {
   start_change_price=start_price;
  }
Reason: