Page 1 of 1

Working with orders

PostPosted: Tue Oct 02, 2018 10:49 am
by JuliaS
Using ForexConnect API you can create, modify and delete orders, and manage positions.

For detailed step-by-step instructions on how to create and delete orders, see the Creating Order and Deleting Order articles.

For a detailed step-by-step instruction on how to open and close positions, see the Opening/Closing Position article.

The following sample scripts are available at github:

- CreateEntryOrder.py
This sample script shows how to create an entry limit order with specified account ID, instrument, trading direction (buy/sell), rate, and number of lots.

- RemoveOrder.py
This sample script shows how to delete an order by its order ID.

- OpenPosition.py
This sample script shows how to open a position by creating an open market order for specified account ID, instrument, buy/sell, rate, and number of lots.

- ClosePosition.py
This sample script shows how to close a position for a specified instrument by creating a close market order with an opposite direction.