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()
- 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
- Code: Select all
trace
- Code: Select all
core.host:trace(string.format("Update(Renko open: %f, Renko close: %f)", Renko.open[Rperiod], Renko.close[Rperiod]));
- Code: Select all
ExtUpdate
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!