Indicore SDK3 & Net Stop

All posts which do not fit into any other sections of the forum.

Moderator: admin

Indicore SDK3 & Net Stop

Postby betwap » Tue Oct 04, 2016 10:36 pm

I am looking for a method of detecting the net stop on FIFO accounts.

1) Is there a net stop?
2) What is the open rate?
3) What other info (eg trailing/current rate)

Same for net limits. I can see in the Summary in FXTS2 when I create a net stop but I don't see in the docs how to get this from any of the Indicore SDK3 tables.

How do I get information about a net stop/limit?
User avatar
betwap
 
Posts: 7
Joined: Tue Oct 04, 2016 10:24 pm

Re: Indicore SDK3 & Net Stop

Postby betwap » Wed Oct 05, 2016 6:54 pm

I found it in the Orders table. :find() doesn't work because NetQuantity is a bool and can't be indexed. Except that only one order can have NetQuantity=true... But this won't work:

Code: Select all
result = core.host:findTable("offers"):find( "NetQuantity", true );


The old tried and true method does the trick:

Code: Select all
local Enum = core.host:findTable("offers"):enumerator();
local Row  = Enum:next();
while (Row) do
  if ( Row.NetQuantity ) then return true end
  Row  = Enum:next();
end
User avatar
betwap
 
Posts: 7
Joined: Tue Oct 04, 2016 10:24 pm

Re: Indicore SDK3 & Net Stop

Postby Georgiy » Wed Oct 12, 2016 4:11 am

Hi betwap,

The solution, which you have found, is correct:
Code: Select all
local Enum = core.host:findTable("offers"):enumerator();
local Row  = Enum:next();
while (Row) do
  if ( Row.NetQuantity ) then return true end
  Row  = Enum:next();
end


I found it in the Orders table. :find() doesn't work because NetQuantity is a bool and can't be indexed. Except that only one order can have NetQuantity=true... But this won't work:

Code: Select all
Code: Select all
result = core.host:findTable("offers"):find( "NetQuantity", true );

Yes, it will not work. Details are here:
http://www.fxcodebase.com/bin/beta/IndicoreSDK-3.0/help/web-content.html#tradingtable.find.html
Georgiy
FXCodeBase: Initiate
 
Posts: 150
Joined: Tue Jul 29, 2014 4:49 am


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 4 guests