Download MetaTrader 5

A script that toggles Bid & Ask line on & off

To add comments, please log in or register
Make screenshots in MetaTrader and manage them in the gallery!
Roger Hulley
971
Roger Hulley 2013.10.28 16:02 
Hi Traders,

I wonder if anyone knows how I could arrange this code so it turns both the bid and the ask on and off at the same time?

Currently it switches the Bid and then the Ask on and off sequentially. I'd be most grateful if someone could help.

Many thanks

bool toggle = (bool)ChartGetInteger(0,CHART_SHOW_BID_LINE);
   ChartSetInteger(0,CHART_SHOW_BID_LINE,!toggle);
   ChartSetInteger(0,CHART_SHOW_ASK_LINE,!toggle);
   ChartRedraw();
Alain Verleyen
Moderator
30721
Alain Verleyen 2013.10.28 16:15  
RogH:
ChartSetInteger(0,CHART_SHOW_BID_LINE,!ChartGetInteger(0,CHART_SHOW_BID_LINE));
ChartSetInteger(0,CHART_SHOW_ASK_LINE,!ChartGetInteger(0,CHART_SHOW_ASK_LINE));

           ChartRedraw();

The problem is it flips between the bid and the ask. Would anyone know how I could arrange this code so it turns both the bid and the ask on and off at the same time?

(The toggle affect works with a hot-key)

Thanks

Please use the SRC button when you post code.

   bool toggle = (bool)ChartGetInteger(0,CHART_SHOW_BID_LINE);
   ChartSetInteger(0,CHART_SHOW_BID_LINE,!toggle);
   ChartSetInteger(0,CHART_SHOW_ASK_LINE,!toggle);
   ChartRedraw();
 
Alain Verleyen
Moderator
30721
Alain Verleyen 2013.10.29 09:53  
RogH:
Hi Traders,

I wonder if anyone knows how I could arrange this code so it turns both the bid and the ask on and off at the same time?

Currently it switches the Bid and then the Ask on and off sequentially. I'd be most grateful if someone could help.

Many thanks

An other time, please don't change your first post after you got a reply.
To add comments, please log in or register