Jump to content
  • 2

Rest calls intermittent forbidden responses


svb

Question

Hi,

C# : use combination of REST & streaming. Replicated using WPF example that you can download in labs.

This issue is specific to REST

Every 15 minutes I get 15 min prices for a range of epics. My allowance is fine with +6500 left. 

I keep getting random null responses with "forbidden" status code. Different epics. If I trap null response and then set rest call to execute again, it works. I continue and it carried on with rest of epics, or will do say 10 , return forbidden for 3 and then return fine for epics following that. if I step through each epic, its fine. So seems to be some timing glitch. Tried trapping and adding task.delays and retries, but still null. I have to actually break and step over. Given its not my allowance, are there any quirks with REST calls to cause this? This is example, does some, throws forbidden and then fine for AUDCAD again.

persist 15: 17/03/2021 22:15:01 - CS.D.CADJPY.TODAY.IP
persist 15: 17/03/2021 22:15:01 - CS.D.CADCHF.TODAY.IP
persist 15: 17/03/2021 22:15:01 - CS.D.EURAUD.TODAY.IP
response is null for CS.D.NZDJPY.TODAY.IP 15
response is null for CS.D.NZDUSD.TODAY.IP 15
response is null for CS.D.CHFJPY.TODAY.IP 15
response is null for CS.D.USCGC.TODAY.IP 15
response is null for CC.D.CL.USS.IP 15
persist 15: 17/03/2021 22:15:01 - CS.D.AUDCAD.TODAY.IP

I cannot replicate forbidden status response in REST companion for any epic either, just seems when run via rest client

Thanks

Edited by svb
add note about running in companion
  • Like 2
Link to comment

8 answers to this question

Recommended Posts

  • 0

improved it by making sure rest calls aren't async and also putting 2 second wait before each call (1 second is not enough and I get more forbidden responses). For what I'm doing this is ok-ish, but not great. Given this is the rest client returning this and not my code I'm not sure what's changed i.e account, service validation. If anyone has any ideas that would be much appreciated,

the wait I added,

 

    foreach (var market in MarketList)
                        {
                            try
                            {
                                Thread.Sleep(2000);

                                response = await igRestApiClient.priceSearchByNumV2(market, "HOUR", "2");

                                if (response != null)

and the results. only 2 had issues this time, even with 2 second wait. with 1 second I get a lot more.

time: 18/03/2021 11:58:01
time: 18/03/2021 11:59:01
time: 18/03/2021 12:00:01
persist 15: 18/03/2021 12:00:01 - CS.D.AUDUSD.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.EURCHF.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.EURGBP.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.EURJPY.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.EURUSD.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.GBPUSD.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.USDCAD.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.USDCHF.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.USDJPY.TODAY.IP
persist 15: 18/03/2021 12:00:01 - IX.D.DOW.DAILY.IP
persist 15: 18/03/2021 12:00:01 - IX.D.NASDAQ.CASH.IP
persist 15: 18/03/2021 12:00:01 - IX.D.SPTRD.DAILY.IP
persist 15: 18/03/2021 12:00:01 - IX.D.DAX.DAILY.IP
persist 15: 18/03/2021 12:00:01 - IX.D.FTSE.DAILY.IP
persist 15: 18/03/2021 12:00:01 - CC.D.DX.USS.IP
persist 15: 18/03/2021 12:00:01 - CS.D.USCSI.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.AUDJPY.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.AUDCHF.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.GBPAUD.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.GBPCAD.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.EURCAD.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.USDMXN.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.GBPJPY.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.CADJPY.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.CADCHF.TODAY.IP
response is null for CS.D.EURAUD.TODAY.IP 15
persist 15: 18/03/2021 12:00:01 - CS.D.NZDJPY.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.NZDUSD.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.CHFJPY.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CS.D.USCGC.TODAY.IP
persist 15: 18/03/2021 12:00:01 - CC.D.CL.USS.IP
persist 15: 18/03/2021 12:00:01 - CS.D.AUDCAD.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.AUDUSD.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.EURCHF.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.EURGBP.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.EURJPY.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.EURUSD.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.GBPUSD.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.USDCAD.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.USDCHF.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.USDJPY.TODAY.IP
persist 60: 18/03/2021 12:00:01 - IX.D.DOW.DAILY.IP
persist 60: 18/03/2021 12:00:01 - IX.D.NASDAQ.CASH.IP
persist 60: 18/03/2021 12:00:01 - IX.D.SPTRD.DAILY.IP
persist 60: 18/03/2021 12:00:01 - IX.D.DAX.DAILY.IP
persist 60: 18/03/2021 12:00:01 - IX.D.FTSE.DAILY.IP
persist 60: 18/03/2021 12:00:01 - CC.D.DX.USS.IP
persist 60: 18/03/2021 12:00:01 - CS.D.USCSI.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.AUDJPY.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.AUDCHF.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.GBPAUD.TODAY.IP
response is null for CS.D.GBPCAD.TODAY.IP 60
persist 60: 18/03/2021 12:00:01 - CS.D.EURCAD.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.USDMXN.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.GBPJPY.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.CADJPY.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.CADCHF.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.EURAUD.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.NZDJPY.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.NZDUSD.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.CHFJPY.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CS.D.USCGC.TODAY.IP
persist 60: 18/03/2021 12:00:01 - CC.D.CL.USS.IP
persist 60: 18/03/2021 12:00:01 - CS.D.AUDCAD.TODAY.IP
time: 18/03/2021 12:03:01

 

Link to comment
  • 0

Thanks for your response, svb. It looks like my problem is indeed an allowance problem but I have been seeing the same intermittent issues as you with various waits/pauses affecting it (I found I needed 2.5 seconds to make a consistent difference).

When I do historical price search from the API companion, all I get back is this: errorCode": "error.public-api.exceeded-account-historical-data-allowance. I can't see that meta data that you reference. Are you able to see this when you use the companion? Are you using a historical price request?

Thanks

Link to comment
  • 0

For what it's worth... I too get forbidden responses from the REST API and I too retry the Price request and then it usually works. In fact, I retry up to 10 times as sometimes it gives me forbidden repeatedly. It can happen getting Navigation Nodes as well as Prices. It isn't allowance and looks to me more like something server-side e.g. bandwidth throttling perhaps? I just retry failed requests in a loop and haven't figured out any proper fix but the retry loop works fine so not a big problem

Link to comment
  • 0

Hello everyone,
I add to the problem, until last week everything was working great. This week the api returns errorCode: null in any type of call. Not only with prices, also obtaining markets, and even opening the session. It seems to me a somewhat dirty solution to retry in all calls, and that increases the operation time of my algorithms, making it unsafe

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • General Statistics

    • Total Topics
      23,661
    • Total Posts
      97,127
    • Total Members
      44,212
    • Most Online
      7,522
      10/06/21 10:53

    Newest Member
    MyTresor
    Joined 08/12/23 08:02
  • Posts

    • GBPUSD Elliott Wave Analysis Trading Lounge Day  Chart, 8 December 23 British Pound/U.S.Dollar (GBPUSD) Day Chart GBPUSD Elliott Wave Technical Analysis Function: Trend Mode: impulsive Structure: red wave 5 of 3 Position:  black wave 3 Direction;Next Higher  Degrees: red wave 5(started) Details:red wave 4 of blue wave 3 looking completed at 1.25442 Now wave red 5 of 3 is in play . Wave Cancel invalid level: 1.25092 The "GBPUSD Elliott Wave Analysis Trading Lounge Day Chart" for 8 December 23, provides an in-depth examination of the British Pound/U.S. Dollar (GBPUSD) currency pair within a daily timeframe. Employing Elliott Wave principles, the analysis aims to offer traders comprehensive insights into the current market trends, corrective phases, and potential upcoming movements. The identified "Function" of the market is classified as a "Trend," signaling a primary focus on understanding and profiting from the existing directional movement. Recognizing and aligning with the prevailing trend is a fundamental principle in technical analysis. The market "Mode" is characterized as "impulsive," suggesting a phase dominated by strong and decisive price movements. Impulsive phases often signify the main trend, providing traders with opportunities to capitalize on substantial directional moves. The primary "Structure" is labeled as "red wave 5 of 3," indicating the ongoing impulsive wave within the broader Elliott Wave sequence. Understanding the structure is crucial for traders to contextualize the current phase within the larger market trend. The specified "Position" is denoted as "black wave 3," offering insights into the current wave count within the overarching Elliott Wave framework. This knowledge assists traders in assessing the potential risks and rewards associated with their trades. In terms of "Direction; Next Higher Degrees," the projection is "red wave 5 (started)," implying the commencement of the fifth impulsive wave within the larger Elliott Wave structure. This forward-looking perspective aids traders in preparing for potential future market movements. The "Details" section highlights that "red wave 4 of blue wave 3" is considered completed at 1.25442. This signifies the end of a corrective phase within the context of the third wave, with "red wave 5 of 3" now in play, indicating a potential resumption of the overall trend. The "Wave Cancel invalid level" is identified as "1.25092." This level is critical as it represents a point at which the current wave count would be invalidated, prompting a reassessment of the prevailing market conditions. In summary, the GBPUSD Elliott Wave Analysis for the Day Chart on 8 December 23, indicates an impulsive phase labeled as "red wave 5 of 3." The analysis provides insights into the wave structure, position, expected next wave, and a crucial level for potential wave cancellation within the broader trend. Traders can leverage this information to make informed decisions aligned with the prevailing market dynamics. Technical Analyst : Malik Awais Source : Tradinglounge.com get trial here!    
    • GBPUSD Elliott Wave Analysis Trading Lounge 4 Hour  Chart, 8 December 23 British Pound/U.S.Dollar (GBPUSD) 4 Hour Chart GBPUSD Elliott Wave Technical Analysis Function: Trend Mode: impulsive Structure: red wave 5 of 3 Position:  black wave 3 Direction;Next Higher  Degrees: red wave 5(started) Details:red wave 4 of blue wave 3 looking completed at 1.25442 Now wave red 5 of 3 is in play . Wave Cancel invalid level: 1.25092 The "GBPUSD Elliott Wave Analysis Trading Lounge 4 Hour Chart" dated 8 December 23, provides a detailed analysis of the British Pound/U.S. Dollar (GBPUSD) currency pair within a four-hour timeframe. Utilizing Elliott Wave principles, the analysis aims to offer traders insights into the current market trends, corrections, and potential future movements. The identified "Function" of the market is labeled as "Trend," emphasizing a focus on recognizing and capitalizing on the existing directional movement. This aligns with the broader goal of understanding and trading in the direction of the prevailing trend. The market "Mode" is characterized as "impulsive," indicating a dominant phase of strong and decisive price movements. Impulsive phases are often associated with the main trend and can present lucrative trading opportunities for those looking to ride strong directional moves. The primary "Structure" is identified as "red wave 5 of 3," providing information about the ongoing impulsive wave within the larger Elliott Wave structure. This is crucial for traders to comprehend the current phase within the broader market context. The specified "Position" is denoted as "black wave 3," offering insights into the current wave count within the overarching Elliott Wave sequence. Understanding the current position helps traders assess the potential risk and reward of their trades. In terms of "Direction; Next Higher Degrees," the projection is "red wave 5 (started)," indicating that the fifth impulsive wave within the larger structure has begun. This provides a forward-looking perspective for traders preparing for potential market movements. The "Details" section highlights that "red wave 4 of blue wave 3" is considered completed at 1.25442. This suggests the end of a corrective phase within the context of the third wave, with "red wave 5 of 3" now in play, signifying a potential resumption of the overall trend. The "Wave Cancel invalid level" is identified as "1.25092." This level is crucial as it represents a point at which the current wave count would be invalidated, prompting a reevaluation of the prevailing market conditions. In summary, the GBPUSD Elliott Wave Analysis for the 4 Hour Chart on 8 December 23, indicates an impulsive phase labeled as "red wave 5 of 3." The analysis provides insights into the wave structure, position, expected next wave, and a crucial level for potential wave cancellation within the broader trend. Traders can leverage this information to make informed decisions aligned with the prevailing market dynamics. Technical Analyst : Malik Awais Source : Tradinglounge.com get trial here!    
    • Elliott Wave Analysis TradingLounge Daily Chart, 8 December 23, Theta Token/ U.S. dollar(THETAUSD) THETAUSD Elliott Wave Technical Analysis Function: Counter trend Mode: Corrective Structure: Flat Position: Wave (2) Direction Next higher Degrees: wave ((2)) of Impulse Wave Cancel invalid Level: Details: Retracement of wave ((2)) usually .50 or .618 x Length wave ((1)) Theta Token/ U.S. dollar(THETAUSD)Trading Strategy : Overall, Theta Token is still in an uptrend but is undergoing a correction in Wave 2, which we expect to be a flat correction. We are still missing one more move in the downside direction of Wave C. There is a trend. Support area 0.801. Theta Token/ U.S. dollar(THETAUSD)Technical Indicators: The price is above the MA200 indicating an Uptrend, Wave Oscillators a Bullish Momentum. TradingLounge Analyst: Kittiampon Somboonsod, CEWA Source : Tradinglounge.com get trial here!         Elliott Wave Analysis TradingLounge 4H Chart, 8 December 23, Theta Token/ U.S. dollar(THETAUSD) THETAUSD Elliott Wave Technical Analysis Function: Counter trend Mode: Corrective Structure: Flat Position: Wave (2) Direction Next higher Degrees: wave ((2)) of Impulse Wave Cancel invalid Level: Details: Retracement of wave ((2)) usually .50 or .618 x Length wave ((1)) Theta Token/ U.S. dollar(THETAUSD)Trading Strategy : Overall, Theta Token is still in an uptrend but is undergoing a correction in Wave 2, which we expect to be a flat correction. We are still missing one more move in the downside direction of Wave C. There is a trend. Support area 0.801. Theta Token/ U.S. dollar(THETAUSD)Technical Indicators: The price is above the MA200 indicating an Uptrend, Wave Oscillators a Bullish Momentum.    
×
×
  • Create New...
us