Real account restAPI error message

I am getting an error message trying to pull candles data with my real FXCM account Token.
I spoke with the staff and they said that my restAPI is activated and they can’t see problems with my account.
I am new to coding, please help.

Hi @predator - do you have your token defined? I do not see it from the screenshot. In your user parameters, you will want to have a line that says token = your token for your account. It would like something like this where you enter your personal token:

USER PARAMETERS

token = ‘INSERT-TOKEN-HERE’
symbol = ‘GBP/USD’
timeframe = “m1” # (m1,m5,m15,m30,H1,H2,H3,H4,H6,H8,D1,W1,M1)
#############################

you can see step 4 of this article too: https://www.quantnews.com/algo-trading-rest-api-python-part-3-developing-live-strategy-template/

yes,my token is right. at the moment the code is working with my Demo token,but the real one is not authorised.

Try to revoke the token on the live account and regenerate it. Then use that token and make sure the server is set to ‘real’ at the end of your connection code. Typically revoking it will correct this.

Thank you.
Revoking worked.
I have one more question:

Is it possible to download Stoch indicator data?
if yes,what is the funcion call?

1 Like

I am glad that worked for you.

You can import the Stochastic indicator for backtesting and live strategies. The Python library pyti has a lot of technical indicators you can pull. After installing pyti, just use this code for stochastic:

from pyti.stochastic import percent_k
from pyti.stochastic import percent_d

You can find other indicators here:

Thank you so much.Very helpful :slight_smile:

You are welcome :slight_smile: *

deleted kdhkjdhkjhdkjhdkj

deleted #####################.