Questions tagged [oanda]

OANDA is a forex broker enabling you to trade over 90 currency pairs, metals, and CFDs. Use with questions about Oanda REST API. Always use the programming language with this tag.

9 questions
1
vote
1 answer

Create Oanda Order Using httr::POST

I am trying to create a market order on Oanda using httr::POST and am receiving a status code 415 error and the order is not being created. No expert here so please help me see what I am doing wrong. Documentation from Oanda on API requests can be…
rlangton
  • 11
  • 2
1
vote
2 answers

Looping through a data range to download data from an API

I am downloading data from an API, the maximum look back period is 833 days, but from my testing I know they have data going back to 2002. I have a function below that defines 833 days from today into the two date times "end" and "start", these are…
1
vote
0 answers

Cannot close trade successfully with Oanda Api

I am using the following code for request: import requests import print import json api_key = "XXX-XXX" api_version = 'v3' accountID = "XXX" tradeID = "XX" #Endpoint Parts api_base_url = f"https://api-fxpractice.oanda.com/" key_url =…
John Doe
  • 47
  • 6
0
votes
0 answers

Why is tpqoa's stream_data freezing after fetching just one tick from Oanda?

I'm trying to use tpqoa to build my own automated bot to trade on Oanda. But the stream_data method keeps freezing after just getting one tick. Attached is the screenshot of my Jupyter Notebook, which has been frozen for almost an hour. Why is this…
0
votes
0 answers

Volume of trades using oanda API

Hello im quite new to python / oanda trading platform Im trying to determine the times where trade volumes are highest to reduce trading costs My imported libraries are as follows: import pandas as pd import numpy as np import tpqoa import…
0
votes
1 answer

Pinescript - Re-initialize alert variable

I am trying to do something very basic in Pine, but I am completely stumped on how to solve the issue. In summary I have an alert which need to update a fixed price level on a user input. The alert places an order on the chart, and I can update the…
Barney
  • 13
  • 3
0
votes
1 answer

Oanda API - Issue Price - Instruments

I'm using Oanda API to automate Trading strategies, I have a 'price' error that only occurs when selecting some instruments such as XAG (silver), my guess is that there is a classification difference but Oanda is yet to answer on the matter. The…
Bigali33
  • 1
  • 1
0
votes
1 answer

Python if statement executes but condition false

As the subject says, I have some live trading code, in Python. I had been using it successfully for well over a week before my issue began. Suddenly, yesterday morning, when my code began running, it would open trades and close them almost as soon…
0
votes
1 answer

ModuleNotFoundError: No module named 'common.config' oanda api python

I am trying to connect to Oanda REST API using juypter notebook with the following code: #!/usr/bin/env python import sys import select import argparse import common.config from .account import Account def main(): """ Create an API…