Script classes and functions

The following classes and functions can be used within a script strategy to perform operations. The engine runs an independent and isolated script for each strategy instrument, all these classes and functions operates with the default instrument assigned to the running script instance.

Classes
Class Description
LimitOrder(side, qty, price, text) Class to prepare a new limit order. Side can be set to the constants Buy or Sell. The text parameter is optional and can be used to describe the event that triggered the limit order. Use the send function to submit the order to the broker. Submitted orders can be canceled, if not yet executed, using the cancel function.
MarketOrder(side, qty, text) Class to prepare a new order at market price. Side can be set to the constants Buy or Sell. The text parameter is optional and can be used to describe the event that triggered the limit order. Use the send function to submit the order to the broker. Submitted orders can be canceled, if not yet executed, using the cancel function.

Functions
Function Description
hasPosition() Returns true if a position is opened, false otherwise.