CHART_SHOW_TRADE_LEVELS

 

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? 

 
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.
 
reported
 
Janusz Trojca:
reported

Try this

bool tradeLevelsVisible = true; 
 
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".
 
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

 
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!

 
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?
 
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!

 
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.
 
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!