This function return a TRUE value when an order exists, and FALSE value when it doesn't exists.  

 

When a Broker functions is used to create an order it might get canceled by rules in other scripts.  This most often will happen with Entry Orders, but it can in some cases happen with and Exit Order.  In both cases it is always best to use this function before attempting to access any order object properties or functions (See Example below).  

 

Orders that are not in context, or do not exists when scripts attempt to access them, will cause a run-time error during execution.  When Order Object

doesn't normally have Blox Script Access, use the AlternateOrder Object to access any object property or function.

 

NOTE:

Always append an open and closed parentheses () symbol after its name (See examples).

 

Syntax:

system.OrderExists() '  parenthesis is left empty

 

Parameter:

Description:

OrderExists()

Returns TRUE when an order exists, and if the script section has Blox Script Access for Order properties or function.  When there isn't normal Blox Script Access, use AlternateOrder object to bring an order into context to access.  

 

Returns:

When an order exists function will return TRUE. When an order does not exist, or isn't in context, a FALSE condition returns.

 

Example:

'  Genereate Long Entry on Next open, without
  '  a protective exit price
  broker.EnterLongOnOpen
 
  '  Create detauls why order is created.
  sRuleLabel = "Order Details go here."
 
  '  When Broker Order Exist,...
  If system.OrderExists() THEN
    '  Apply Exit Stop Update Information
    order.SetOrderReportMessage( sRuleLabel)
 
    '  Apply Exit Stop Update Information
    order.SetRuleLabel( sRuleLabel)
  ENDIF '  system.orderExists

 

 


Edit Time: 4/6/2017 02:16:46 PM


Topic ID#: 449

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software