Page 1 of 1

Automatically update the trades list information

PostPosted: Sat Mar 17, 2018 7:51 pm
by guangho
Hello everyone!

My trades list sometimes does not automatically update,the strategy that does not get the latest trades information at run time.

1. Can the strategy be forced to automatically update the trades list information?
2, How should I write the strategy?

Thank you!

Re: Automatically update the trades list information

PostPosted: Tue Mar 20, 2018 11:22 am
by guangho
Which Lady and gentleman can answer it, please?

Re: Automatically update the trades list information

PostPosted: Thu Mar 22, 2018 7:47 am
by Apprentice
Forwarded to the development team.

Re: Automatically update the trades list information

PostPosted: Fri Mar 23, 2018 4:12 pm
by guangho
Apprentice wrote:Forwarded to the development team.


Thanks for your help me.

Re: Automatically update the trades list information

PostPosted: Mon Apr 02, 2018 3:23 am
by PetroIV
Hello guangho,

You can try to use function tradingtable_row:refresh.

http://www.fxcodebase.com/bin/products/IndicoreSDK/3.4.0/help/Lua/web-content.html#tradingtable_row.html

Example using:
Code: Select all
function RefreshTradesTableRows()

   local enum, row;
   local found = false;
   enum = core.host:findTable("trades"):enumerator();
   row = enum:next();
   while row ~= nil do
       row:refresh();
       row = enum:next();
   end
end

Re: Automatically update the trades list information

PostPosted: Wed Apr 04, 2018 12:43 pm
by guangho
Apprentice wrote:Forwarded to the development team.


I don't know why, sometimes my strategy doesn't update the trend map.
Can you tell me how to write strategy to make it automatically update before executing commands?

Re: Automatically update the trades list information

PostPosted: Wed Apr 04, 2018 12:57 pm
by guangho
PetroIV wrote:Hello guangho,

You can try to use function tradingtable_row:refresh.

http://www.fxcodebase.com/bin/products/IndicoreSDK/3.4.0/help/Lua/web-content.html#tradingtable_row.html

Example using:
Code: Select all
function RefreshTradesTableRows()

   local enum, row;
   local found = false;
   enum = core.host:findTable("trades"):enumerator();
   row = enum:next();
   while row ~= nil do
       row:refresh();
       row = enum:next();
   end
end


I wrote similar sentences, but sometimes didn't update them.
It is mainly the TradesTable list of transaction software, and it is not the latest.
It needs to be updated manually.
Can your statements be forced to update?

function HT1(bsk)
local enum=core.host:findTable("trades"):enumerator();
local row=enum:next();
local bb1=0;
local dd1=0;
while row~=nil do
if row.AccountID==Account and row.OfferID==offer then
if row.BS==bsk then bb1=bb1+1 else dd1=dd1+1 end
end
row=enum:next();
end
return bb1,dd1 end

Re: Automatically update the trades list information

PostPosted: Wed Aug 29, 2018 5:49 am
by PetroIV
guangho wrote:
I wrote similar sentences, but sometimes didn't update them.
It is mainly the TradesTable list of transaction software, and it is not the latest.
It needs to be updated manually.
Can your statements be forced to update?

function HT1(bsk)
local enum=core.host:findTable("trades"):enumerator();
local row=enum:next();
local bb1=0;
local dd1=0;
while row~=nil do
if row.AccountID==Account and row.OfferID==offer then
if row.BS==bsk then bb1=bb1+1 else dd1=dd1+1 end
end
row=enum:next();
end
return bb1,dd1 end


Hello guangho,

At the moment tables haven't force update method. The tables are updated automatically. I wrote a strategy for displaying the number of orders and trades in the logs. When creating / deleting order or trade manually using FXTS the strategy trades_orders_count.lua writes changes to the logs instantly.