Summary

Direction (side) of a trade command to be sent to server. Use it while creating an order request.

Example

if(position == null || position.TradeType == TradeType.Sell)//If there is no position,
//or if the position is a Sell position
{
    OpenPosition(TradeType.Buy);//Call function OpenPosition
}
private void OpenPosition(TradeType command)
{
    if (position != null)//If there is a position
    {
        Trade.Close(position);//Close that position
        position = null;//Change the state of position to null
    }
    Trade.CreateMarketOrder(command, Symbol, Volume);
}
protected override void OnPositionOpened(Position openedPosition)
{
    position = openedPosition;//When position is opened, change the state of parameter 
    //'position' from null, to openedPosition.
}