Hi,
How to change chart type (OHLC or candlestick) from within indicator init section?
How to change chart type (OHLC or candlestick) from within indicator init section?
Change default alert type in MT4 2 replies
Do you know this chart-type? 23 replies
MQL Coding - Let’s talk about how to code mql 0 replies
Need to change order type on EA 2 replies
//+------------------------------------------------------------------+ //| ChgChartType.mq4 | //+------------------------------------------------------------------+ #property indicator_chart_window #import "user32.dll" int PostMessageA(int hWnd,int Msg,int wParam,int lParam); #import #define BARS 33018 #define CANDLES 33019 #define LINE 33022 #define WM_COMMAND 0x0111 int init() { PostMessageA( WindowHandle( Symbol(), Period() ), WM_COMMAND, BARS, 0 ); return( 0 ); } int start() { return( 0 ); }
DislikedGood post on changing the chart type zznbrm.
But how do you GET the current chart type?
I have a Heiken Ashi indicator on my chart, but I want to modify it so that it only shows up on the line chart. I know how to change the colors to CLR_NONE (or set the values to NULL), but don't know how to determine what chart type is currently selected...Ignored
#define VS_BARS 0 #define VS_CANDLES 1 #define VS_LINE 2 #import "ServicesMT4.dll" int ServiceGetViewChart(int hwndChart); //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { //---- int chartType = ServiceGetViewChart(WindowHandle( Symbol(), Period())); switch (chartType) { case VS_BARS: Print("Bars chart"); break; case VS_CANDLES: Print("Candles"); break; case VS_LINE: Print("Line chart"); break; } //---- return(0); } //+------------------------------------------------------------------+
DislikedHello zznbrm, I seems you know a lot about MT4 internals. Do you know how to change the Symbol used by a chart from a script? thanksIgnored