Skip to content

TakeProfitOrderRequest issue #20

@andriy2011

Description

@andriy2011

Hi!
I assume I might be doing something wrong but
When I try to place TakeProfitOrder for the trade:
int tradeId = 115;
static private async Task CreateTakeProfitOrder(OandaApiClient apiClient, string accountId, int tradeId, decimal price)
{
var request = new TakeProfitOrderRequest
{
Price = price,
TimeInForce = TimeInForce.GTC,
TradeID = tradeId
};
try
{
var response = await apiClient.CreateOrder(accountId, request);
return response;
}
catch (RequestFailedException ex)
{
Console.WriteLine($"{ex.ResponseContent}");
return null;
}
}
It keeps throwing the following exception
{"errorMessage":"Invalid value specified for 'order.tradeID'","errorCode":"oanda::rest::core::InvalidParameterException"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions