How to set Custom Chart Mode?

 
CustomSymbolSetDouble(symbol_custom,SYMBOL_CHART_MODE,3);

Tried the above statement but got error.

I want to know if I want to display the values according to the Close price and my bid and ask prices are different then how I can set the custom chart mode to close price instead of bid or ask prices. 

Please let me know.

 
jaffer wilson:

Tried the above statement but got error.

I want to know if I want to display the values according to the Close price and my bid and ask prices are different then how I can set the custom chart mode to close price instead of bid or ask prices. 

Please let me know.

The problem you are encountering is that the SYMBOL_CHART_MODE identifier only has two options (click on ENUM_SYMBOL_CHART_MODE for the SYMBOL_CHART_MODE identifier). You can either display prices by bid or by the latest price by specifying them with 0 and 1 or SYMBOL_CHART_MODE_BID and SYMBOL_CHART_MODE_LAST respectively in the CustomSymbolSetDouble function you are using.

Therefore, when you specify the parameter set as 3, it's returning an error, because that there is no enumerations with the the parameter 3. When you click Close price link, you will see that it refers to the ENUM_APPLIED_PRICE enumerations, which are used for setting the calculation price to be used for indicators, and not for the SYMBOL_CHART_MODE identifier.

I don't know if you can set the SYMBOL_CHART_MODE of predefined symbols, but it might be worth a try. Here is the line of code you should use to test this:

CustomSymbolSetDouble(Symbol(),SYMBOL_CHART_MODE,SYMBOL_CHART_MODE_LAST);

Hope this helps!

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
To obtain the current market information there are several functions: SymbolInfoInteger(), SymbolInfoDouble() and SymbolInfoString(). The first parameter is the symbol name, the values of the second function parameter can be one of the identifiers of ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE and ENUM_SYMBOL_INFO_STRING. Some symbols...