Код |
---|
function ds_callback(candle_idx)
end
function main()
ds = CreateDataSource("TQBR", "SBER", INTERVAL_M1)
if (ds == nil) then
message("CreateDataSource returned nil")
else
r = ds:SetUpdateCallback(ds_callback)
if (r == nil) then
message("SetUpdateCallback returned nil")
else
if (r == false) then
message("SetUpdateCallback returned false")
end
end
while true do
sleep(1000)
end
end
end
function OnStop(s)
r = ds:SetEmptyCallback()
if (r == nil) then
message("SetEmptyCallback returned nil")
else
if (r == false) then
message("SetEmptyCallback returned false")
else
r = ds:Close()
if (r == nil) then
message("Close returned nil")
else
if (r == false) then
message("Close returned false")
end
end
end
end
end
|
Скрипт для тестирования в переводе на Lua. В OnStop Close() вернет nil.