When a Broker function is called to create a new order, this system Function will report the existence or an order, or non-existence of order the most recent broker function order attempt.  

 

When an order exists, this function return a TRUE, and a FALSE when an order does not 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:

x = system.OrderExist() '  parenthesis is left empty

 

Parameter:

Description:

<none>

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.

 

Place the script for this property right after the broker function that is attempting to create an order.  When this is done, the  scripted property, system.OrderExists() will return a TRUE when the order is created, and a FALSE when the order has been rejected.

 

Example:

'  Generate a Long Entry on Next open,
'  without a protective exit price
broker.EnterLongOnOpen
 
'  Create details why an order is created.
sRuleLabel = "Order Details go here."
 
'  When Broker Order Exist,...
If system.OrderExists() THEN
  '  Apply Order Information to Postion & Order Report
  order.SetOrderReportMessage( sRuleLabel)
 
  '  Apply Order Information to the Trade Log
  order.SetRuleLabel( sRuleLabel)
ENDIF '  system.orderExists

 

Links:

AlternateOrder Object, Blox Script Access, Broker, Order

See Also:

Data Group and Types

 


Edit Time: 9/21/2020 3:35:14 PM


Topic ID#: 449

 

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