Download MetaTrader 5
To add comments, please log in or register
How to test a program before buying?
InvestSoft
7765
Janusz Trojca 2015.01.05 10:54 

Hi,

I have a problem with CHART_SHOW_TRADE_LEVELS. I have written code:

   long tradeLevelsVisible = 0;
   if (ChartGetInteger(ChartID(), CHART_SHOW_TRADE_LEVELS, 0, tradeLevelsVisible))
      Comment("Show Trade levels="+tradeLevelsVisible);
   else
      Comment("");

 

and tradeLevelsVisible variable have always value 1, regardless I toggle on/off "Show trade levels" option in MT4 settings:

 

 

 Can anyone help? 

Alain Verleyen
Moderator
28520
Alain Verleyen 2015.01.05 14:24  
invest01:

Hi,

I have a problem with CHART_SHOW_TRADE_LEVELS. I have written code:

 

and tradeLevelsVisible variable have always value 1, regardless I toggle on/off "Show trade levels" option in MT4 settings:

 

 

 Can anyone help? 

Seems a bug, please report it to ServiceDesk.
InvestSoft
7765
Janusz Trojca 2015.01.05 16:42  
reported
Krzysztof Lorenc
7267
Krzysztof Lorenc 2016.11.07 12:53  
Janusz Trojca:
reported

Try this

bool tradeLevelsVisible = true; 
Fernando Carreiro
1433
Fernando Carreiro 2016.11.07 13:00  
Krzysztof Lorenc: Try this
bool tradeLevelsVisible = true; 
  1. This thread is old, and the bug no long exists.
  2. I suggest you read and check with the documentation before posting, because the function ChartGetInteger() expects a target to a "long" datatype (just as the OP did correctly). It does not take a "bool".
Krzysztof Lorenc
7267
Krzysztof Lorenc 2016.11.07 13:11  
Fernando Carreiro:
  1. This thread is old, and the bug no long exists.
  2. I suggest you read and check with the documentation before posting, because the function ChartGetInteger() expects a target to a "long" datatype (just as the OP did correctly). It does not take a "bool".

Very interesting? 4 hours ago in news feed.

1

Fernando Carreiro
1433
Fernando Carreiro 2016.11.07 13:15  
Krzysztof Lorenc: Very interesting? 4 hours ago in news feed.

That is because the MQL4 forum was migrated to this one recently, but you should look at the dates on the first and last post of a thread, to see how old it is.

However, irrespective of the age, the point is still that your suggestion violates the parameters of the function in question, hence it is invalid and the reason I pointed it out to you!

Krzysztof Lorenc
7267
Krzysztof Lorenc 2016.11.07 13:20  
Fernando Carreiro:

That is because the MQL4 forum was migrated to this one recently, but you should look at the dates on the first and last post of a thread, to see how old it is.

However, irrespective of the age, the point is still that your suggestion violates the parameters of the function in question, hence it is invalid and the reason I pointed it out to you!

Ok, I thought about  ChartSetInteger(). I was puzzled because it works ok.

You show me in news feed obsolete posts as new and you trying me say that it is my fault? Really?
Fernando Carreiro
1433
Fernando Carreiro 2016.11.07 13:45  
Krzysztof Lorenc:

Ok, I thought about  ChartSetInteger(). I was puzzled because it works ok.

You show me in news feed obsolete posts as new and you trying me say that it is my fault? Really?

I did not "show you in news feed obsolete posts"! I am not MetaQuotes nor a Moderator. I am just a simple user like you!

Don't be so sensitive! I did not accuse you or say its your fault! I just called your attention that you were responding to an old thread and that the bug was no longer current and that it no longer needed a solution! Besides, your solution was invalid!

Krzysztof Lorenc
7267
Krzysztof Lorenc 2016.11.07 13:51  
Fernando Carreiro:

I did not "show you in news feed obsolete posts"! I am not MetaQuotes nor a Moderator. I am just a simple user like you!

Don't be so sensitive! I did not accuse you or say its your fault! I just called your attention that you were responding to an old thread and that the bug was no longer current and that it no longer needed a solution! Besides, your solution was invalid!

So take a rest. If you want to impress here, write an interesting program.
Fernando Carreiro
1433
Fernando Carreiro 2016.11.07 14:56  
Krzysztof Lorenc:
So take a rest. If you want to impress here, write an interesting program.
I'm not trying to impress anyone, nor do I need to!
/ /12
To add comments, please log in or register