- Is there a way to program color changes on the chart?
- WindowPriceMax() & WindowPriceMin() don't change if MT4 is minimized
- Advantages and disadvantages of an automatic vehicle
As in when the chart does that on its own ?
Since it can change on tick (only) i'd assume a copy of the price max and price min can be kept and checked against .
Will test that
ChartGetDouble(ChartID(),CHART_PRICE_MIN,0); ChartGetDouble(ChartID(),CHART_PRICE_MAX,0;
if that's what you meant :
#property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ double scaleMax=0.0,scaleMin=0.0; int OnInit() { scale_changed(scaleMax,scaleMin,0); return(INIT_SUCCEEDED); } void OnTick() { //--- if(scale_changed(scaleMax,scaleMin,0)){ Comment("Scale changed to "+DoubleToString(scaleMin,_Digits)+"-"+DoubleToString(scaleMax,_Digits)); } } bool scale_changed(double &max,double &min,int subwindow){ bool change=false; double _max=ChartGetDouble(ChartID(),CHART_PRICE_MAX,subwindow); double _min=ChartGetDouble(ChartID(),CHART_PRICE_MIN,subwindow); if(_max!=max||_min!=min){ change=true; } max=_max; min=_min; return(change); }
As in when the chart does that on its own ?
Since it can change on tick (only) i'd assume a copy of the price max and price min can be kept and checked against .
Yes that's exactly what I mean (when the chart does it on its own). I was hoping that this could be handled somehow with OnChartEvent, but if that's not possible, I'll have to use some solution similar to what you suggested. Thanks.
Yes that's exactly what I mean (when the chart does it on its own). I was hoping that this could be handled somehow with OnChartEvent, but if that's not possible, I'll have to use some solution similar to what you suggested. Thanks.
Yeah , i don't think there is unless a more experienced coder has found one .
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use