Well, I found a bypass like this, it kind of works, but not fast enough. Hope there is a way to instantly redraw instead of waiting for next tick:
bool changed; int start() { int limit; int counted_bars = IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; if(changed) { limit = Bars-1; changed = false; } else limit=MathMin(Bars-counted_bars,Bars-1); ..... } void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { if (id == CHARTEVENT_OBJECT_ENDEDIT && sparam == "EditBox") { // End editing of the edit box // Get the text from the edit box and try to convert it to integer newParamValue = editBox.Text(); int tempValue = StringToInteger(newParamValue); if (tempValue > 0) { // Validate the new value AdxVmaPeriod = tempValue; // Update the external parameter Print("Updated AdxVmaPeriod to: ", AdxVmaPeriod); changed = true; ...... }
I think it's not the right approach even if it can work...
First thing you should replace the start function with the OnCalculate one, then, possibly (but it's just a supposition), you can try to use the command
ChartSetSymbolPeriod(0,NULL,0);
to forcely refresh the chart.
I think it's not the right approach even if it can work...
First thing you should replace the start function with the OnCalculate one, then, possibly (but it's just a supposition), you can try to use the command
to forcely refresh the chart.
WOW, that works perfectly. I never noticed this chartsetsymbolperiod() before. With limited test, it seems works on both oncalculate() and start().
Much appreciate it!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I added an edit box to adxvma indicator, allowing change adxvmaperiod on the fly, and it tested ok, but then I failed to redraw the chart. I've successfully fixed this kind of problem with a most simple ma indicator, and it has a oncalculate() structure. But with this one, I admit it's too complicated and above my level, I failed to convert it to oncalculate() structure. So I have to keep start() structure.
Please take a look at the code, especially onchartevent():