OnChartEvent() and CHARTEVENT_CHART_CHANGE should be used.
//+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { //--- if(id==CHARTEVENT_CHART_CHANGE) Draw(); } //+------------------------------------------------------------------+
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have created a canvas
DebugDraw() { _width=(ushort)ChartGetInteger(0,CHART_WIDTH_IN_PIXELS); _height=(ushort)ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS); ccanvas.CreateBitmapLabel(ChartID(), 0, "ccanvas", 0, 0, _width, _height, COLOR_FORMAT_ARGB_NORMALIZE); }And then I have drawn primitives
I want to bind this canvas to the main chart because I have a problem when I try to do a vertical scale or a horizontal scroll. My primitives don't move with the main chart. How to fix it ?