An autobroker is a useful mechanism where a real broker is replaced by a script.
A strategy template includes the following entry functions:
function int OnPlaceOrder() entry
{
// -- Enter your code here --
};
The OnPlaceOrder() function is called each time a request new order place is received.
function int OnOpenPosition() entry
{
// -- Enter your code here --
};
The OnOpenPosition() function is called each time a request open position is received.
function int OnRemoveOrder() entry
{
// -- Enter your code here --
};
The OnRemoveOrder() function is called each time a request remove order is received.
function int OnClosePosition() entry
{
// -- Enter your code here --
};
The OnClosePosition() function is called each time a request close position is received.
function int OnOrderExecute() entry
{
// -- Enter your code here --
};
The OnOrderExecute() function is called each time a request order execute is received.