Grid/Bid/Ask lines in chartwindow

 

Does anyone know how to programatically turn the checkerboard grid off? Not a real issue, when I launch the session and open a new chart, my next key stroke is <ctrl-g> -- but, isn't there a way to handle this in code? Also, short of creating horizontal lines on the chart, is there a way to get to show the ask prices? Or, even just the ask line?

 
Create a chart that looks just like you want it to, then save a template, and name it "default"
 
DennisJorgenson:

Does anyone know how to programatically turn the checkerboard grid off? Not a real issue, when I launch the session and open a new chart, my next key stroke is <ctrl-g> -- but, isn't there a way to handle this in code? Also, short of creating horizontal lines on the chart, is there a way to get to show the ask prices? Or, even just the ask line?

You can turn grid on/off using Messages. Please take a look at this topic of Russian forum.

For example, your case can be solved using the code:

// turns chart grid on/off using messages
#include <WinUser32.mqh>
int hwnd;
int start()
  {
   hwnd = WindowHandle(Symbol(),Period());
   PostMessageA(hwnd, WM_COMMAND, 33021, 0);
   return(0);
  }
Reason: