Where do I find the netting stop for FIFO accounts

Moderator: admin

Where do I find the netting stop for FIFO accounts

Postby joeledavis » Wed Dec 14, 2011 5:38 pm

How do I get a handle on whether or not a netting stop has been entered for the open positions on an instrument, and if so how to I retreive that value from the host. I've looked through the SDK documentation and none of the tables descriptions (trades, orders, summary) seem to hold this value. I can see how to examine stops for individual trades in non FIFO accounts, but I'm writing strategies for my FIFO account. Is this a case where the documentation has'nt been updated? Also if there is currently a strategy that implements this point me to it so I can see how the code is constructed.

Thanks,

Joel
joeledavis
 
Posts: 2
Joined: Thu Dec 08, 2011 7:59 am

Re: Where do I find the netting stop for FIFO accounts

Postby sunshine » Thu Dec 15, 2011 1:15 am

joeledavis wrote:How do I get a handle on whether or not a netting stop has been entered for the open positions on an instrument, and if so how to I retreive that value from the host.l

Please see the Orders table.
To determine whether or not a netting stop has been entered, check the NetQuantity and Type columns. If the Type column has the value "SE" or "LE" and the NetQuantity is "True", the order is Net Stop or Limit order.

In addition to Net Stop/Limit orders, you can use ELS orders to handle risk management on FIFO accounts. Please read: Using ELS Orders for FIFO accounts.

joeledavis wrote: Also if there is currently a strategy that implements this point me to it so I can see how the code is constructed.

Something like this:
Code: Select all
function FindNetStopLimit(symbol)
    local enum, row;
    enum = core.host:findTable("orders"):enumerator();
    row = enum:next();
    while (row ~= nil) do
        if row.Instrument == symbol and
           (row.Type == SE or row.Type == LE) and
           row.NetQuantity == True then
              core.host:trace("There is Net Stop/Limit order for the specified symbol");
              break;
        end
        row = enum:next();
    end
end

I hope this will help.
sunshine
 

Re: Where do I find the netting stop for FIFO accounts

Postby joeledavis » Thu Dec 15, 2011 8:00 am

Thanks,

This is the info I was looking for.

Joel
joeledavis
 
Posts: 2
Joined: Thu Dec 08, 2011 7:59 am


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 55 guests