Moved streaming.py into data directory. Modified how trading.py and backtest.py behave so that the price streaming is fixed.
This commit is contained in:
@@ -42,12 +42,13 @@ class OANDAExecutionHandler(ExecutionHandler):
|
||||
return httplib.HTTPSConnection(self.domain)
|
||||
|
||||
def execute_order(self, event):
|
||||
instrument = "%s_%s" % (event.instrument[:3], event.instrument[3:])
|
||||
headers = {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Authorization": "Bearer " + self.access_token
|
||||
}
|
||||
params = urllib.urlencode({
|
||||
"instrument" : event.instrument,
|
||||
"instrument" : instrument,
|
||||
"units" : event.units,
|
||||
"type" : event.order_type,
|
||||
"side" : event.side
|
||||
|
||||
Reference in New Issue
Block a user