I have a question about chartGetInteger:
Normaly and If I understand well how this function works, I can recover the CHART_WINDOW_HANDLE like this:
ChartGetInteger(0,CHART_WINDOW_HANDLE) and it works if chart id is 0, but if I try to recover the chart ID of chart B from chart A, it doesn't work, function return 0, and error is 4122, chart didn't find.
I know I can recover this if I use WindowHandle(), but in this case, if I have 2 similars charts with same symbol and same period, how can I do the différence?
Can somobedy help me please?
Thanks so much in advance.
He did not question if it is in "OnInit()" or "OnTick()" (although that can be important to the fact), but he questions why you did not provide your code sample so as to evaluate if you are doing it correctly or not and if there are other factors involved.
Hence, his statement "we are not mind readers" and can therefore not know what you are doing in your code unless you show it to us! Otherwise all we can do is just guess!
Thanks for your explanation,
but I didn't take his answer bad, but in the same time, I ask just a simple answer because for me a function, if you put right parameters must works fine no?
And I try, in first time to use it, witout any code, just from Init(), and in this case no possibility for interference with any code:
just as it is in documentation ChartGetInteger(0,CHART_WINDOW_HANDLE) and I repeat, if I write 0 as chartID, and I call the function, it works fine, but if I call the function from chart A for recover the chart B window Handle, doesn't work.
May be the problem is that the idchart I write in the second case is a long and not an int. I revover the idchart B with ChartFirst(), and this function return a long.
Do you have a solution for transform a long into an int or recover the idchart in int and not long.
Unfortunately, the answer is not always so clear. Many functions depend on other factors and other times coders (especially newbie coders) can do the most unexpected things in the real code that is not reflected in the forum explanation, which can be the cause of the problem.
So, you only have two alternatives:
As for you other question, that too cannot be answered properly without looking at the code. All I can say is that converting long to int or int to long is called Typecasting and it is in the documentation on how to use it, but I cannot guarantee that as being the problem without looking at your code.
Thanks so much for your answer and for take time to answer me, really.
@ Fernando Carreiro:
You have rigth, it's not always so clear, but if I asked the question as I asked, it's because I know that I want and that I need, no necessary to have some code for this. And your answer is good, and I thanks to you!!