oanda-api-v20
oanda-api-v20 copied to clipboard
support the 'distance' parameter
Regarding #145 : Missing distance parameter on StopLossOrderRequest and StopLossDetails implemented
OANDA docs are not 100% clear about where the parameter is supported. The TakeProfitOrderRequest names distance in it's header but in the details nothing is found. Placing a TP-order using distance fails with an error.
I raised a question at OANDA regarding this: docs wrong or is it not implemented (yet)?
2019-07-17: update from OANDA: they are looking into this ...
2019-07-29: update from OANDA: this parameter is not public yet and may contain bugs. So it is not recommended to be used by any script or third-party application.
Bottomline: it can't be used in a TakeProfitOrderRequest !
Coverage increased (+0.009%) to 99.288% when pulling 2ea92ee661575c8a10b9b6f1cc861c8a777a6622 on distance-param into f300734238a6a3958e07e60456155fbc53748aa8 on master.
Coverage increased (+0.009%) to 99.288% when pulling 2ea92ee661575c8a10b9b6f1cc861c8a777a6622 on distance-param into f300734238a6a3958e07e60456155fbc53748aa8 on master.
Coverage increased (+0.009%) to 99.288% when pulling 2ea92ee661575c8a10b9b6f1cc861c8a777a6622 on distance-param into f300734238a6a3958e07e60456155fbc53748aa8 on master.
merge?
how to set trailing stop loss on JPY pairs? i have Trailing working for USD based pairs but fails at all JPY pairs when trying to do the same 15 pips in JPY like so (0.15 pips). suggestions?
Why ask me and not just try things? Please read the docs developer.oanda.com regarding orders. If you have it working for non-JPY pairs then x100 for JPY seems logical. "It fails" ... what fails with what error?
@hootnot i have
stopLossPrice = 0.0015
optionsTrail = {'trailingStopLoss' => {'timeInForce' => 'GTC','distance' => (oandaTickerUnderscore.downcase.include?('_jpy') ? (stopLossPrice * 100).round(2) : stopLossPrice.round(4))},}
updatedOrder = actingClient.account(accountToTrade).trade(openTrade['id'], optionsTrail).update
can anyone help?

distance for trailing stops are off (only on JPY)
units when partially closing a position are off (only on JPY)
I cant understand why
It looks like you run a Ruby interpreter, what does that have to do with my Python library ?
I think you are looking for: https://github.com/kobusjoubert/oanda_api_v20
but before you drop any questions, please do your homework
@hootnot this is the gem im using for a 100% pure ruby on rails project. any other suggestions?
You are asking Ruby related questions regarding my Python oandapyV20 (oanda-api-v20) which is something totally different from https://github.com/kobusjoubert/oanda_api_v20
So, we will end this discussion now!