Forum

strangeness using prev_calculated vs prev_calculated-1

Here there are the differences between Prev_calculated and Prev_calculated-1 in bars loop using prev_calculated-1 int OnCalculate ( const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const

Incorret handle using CIndicator.Create

What is wrong in calling the Empty indicator using CIndicator class: The output is the following: handle=-1 The caller: CIndicator IDiv; ...... int OnInit() { MqlParam params [ 3 ]; params [ 0 ].type =TYPE_STRING; params [ 0 ].string_value= "Empty" ; params [ 1 ].type

Problem regarding difference in MT4 - MT5 for accessing datetime in the future

Hi, I converted the Battleplan indicator (found in the network) from MT4 to MT5 successfully, but I still have a problem. The diffulty I enconter is to do the indicator in MT5 to paint the battleplan for future time date. In MT4 the indicator paint the battleplan even for future data, in MT5 if I

sma on MT5 random result

Hi, I'm developing an indicator based on sma of a limited set of bars. Trying different way to calculate sma I obtain different result for the same bar. I use 4 different way to calculate the sma: 1) using SimpleMAOnBuffer on all available bars (rates_total) 2) using SimpleMA on a limited set of bar

Canvas class scroll

Is it possible to fix canvas size to half of datas dimension and to set a scroll on the orizzontal axis? Here I attach a code which can set as input canva size. If canvas size is bigger than datas size no problem, othervise the chart doesn't display correctly. I'd like to have a scroll function to

Error setting chart scale to 1 by code

Can anyone explainme why trying to force scale to 1 inside an indicator I get the error 4210? Here the code in the init (): long scala; ResetLastError(); bool result; result= ChartGetInteger(ChartID(),CHART_SCALE_PT_PER_BAR,0,scala); if (result!= true) Print(__FUNCTION__+", Error Code =