Page 1 of 1

Renko:update not working as expected

PostPosted: Tue Jul 11, 2017 6:09 pm
by youdig
Hey guys,

I have recently bought a premium strategy from you and I have a bug that I'm unable to fix myself.

Code: Select all
function ExtUpdate(id, source, period)  -- The method called every time when a new bid or ask price appears.
  core.host:trace(string.format("ExtUpdate period: %i", period));
  Renko:update(core.UpdateLast);
-- Check that we have enough data
  if (Renko.DATA:first() > (period - 1)) then
    core.host:trace("Not enough data");
    return
  end

  if (Renko.DATA:size()<10) then
    core.host:trace(string.format("Renko data size too small: %i", Renko.DATA:size()));
    core.host:trace(string.format("EMA(Size: %i)", EMA.DATA:size()));
    return;
  end
  local Rperiod=Renko.DATA:size()-1;
  core.host:trace(string.format("Renko(Size: %i, Rperiod: %i)", Renko.DATA:size(), Rperiod));
  core.host:trace(string.format("Update(Renko open: %f, Renko close: %f)", Renko.open[Rperiod], Renko.close[Rperiod]));
end


The Renko variable is initialized in the
Code: Select all
Prepare()
method like so:
Code: Select all
Renko = core.indicators:create("RENKO_CANDLES", Source, instance.bid:instrument(), instance.parameters.TF, true, instance.parameters.Step, -1000, 0);


But I realized that when a new Renko bar formed, in
Code: Select all
ExtUpdate
the
Code: Select all
trace
method:
Code: Select all
core.host:trace(string.format("Update(Renko open: %f, Renko close: %f)", Renko.open[Rperiod], Renko.close[Rperiod]));
would still show the data of the former Renko bar. The next time
Code: Select all
ExtUpdate
would get called, it'd show the right value.
Isn't this part supposed to get the last renko bar? :
Code: Select all
Renko:update(core.UpdateLast);


Maybe it's doing it asynchronously? Does anyone have a suggestion?

Thanks for your help!

Re: Renko:update not working as expected

PostPosted: Wed Jul 12, 2017 3:26 pm
by Apprentice
I have recently bought a premium strategy from you and I have a bug that I'm unable to fix myself.


Who was your contact?

Re: Renko:update not working as expected

PostPosted: Wed Jul 12, 2017 5:28 pm
by youdig
Apprentice wrote:
I have recently bought a premium strategy from you and I have a bug that I'm unable to fix myself.


Who was your contact?

Sergey.Konovalov