Appendix B- Custom Functions
Appendices > Appendix B- Custom Functions

Glossary Item Box

Appendix B: Custom Functions

Streaming Data: SYM()

=SYM(<data-identifier>,<data-property>,<data-attribute>,<interval-multiplier>,<interval-type>,<index>,<date-time>)

Argument

Description

Values

Data Identifier

The identifier of the data that will be added to the cache: the instrument name

Symbol strings, e.g. EUR/USD or IBM

Data Property

The data property, if any: e.g. for symbol price data, a property might be Bid or Ask quotes or Last for the trade price

Strings for available data streams, currently BID, ASK, MID

Data Attribute

The data attribute, e.g., for symbol price data, this might be Open, High, Low, Close or Volume

Strings for available data attributes, currently Open, High, Low, Close, Volume, or their abbreviations: O, H, L, C, V

Interval Multiplier

An argument that specifies the multiplier used by the data aggregation method to perform data aggregation. For example, "10" if coupled with an <interval-type> of "Seconds" would then cause the data to be aggregated using the appropriate aggregation method in 10 second intervals. Aggregation methods are mapped to <data-property> and/or <data-attribute> types. For example, if the <data-attribute> is "H" for the high of an instrument price, the aggregation method for computing the highest value in all the underlying substrate data would be used, and the high value would be returned for each 10 second interval. If <interval-multiplier> is specified at "T", tick data is returned and the <interval-type would not be specified.

An integer that is combined with the interval type to comprise the data frequency, e.g. 10 for 10 seconds, hours, minutes, etc.

Interval Types

An optional argument that specifies the aggregation method. For instrument price data it might be seconds, minutes, hours, days, weeks, months, years. If <interval-multiplier> is specified as "T" for the tick interval-type, then <interval-type> is not specified.

String for supported intervals, e.g. Tick Second, Minute, Hour, Day, Week, Month

Index

The index in the time series which is stored in the cache, where 0 is the most recent value, 1 is the second value, etc. Optionally specifying a range of indices such as 0-5 causes most recent 6 values to be added to the cache.

Integer starting with 0 or a hyphenated index range if entering a streaming range, e.g. 0-10 or 5-15, etc.

Date Time

An optional argument that if specified will cause the date time of the index or indices specified to be returned instead of the actual value. This is typically used in an adjacent column

The string DT

Example Formulas

=sym(EUR/USD,B,O,1,MI,0) - returns Bid Open price for current minute for EUR/USD.

=sym(EUR/USD,A,C,1,MI,1) - returns Ask Close price for the previous minute for EUR/USD.

=sym(EUR/USD,B,T,0) - returns current Bid price for EUR/USD (price of last bid tick).

=sym(EUR/USD,M,C,1,H,5) - returns 5 hours old Close Mid price for EUR/USD.

=sym(EUR/USD,A,C,1,MI,0,BDT) - returns current time (in minutes).

 


 

Trading:  TRD(), OCO(), CAN(), CNR(), CLO()

Custom function TRD() activates trading templates.

=TRD("account","<named-range>",<timer>)

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Named Range

The case sensitive string identifier of any named range

any comma separated list of double quoted named ranges, e.g., "<named-range-1>","<named-range-2>" etc. and/or grouped trades:  "OCO | <named-range-1> | <named-range-2>" etc., or a combination of the two, for example:   "OCO|<named-range-1>|<named-range-2>","<named-range-3>","<named-range-4>"

Timer

An argument for specifying a minimum time based distance between trades from calling the function

Integer in milliseconds, unquoted, e.g. 5000.  If not supplied, uses the global timer value in Trading ->Options

Example Formula

=IF(F22="BUY",TRD("A", "BuyEntry",5000),"HOLD") - if cell F22 equal to "Buy", "BuyEntry" trading template is activated. Otherwise "HOLD" displayed. Trading template will wait 5000 milliseconds (5 seconds) to execute next order.

 

Custom function OCO() places OCO orders (One-Cancels-the-Other).

=OCO("<account>","<named-range>","<named-range>",<milliseconds>)

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Named Range

The case sensitive string identifier of any named range

any comma separated list of double quoted named ranges, e.g., "<named-range-1>","<named-range-2>" etc. and/or grouped trades:  "OCO | <named-range-1> | <named-range-2>" etc., or a combination of the two, for example:   "OCO|<named-range-1>|<named-range-2>","<named-range-3>","<named-range-4>"

Timer

An argument for specifying a minimum time based distance between trades from calling the function

Integer in milliseconds, unquoted, e.g. 5000.  If not supplied, uses the global timer value in Trading ->Options

Example Formula

=IF(F22="BUY",TRD("A", "EntryLmt","EntryStp",5000),"HOLD") - if cell F22=Buy places place an OCO order by utilizing EntryLmt and EntryStp templates. If one of the orders is executed (or canceled), the second one is canceled as well.

 


 Custom function CAN() cancels pending orders.

= CAN("<account>","<scope>","<side>|<order-type>",<timer>)

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Side|Order Type

Allows a specification of which orders to cancel by whether the order is a buy, sell, or both, together with the type of order

Double quoted <side>|<order-type> list with pipe delimiter;   Buy and/or Sell and/or BuySell | EntryLimit and/or EntryStop and/or OCO and/or StopNet and/or LimitNets;      for example:   "Buy | EntryLimit | OCO; Sell | OCO;  BuySell | EntryStop"

Timer

An argument for specifying a minimum time based distance between trades from calling the function

Integer in milliseconds, unquoted, e.g. 5000.  If not supplied, uses the global timer value in Trading ->Options

Example Formula

=IF(C14>0,CAN("A","EUR/USD","Buy|EntryLimit;Buy|EntryStop",5000),"HOLD") - if cell C14>0, all "Buy" orders of type "EntryLimit" and "EntryStop" are canceled. Otherwise "HOLD" displayed. Trading template will wait 5000 milliseconds (5 seconds) to execute next order.

=IF(C14>0,CAN("A","Template","BuyEntry",SellEntry",5000),"HOLD")- if cell C14>0, all orders originated from templates "BuyEntry" and "SellEntry" will be canceled.  Otherwise "HOLD" displayed. Trading template will wait 5000 milliseconds (5 seconds) to execute next order.

  


 Custom function CNR() replaces one pending order with another.

=CNR("<account>","<scope>","<side>|<order-type>","<trigger>","<replacement-trades...>",<timer>)

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Side|Order Type

Allows a specification of which orders to cancel by whether the order is a buy, sell, or both, together with the type of order

Double quoted <side>|<order-type> list with pipe delimiter;   Buy and/or Sell and/or BuySell | EntryLimit and/or EntryStop and/or OCO and/or StopNet and/or LimitNets;      for example:   "Buy | EntryLimit | OCO; Sell | OCO;  BuySell | EntryStop"

Trigger

Allows specification of the conditions under which the replacement trade orders should be submitted;  OnCancelled means only issue the replacement orders if the specified order-types to be cancelled are found and cancelled, OnNoCancel means to only issue the replacement orders if there are no orders found to cancel matching the specifications, OnProcessed means to issue the replacement trades whenever the function is called, and OnFail means to only submit the replacement orders when the attempt to cancel the specified orders fails

double quoted option names "OnCanceled" or "OnNoCancel" or "OnProcessed" or "OnFail"

Replacement Trades

Allows specification of any number of replacement trades of any type of order represented by a named range.   Also supports groups of trades such as OCO orders as well as combinations of the two

Double quoted comma delimited named ranges, e.g., "<named-range-1>","<named-range-2>" and/or double quoted groups of trades, e.g., "OCO | <named-range-1> | <named-range-2>", or a combination of the two, for example "OCO | BuyLimit | BuyStop", "BuyEntryLimit", "BuyEntryLimit-Level2" where:  each of BuyLimit, BuyStop, BuyEntryLimit and BuyEntryLimit-Level2 are named ranges with the first two submitted as an OCO 

Timer

An argument for specifying a minimum time based distance between trades from calling the function

Integer in milliseconds, unquoted, e.g. 5000.  If not supplied, uses the global timer value in Trading ->Options

Example Formula

=IF(C28>0,CNR("A","EUR/USD","Buy|EntryLimit","OnProcessed","EntryStp",5000),"HOLD") - if cell C28>0 pending buy entry limit order is replaced with trading range named "EntryStp" (may represent entry stop order).

 

Custom function CLO() closes open positions.

= CLO("<account>","<scope>","<side>",<timer>)

 

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Side

Allows a specification of which positions to cancel by whether the position is a buy (long), sell (short), or both, together with the type of order

Double quoted <side> list with pipe delimiter;   Buy and/or Sell and/or BuySell.      For example:   "Buy", "Sell", "BuySell". 

Timer

An argument for specifying a minimum time based distance between trades from calling the function

Integer in milliseconds, unquoted, e.g. 5000.  If not supplied, uses the global timer value in Trading ->Options

Example Formula

=IF(A1<-20, CLO("A","EUR/USD","BuySell",5000),"HOLD") - if cell A1<-20 all open positions for EUR/USD will be closed and formula will wait at least 5000 millisecond between cancels even if called by the formula (i.e. if A<-20 evaluates to True). The "HOLD" is a user specified string which the value returned in the cell if the IF() formula evaluates to False.

 

 


 

Real Time Feedback Loop:  ORD(), POS(), CSD()

 

Custom function ORD() shows parameters of pending orders.

=ORD("<account>","<scope>","<side>|<order-type>","<Rate>","Tag|<tag-string>", "user")

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Side|Order Type

Allows a specification of which orders to cancel by whether the order is a buy, sell, or both, together with the type of order

Double quoted <side>|<order-type> list with pipe delimiter; Buy and/or Sell and/or BuySell | EntryLimit and/or EntryStop and/or OCO and/or StopNet and/or LimitNets; for example: "Buy | EntryLimit | OCO; Sell | OCO; BuySell | EntryStop"

Rate

(optional)

Shows rate (price) at which order was placed.

Double quoted word "Rate".

Tag|tag-string

(optional)

(Available for institutional platforms only)

Tag that allows identification of given trade. Double quoted combination of symbols (limited to 24)

User

(optional)

(Available for Super Users only)

In Super User account will display net quantity for all accounts or net quantity for each separate account Double quoted word "total" or double quotes username (user@FXOne.com)

Example Formula

=ORD("A","EUR/USD","Buy|EntryLimit") - will show quantity all Buy|EntryLimit pending orders

=ORD("A","EUR/USD","Buy|EntryLimit;Sell|EntryLimit") - will show quantity of all Buy|EntryLimit and Sell|EntryLimit pending orders

=ORD("A","EUR/USD","Buy|EntryLimit","Tag|1") - will show quantity of all Buy|EntryLimit pending orders with tag "1".

=ORD("A","EUR/USD","Buy|EntryLimit","Rate") - will show rate(price) of first Buy|EntryLimit order.
=ORD("A","EUR/USD","Buy|EntryLimit","Rate","Tag|1") - will show rate (price) of Buy|EntryLimit order with tag "1"

=ORD("A","EUR/USD","Buy|EntryLimit","total")- in Super User account will show quantity for all EUR/USD Buy|EntryLimit pending orders from all user. (Net Quantity)

=ORD("A","EUR/USD","Buy|EntryLimit","user@FXOne.com")- in Super User account will show quantity for all EUR/USD Buy|Entrylimit pending orders for user user@FXOne.com. (Net Quantity).

 


Custom function POS() shows parameters of open positions 

=POS("<account>","<scope>","<value>")

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Value

Allows specification of any available value computed in real-time related to currently open positions

Can be any double quoted value available via the API or computed from information available via the API or information maintained by the application, e.g., "NetPL".  Currently available values include:

·          “GrossPL”  --  current gross profit and loss

·          “NetPL”  --  current net profit and loss

·          “AmountK”  --  amount of all positions (both buy and sell) opened in the instrument.

·          “SellNetPL” -- current profit and loss on all sell positions

·          “SellAmountK”  -- amount of all open sell positions

·          “SellAvgOpen”  -- average open price of buy positions

·          SellClose  --  current market price at which all sell positions can be closed.

·          “BuyNetPL”  --  current net profit and loss on all buy positions

·          “BuyAmountK”  -- amount of all open buy positions

·          “BuyAvgOpen”  --  average open price of buy positions “BuyClose”  --  current market price at which all buy positions  can be closed.

User

(optional)

(Available for institutional platforms only)

In Super User account will display net quantity for all accounts or net quantity for each separate account Double quoted word "total" or double quotes username (user@uFXOne.com)

Example Formula

=POS("A","EUR/USD","BuyNetPL") - returns current net profit and loss on all buy positions.

=POS("A","EUR/USD","NetPL") - returns current net P/L.

=POS("A","EUR/USD") - returns total quantity of all open positions.

=POS("A","EUR/USD","AmountK,"total") - in Super User account will display quantity for for all open EUR/USD positions from all users (Net Quantity).

=POS("A","EUR/USD","AmountK",user@fFXOne.com) - in Super User account will show quantity for all open EUR/USD positions for user user@FXOne.com (Net Quantity).

function CSD() displays parameters of the closed position.

Please note that the first closed trade displayed is not necessary today's first trade, but the first trade of the current trading cycle.

=CSD("<account>","<scope>","<side>","<value>",<index>, "Tag|<tag-string>")

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Side

Allows specification of which closed orders to return by whether the order is a buy, sell or both

Double quoted strings “Buy”, “Sell” or “BuySell”

Value

allows specification of any available value computed in real-time related to currently open positions

Can be any double quoted value available via the API or computed from information available via the API or information maintained by the application, e.g., "NetPL". Currently available values include:

· “GrossPL” -- current gross profit and loss

· “NetPL” -- current net profit and loss

· “AmountK” -- amount of all positions (both buy and sell) opened in the instrument.

· “SellNetPL” -- current profit and loss on all sell positions

· “SellAmountK” -- amount of all open sell positions

· “SellAvgOpen” -- average open price of buy positions

· SellClose -- current market price at which all sell positions can be closed.

· “BuyNetPL” -- current net profit and loss on all buy positions

· “BuyAmountK” -- amount of all open buy positions

· “BuyAvgOpen” -- average open price of buy positions “BuyClose” -- current market price at which all buy positions can be closed.

Index

(optional)

The index in the time series which is stored in the cache, where 0 is the most recent value, 1 is the second value, etc. ; optional argument, defaults to 0

An integer starting with 0

Tag|<tag-string>

(optional)

(Available for institutional platforms only)

Tag that allows identification of given trade. Double quoted combination of symbols (limited to 24)

Example Formula

=CSD("A", "EUR/USD","BuySell", "Open", 0) - displays open price of the first trade. (buy or sell)

=CSD("A", "EUR/USD","BuySell", "PL", 0) - displays P/L of the first trade (buy or sell)

=CSD("A", "EUR/USD","BuySell", "OpenTime", 0) -displays opening time of the first trade (buy or sell)


=CSD("A", "EUR/USD","BuySell", "Open", 0,"Tag|1") - displays open price of the first trade with tag 1. (buy or sell)

=CSD("A", "EUR/USD","BuySell", "PL", 0,"Tag|1") - displays P/L of the first trade with tag 1 (buy or sell)

=CSD("A", "EUR/USD","BuySell", "OpenTime", 0,"Tag|1") -displays opening time of the first trade tag 1 (buy or sell)

=CSD("A", "EUR/USD","BuySell", "Close", -1) – displays price for the last closed long or short EUR/USD position

=CSD("A", "EUR/USD","BuySell", "Close", -1,"Tag|1") – displays price for the last closed long or short EUR/USD position with tag 1 

Volume

Volume (volume resets to 0 at 5PM US ET; "Buy" means that we "bought" to close short position, "Sell" means that we "sold" to close long position).

=CSD("A", "EUR/USD","BuySell","Grosspl", "Vol")- displays GrossP/L of today's trades (buy or sell).

=CSD("A", "EUR/USD","BuySell","PL", "Vol") - displays P/L of today's trades (buy or sell)

=CSD("A", "EUR/USD","BuySell","Amount", "Vol") - displays today's total trading volume

=CSD("A", "EUR/USD","BuySell","AmountK", "Vol") - displays today's total trading volume in thousands

 


=CSD("A", "EUR/USD","BuySell", "Open", 0,"Tag|1")  - displays open price of the first trade with tag 1. (buy or sell)

 =CSD("A", "EUR/USD","BuySell", "PL", 0,"Tag|1") - displays P/L of the first trade with tag 1 (buy or sell)

=CSD("A", "EUR/USD","BuySell", "OpenTime", 0,"Tag|1") -displays opening time of the first trade tag 1 (buy or sell)

=CSD("A", "EUR/USD","BuySell", "Close", -1) – will display price for the last closed long or short EUR/USD position

=CSD("A", "EUR/USD","BuySell", "Close", -1,"Tag|1") – will display price for the last closed long or short EUR/USD position with tag 1 

 

=CSD("A", "EUR/USD","BuySell","Grosspl", "Vol","user@FXOne.com")- displays GrossP/L of today's trades (buy or sell) from specific user.
=CSD("A", "EUR/USD","BuySell","PL", "Vol","user@FXOne.com") - displays P/L of today's trades (buy or sell) from specific user.
=CSD("A", "EUR/USD","BuySell","Amount", "Vol","user@FXOne.com") - displays today's total trading volume from specific user.
=CSD("A", "EUR/USD","BuySell","AmountK", "Vol","user@FXOne.com") - displays today's total trading volume in thousands from specific user.


 

Custom function DPL() displays account's real time day's P/L.

=DPL("<account>","<currency>","<symbol>","<user>")

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Currency

(optional)

Convert account P/L from base currency into given currency Double quoted currency name

Currency

(optional)

Returns daily P/L for a given symbol Double quoted currency name

Symbol

(optional)

Returns daily P/L for a given symbol Double quoted currency pair
Example Formula

=DPL("A","EUR","AUD/CAD", "user@FXOne.com") - returns unrealized and realized P/L for user user@FXOne.com for symbol AUD/CAD and displays result using EUR currency. (You can see other trader's P/Ls only if you are a Super User)


 =DPL("A","EUR", "user@FXOne.com") - returns total unrealized and realized P/L for user user@FXOne.com and displays result using EUR currency.(You can see other trader's P/Ls only if you are a Super User).

=DPL("A") - returns total unrealized and realized P/L for all users in account's base currency.

=DPL("A","GBP") - returns total unrealized and realized P/L for all users in GBP.

= DPL("A","USD/CHF") - displays unrealized and realized P/L for a given currency pair ( total for all accounts if you are a Super User)

=DPL("A","USD/CHF", "user@FXOne.com") - displays unrealized and realized P/L for a given currency and user.

 

Custom function UPL() displays account's real time unrealized day's P/L.

=UPL("<account>","<currency>","<symbol>","<user>")

 

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Currency

(optional)

Convert account P/L from base currency into given currency Double quoted currency name

Symbol

(optional)

Returns unrealized P/L for a given symbol Double quoted currency pair

User

(optional)

(Available for institutional platforms only)

Returns unrealized profit for a given user (You can see other traders P/Ls only if you are a Super User) Double quoted username
Example Formula

=UPL("A","EUR","AUD/CAD", "user@FXOne.com") - returns unrealized P/L for user user@FXOne.com for symbol AUD/CAD and displays result using EUR currency. (You can see other trader's P/Ls only if you are a Super User)


 =UPL("A","EUR", "user@FXOne.com") - returns total unrealized P/L for user user@FXOne.com and displays result using EUR currency.(You can see other trader's P/Ls only if you are a Super User).

=UPL("A") - returns total unrealized P/L for all users in account's base currency.

=UPL("A","GBP") - returns total unrealized P/L for all users in GBP.

= UPL("A","USD/CHF") - displays unrealized P/L for a given currency pair ( total for all accounts if you are a Super User)

=UPL("A","USD/CHF", "user@FXOne.com") - displays unrealized P/L for a given currency and user.

 

Custom function RPL() displays account's real time realized day's P/L.

=RPL("<account>","<currency>","<symbol>","<user>")

 

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Currency

(optional)

Convert account P/L from base currency into given currency Double quoted currency name

Symbol

(optional)

Returns realized P/L for a given symbol Double quoted currency pair

User

(optional)

(Available for institutional platforms only)

 

Returns realized profit for a given user (You can see other traders P/Ls only if you are a Super User) Double quoted user name
Example Formula

=RPL("A","EUR","AUD/CAD", "user@FXOne.com") - returns realized P/L for user user@FXOne.com for symbol AUD/CAD and displays result using EUR currency. (You can see other trader's P/Ls only if you are a Super User)


 =RPL("A","EUR", "user@FXOne.com") - returns total realized P/L for user user@FXOne.com and displays result using EUR currency.(You can see other trader's P/Ls only if you are a Super User).

=RPL("A") - returns total realized P/L for all users in account's base currency.

=RPL("A","GBP") - returns total realized P/L for all users in GBP.

= RPL("A","USD/CHF") - displays realized P/L for a given currency pair ( total for all accounts if you are a Super User)

=RPL("A","USD/CHF", "user@FXOne.com") - displays realized P/L for a given currency and user.

RPL() resets to zero at 5PM US Eastern Time
DPL=UPL+RPL

 

 

Custom function ACT() displays account's real time parameters

=ACT("<account>","<value>")

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Value

Allows specification of any available value computed in real-time related to currently open positions

Can be any double quoted value available via the API or computed from information available via the API or information maintained by the application, e.g., "GrossPL".  Currently available values include:

·         “GrossPL”  --  The profit and loss on all open positions in the account. The GrossPL equals the difference between the Equity and the Balance of the account.

·          “Balance”  --  The amount of funds in the account without taking into consideration profits and losses on all open positions

·          “Equity”  --  the amount of funds in the account, including profits and losses on all open positions (the "floating" balance of the account)

·          “DayPL” -- The profit and loss (both "floating" and realized) during the current trading day.

·          “M2MEquity”  -- The "floating" balance of the account at the beginning of the trading day.·          “UsableMargin”  --  available margin          

·          "UsedMargin"  --  The amount of funds currently committed to maintain all open positions in the account.

·          "MarginCall”  -- The limitation state of the account, each state determines the operations that can be performed on the account. Possible values:

 

"Y"

Margin call (all positions are liquidated, new positions cannot be opened).

"W"

Warning about possible margin call (positions can be closed, new positions cannot be opened).

"Q"

Equity stop (all positions are liquidated, new positions cannot be opened up to the end of the trading day).

"A"

Equity alert (positions can be closed, new positions cannot be opened up to the end of the trading day.

"N"

No limitations (no limitations are imposed on the account operations).

·          “IsUnderMarginCall”  -- Defines whether the account is under the margin call process. Possible values: "True" - the account is under the margin call (the UsableMargin reached "0" and open positions were closed because of the insufficient funds), "False" - the account is not under the margin call (there are funds available to open new position and cover losses on the existing positions).

·          “Kind”  --  The type of the account. Possible values:

"32"

Trading account.

"36"

Managed account.

"38"

Controlled account.

 

Example Formula

=ACT("A","GrossPL") - shows current gross profit and loss

=ACT("A","DayPL") - shows current daily PL

 

You can have the same tag with different currencies.
TPOS() available for institutional platforms only.

Custom function TPOS() shows parameters of open positions with corresponding tag.

=TPOS("<account>","<scope>","<value>",<"tag-string">,"user")

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Value

Allows specification of any available value computed in real-time related to currently open positions

Can be any double quoted value available via the API or computed from information available via the API or information maintained by the application, e.g., "NetPL". Currently available values include:

· “GrossPL” -- current gross profit and loss

· “NetPL” -- current net profit and loss

· “AmountK” -- amount of all positions (both buy and sell) opened in the instrument.

· “SellNetPL” -- current profit and loss on all sell positions

· “SellAmountK” -- amount of all open sell positions

· “SellAvgOpen” -- average open price of buy positions

· SellClose -- current market price at which all sell positions can be closed.

· “BuyNetPL” -- current net profit and loss on all buy positions

· “BuyAmountK” -- amount of all open buy positions

· “BuyAvgOpen” -- average open price of buy positions “BuyClose” -- current market price at which all buy positions can be closed.

Tag-string

Tag that allows identification of given trade. Double quoted combination of symbols (limited to 24).

User

(optional)

(Available for institutional platforms only)

In Super User account will display net quantity for all accounts or net quantity for each separate account Double quoted word "total" or double quotes username (user@uFXOne.com)

Example Formula

=TPOS("A","EUR/USD","SellAvgOpen,"2") shows average open price for all EUR/USD sell trades with tag "2".

=TPOS("A","EUR/USD","BuyAmountK","1") shows the trade amount of all positions opened in the instrument with the direction "buy" with tag "1".

=TPOS("A","EUR/USD","NetPL","1") will show you NetPL all trades with tag "1".

=TPOS("A","EUR/USD","AmountK","1","total") ins Super User account will display quantity for all open EUR/USD positions with tag "1" from all users (Net Quantity).

=TPOS("A",EUR/USD","AmountK","1",user@FXOne.com) -in Super User account will displays quantity for all open EUR/USD positions for user user@FXOne.com (Net Quantity).

TCAN() available for institutional platforms only.

Custom Function TCAN() cancels pending orders with corresponding tag.

=TCAN("<account>","<scope>","<value>",<"tag-string">,<tiemr>)

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Side|Order Type

Allows a specification of which orders to cancel by whether the order is a buy, sell, or both, together with the type of order

Double quoted <side>|<order-type> list with pipe delimiter; Buy and/or Sell and/or BuySell | EntryLimit and/or EntryStop and/or OCO and/or StopNet and/or LimitNets; for example: "Buy | EntryLimit | OCO; Sell | OCO; BuySell | EntryStop"

Timer

An argument for specifying a minimum time based distance between trades from calling the function

Integer in milliseconds, unquoted, e.g. 5000. If not supplied, uses the global timer value in Trading ->Options

Tag-string Tag that allows identification of given trade. Double quoted combination of symbols (limited to 24).

Example Formula

=TCAN("A","EUR/USD","Buy|EntryLimit","1",3000) - cancels "Buy" EntryLimit order with tag "1".

=TCAN("A","EUR/USD","Buy|EntryLimit;Buy|EntryStop","1",5000) - cancels "Buy" EntryLimit and "Buy" EntryStop orders with tag "1."

DEPTH() available for institutional platforms only.

Custom Function DEPTH() displays price ladder and trading volume.

=DEPTH(<account>,<scope>,<side>,<index>,<"V"|"P">)

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Side

Allows a specification of trading order side (Bid or Ask)

Bid or Ask ("B" or "A")

Index

The index in the time series which is stored in the cache, where 0 is the most recent value, 1 is the second value, etc.

Integer starting with 0. If <index> = "S" - summary of all depth for this side

V|P

(optional)

Volume or price at the given index Volume or Price ("V" or "P")

Example Formula

=DEPTH("A","EUR/USD","B","S") - returns summary of all bid orders

=DEPTH("A","EUR/USD","B","S","V") - returns summary of volumes

The following example shows how to build price ladder by utilizing DEPTH()

 

 

VWAP() available for instituional platforms only.

Custom Function VWAP() displays volume-weighted average price (VWAP).

=VWAP(<account>,<scope>,<side>,<volume>)

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Scope

Portfolio or Symbol Name

Double quoted string “Portfolio” or “Symbol Name” e.g. “EUR/USD”

Side

Allows a specification of trading order side (Bid or Ask)

Bid or Ask ("B" or "A")

Volume

Allows a specification of desired trading volume.

Integer. If "0" specified VWAP for all depth levels will be displayed.

Example Formula

=VWAP("A","EUR/USD","B",20000000) - displays price at which we can sell 20000000 lots.

 

Custom Function TRADESTATUS() displays current trading status.

=TRADESTATUS(<scope>)

 

Argument

Description

Values

Scope

Status name

Double quoted string "Fully-Auto", "Semi-Auto" or "Disabled".

Example Formula

=TRADESTATUS("Fully-Auto") dispalys TRUE when the trading is in Fully-Auto mode and FALSE when trading is disabled.

 

Custom Function ticks() strems ticks down the row.

=ticks(symbol, daysInThePast, priceType, maxRows)

 

Argument

Description

Values

symbol

Symbol Name

Double quoted string “Symbol Name” e.g. “EUR/USD”

daysInThePast This parameter specifies the date for the data. For instance, in order to see today’s data you have to specify a 0, to see yesterday’s data you have to specify 1. Day starts at 5PM ET day before. Integer
priceType

Allows a specification of trading order side (Bid, Ask, Mid)

bid, ask, mid
maxRows Max rows to extend the formula to the bottom Integer

Example Formula

Example 1:

Today is 8/18 and you want to fill the column with the most recent ticks for the past day. The following formula =ticks("eur/usd", 0, "mid", 100000) placed in cell A1 results in column A being filled (starting from cell A2) with mid EUR/USD ticks. Since “maxRow” number is large enough the first tick starts at 5PM on 8/17 – up to present moment. (In other word, if today is 8/18, and the “daysInThePast” equal to zero, the first tick will start at 5PM ET on 8/17). However, the header will say “Ticks for 8/18/2015”

 

On screenshot bellow you can see that current time is 1:46 PM 8/18 and column is being populated with most recent ticks (only 42,378 rows are used out of maximum permitted 100,000). Most likely all 100,000 rows will not be filled up until 5PM so you will have 100K rows worth of data

 

Example 2:

=ticks("eur/usd", 0, "mid", 10) – it will display most recent 10 EUR/USD mid ticks. Since 10 is a really small number the row will be constantly re-populated.

 

 

Custom function RESET() resets template status to "Ready".

=RESET("<account>","<templatename>",<millisconds>)

 

Argument

Description

Values

Account

The account number or alias

Double quoted actual account number or recorded alias

Templatename Allows specification of template's name Name of the trading template that needs to be reset
Milliseconds

An argument for specifying a minimum time based distance between trades from calling the function

Integer in milliseconds, unquoted, e.g. 5000
Example Formula =IF(E14>0,RESET("A","BuyLimit",5000),"HOLD") - if value of cell E14 is greater than zero, status of  trading template named "BuyLimit" is reset to "Ready" (template is ready to place a new order).

"RESET()" works when workbook in "Fully-Auto" mode only.

 

 

©2016. All Rights Reserved.