Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support the 'distance' parameter #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

support the 'distance' parameter #147

wants to merge 1 commit into from

Conversation

hootnot
Copy link
Owner

@hootnot hootnot commented Jul 7, 2019

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 !

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 99.288% when pulling 2ea92ee on distance-param into f300734 on master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 99.288% when pulling 2ea92ee on distance-param into f300734 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 99.288% when pulling 2ea92ee on distance-param into f300734 on master.

@fdwillis
Copy link

fdwillis commented Dec 3, 2021

merge?

@fdwillis
Copy link

fdwillis commented Dec 3, 2021

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?

@hootnot
Copy link
Owner Author

hootnot commented Dec 3, 2021

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?

@fdwillis
Copy link

fdwillis commented Dec 20, 2021

@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?

Screen Shot 2021-12-20 at 12 49 55 PM

distance for trailing stops are off (only on JPY)
units when partially closing a position are off (only on JPY)

I cant understand why

@hootnot
Copy link
Owner Author

hootnot commented Dec 20, 2021

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

@fdwillis
Copy link

@hootnot this is the gem im using for a 100% pure ruby on rails project. any other suggestions?

@hootnot
Copy link
Owner Author

hootnot commented Dec 21, 2021

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!

Repository owner deleted a comment Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants