Closed streetgainer closed 4 years ago
This is a message from the v20 interface of OANDA. The message is pretty clear I would say! Pls do your homework before posting an issue....1.12247999999999 is far too long don' t you think ?
Pls. post usage questions on a site like stackoverfow
I will close this issue
FWIW: you can make use of oandapyV20.types (check the docs!)
>>> import oandapyV20.types as tp
>>> takeProfit = 1.12247999999999
>>> print(tp.PriceValue(takeProfit).value)
1.12248
You closed the issue but never read my question towards the bottom of the original post, which was:
Can anyone shed some light as to why the padding of the 9's are showing up even though I have a round(takeProfit,5) for the price key in the data object?
In other words, the 9's are showing up despite the fact that I have the round(takeProfit,5)
in the data object.
You asked question that has nothing to do with the library:
round
or the python round
?It is up to you to tackle your issues. If you find one and you are pretty sure it is my lib your are welcome to drop the issue.
You closed the issue but never read my question towards the bottom of the original post, which was:
Can anyone shed some light as to why the padding of the 9's are showing up even though I have a round(takeProfit,5) for the price key in the data object?
In other words, the 9's are showing up despite the fact that I have the
round(takeProfit,5)
in the data object.
I had the same question long time back and finally figured out its not the issue with the library nor the Oanda system. If you see the API blueprint, the price field need to be passed as string instead decimal or float. Alternatively you can make use of tp.PriceValue as part of the library which converts to string.
@hootnot is pretty rude. Calm down buddy.
Thanks @msarm - that definitely did the trick.
My
OrderCreate
data
object is:I am continuously getting this error:
failed [400,{"orderRejectTransaction":{"type":"MARKET_ORDER_REJECT","rejectReason":"TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED","instrument":"EUR_USD","units":"80000","timeInForce":"FOK","positionFill":"DEFAULT","takeProfitOnFill":{"price":"1.12247999999999","timeInForce":"GTC"},...... ........."The Take Profit on fill specified contains a price with more precision than is allowed by the Order's instrument","errorCode":"TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED"}]
Can anyone shed some light as to why the padding of the 9's are showing up even though I have a
round(takeProfit,5)
for theprice
key in the data object?