Skip to content

Instantly share code, notes, and snippets.

@fxindi-net
Last active June 19, 2020 14:16
Show Gist options
  • Save fxindi-net/72b0a13870a267fbb4ff to your computer and use it in GitHub Desktop.
Save fxindi-net/72b0a13870a267fbb4ff to your computer and use it in GitHub Desktop.
Toggle Scale Fix - MT4 Script
//+------------------------------------------------------------------+
//| ToggleScaleFix.mq4 |
//| http://www.fxindi.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, www.fxindi.net"
#property link "http://www.fxindi.net"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
long chartID = ChartID(), scaleFix;
//--- receive the property value and do the toggle
if(ChartGetInteger(chartID, CHART_SCALEFIX, 0, scaleFix))
{
//Print("Turned On/Off ScaleFix");
ChartSetInteger(chartID, CHART_SCALEFIX, 0, !(bool) scaleFix);
ChartRedraw(chartID);
}
}
//+------------------------------------------------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment