Skip to content

Commit

Permalink
Merge pull request #140 from hootnot/doc-fix
Browse files Browse the repository at this point in the history
docfix
  • Loading branch information
hootnot authored Dec 29, 2018
2 parents 36772d2 + 8a5e0b2 commit f300734
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python
python:
- '2.7'
- '3.3'
- '3.4'
- '3.5'
- '3.6'
Expand Down
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ REST interface, see: http://developer.oanda.com/rest-live-v20/forexlabs-ep/.

Supported Python versions:

+-------------------+-----+-----+-----+-----+-----+------+
| Python | 2.7 | 3.3 | 3.4 | 3.5 | 3.6 | Pypy |
+===================+=====+=====+=====+=====+=====+======+
| **oanda-api-v20** | YES | YES | YES | YES | YES | YES |
+-------------------+-----+-----+-----+-----+-----+------+
+-------------------+-----+-----+-----+-----+------+
| Python | 2.7 | 3.4 | 3.5 | 3.6 | Pypy |
+===================+=====+=====+=====+=====+======+
| **oanda-api-v20** | YES | YES | YES | YES | YES |
+-------------------+-----+-----+-----+-----+------+


Interactive
Expand Down
9 changes: 4 additions & 5 deletions oandapyV20/contrib/requests/onfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,19 @@ def __init__(self,
>>> accountID = "..."
>>> client = API(access_token=...)
>>> # at time of writing EUR_USD = 1.0740
>>> # let us take profit at 1.10, GoodTillCancel (default)
>>> trailingStopLossOnFill = TrailingStopLossDetails(price=1.06)
>>> # add a trailing stoploss, at 50 pips GoodTillCancel (default)
>>> sld = 1.0740 - 1.0690
>>> trailingStopLossOnFill = TrailingStopLossDetails(distance=sld)
>>> print(trailingStopLossOnFill)
{
"timeInForce": "GTC",
"price": "1.10000"
"distance": "0.00500"
}
>>> ordr = MarketOrderRequest(
>>> instrument="EUR_USD",
>>> units=10000,
>>> trailingStopLossOnFill=trailingStopLossOnFill.data
>>> )
>>> # or as shortcut ...
>>> # ...OnFill=trailingStopLossDetails(price=1.06).data
>>> print(json.dumps(ordr.data, indent=4))
>>> r = orders.OrderCreate(accountID, data=ordr.data)
>>> rv = client.request(r)
Expand Down
2 changes: 1 addition & 1 deletion oandapyV20/endpoints/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class OrderReplace(Orders):
"""OrderReplace.
Replace an Order in an Account by simultaneously cancelling it and
createing a replacement Order.
creating a replacement Order.
"""

HEADERS = {"Content-Type": "application/json"}
Expand Down

0 comments on commit f300734

Please sign in to comment.