Closed 5harever closed 5 years ago
Hi, seen the error message it sounds like you already assigned client extensions with id myxxxx
to another trade.
I guess that if you request a listing of your (open) trades, you will find one having the tradeextensions you want to set. Change that data to something unique and try again.
data = {"clientExtensions" : {
"comment": "myComment",
"id": "myT160"
}
}
r = trades.TradeClientExtensions(accountID=accountID,tradeID=160,data=data)
client.request(r)
Dec-2
I just checked this on one of my open trades. There is NO issue at all. I bet that if you use:
r = trades.OpenTrade(accountID=accountID)
instead of:
r = trades.TradesList(accountID=accountID, params=params)
you will see another trade having the extension already that you want to set.
This is the kind of question that you can find the answer for yourself. It is not my task to provide free support on coding issues. If you find a bug that is different. So please invest more time yourself next time.
As you can see below, I have one trade of EUR_USD.
[IN]
[OUT]
Then, I would like to modify above trades' extension with trade id : 160, right?
[IN]
And what I got was:
[OUT]
V20Error: {"tradeClientExtensionsModifyRejectTransaction":{"type":"TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT","rejectReason":"CLIENT_TRADE_ID_ALREADY_EXISTS","tradeID":"160","tradeClientExtensionsModify":{"id":"myxxxxx","comment":"myComment"},"id":"192","accountID":"101-011-8015835-002","userID":8015835,"batchID":"192","requestID":"78532062367077888","time":"2018-12-01T03:05:39.625695065Z"},"relatedTransactionIDs":["192"],"lastTransactionID":"192","errorMessage":"The client Trade ID specifed is already assigned to another open Trade","errorCode":"CLIENT_TRADE_ID_ALREADY_EXISTS"}
It said "CLIENT_TRADE_ID_ALREADY_EXISTS".
I understood it but if I would like to modify some trades' extensions, the trade should be exist, right?
I think I must lose in some point.
Please kindly advise me.
Thank you very much.