Jump to content
Sign in to follow this  
SirNewton

Real-time streaming and trading

Recommended Posts

Can we trade as soon as real-time streaming data of pair begins on Sunday (for my location), or is there a delay?

I noticed that the streaming data stopped at 23:59 GMT on Friday, will that always be the case?

What GMT time does trading start on Monday? 0:00 GMT? How about the start time for the streaming data?

The historical data covers 0:00 to 23:59 GMT of that day, correct? Is the complete historical data of that day available 0:00 GMT of the next day or is there a delay?

Do we make up the AuditID ourselves or is it provided? If we are provided, please explain from where? If we make it up, can it be anything or do we need to follow a specific pattern for the template? Would you suggest to change the AuditID per trade? Should it be different for each pair type and/or direction?

Is there a minimum or maximum API trade quantity?

Does the below JSON object look valid for a trade? Also, am I missing any key/value pairs? Subsequently, can I omit any key/value pairs?

    TradeJson = {
        "MarketId": str(marketID),
        "Currency": None,
        "AutoRollover": False,
        "Direction": str(direction),
        "Quantity": str(qty),
        "QuoteId": 0,
        "PositionMethodId": 0,
        "BidPrice": str(bidPrice),
        "OfferPrice": str(sellPrice),
        "AuditId": "str(auditID)",
        "TradingAccountId": str(tradingAccountID]),
        "IfDone": None,
        "Close": None,
        "Reference": None,
        "AllocationProfileId": 0,
        "OrderReference": None,
        "Source": None,
        "MarketName": str(pair),
        "PriceTolerance": 0
    }

Please note: "None" in Python is the similar to a "null" in other languages.

Share this post


Link to post

Hello SirNewton,

1) Yes, you can begin trading immediately upon a market opening. 

2) Live price streaming stops when a market closes. As far as I know all markets are closed by Friday 9pm GMT, although there may be exceptions I don't know about.

3) Different markets open at different times. There are many markets such as FX markets that open Sunday night at 10pm. Youu can always check the market open and close times for the markets you are interested in trading by making a GetMarketInformation call.

4) We maintain varying amounts of historical data depending upon the market and upon the timeframe. For example, for the most popular / major markets we store more historical data compared to some other markets. We also store a longer history for the longer timeframes, such as daily, weekly data etc. For intra-day data such as 5 minutes bars for example, we may store only a day or 2.  Each "day" is from midnight (00:00) to 23:59 GMT.

5) The historical data is available immediately. For example, a GetLatestPriceBars "daily" timeframe call for 1 bar will return yesterday's (Monday 8th Feb) complete bar, and today's (Tuesday 9th Feb) partial bar up to the moment at which the call was received. 

6) The AuditID is read from the live streaming Prices stream. There is a unique AuditId accompanying each price tick.     

7) The minimum and maximum trade quantities are set on a per market basis. You can find the min/max trade sizes for each market by making a GetMarketInformation call.

8) Your trade call appears to cover all the required fields. The NewTradeOrderRequestDTO specifies the fields and also which ones are nullable.

9) For Spot FX markets, 1000 is the minimum trade size. 

Kind Regards, PM

Share this post


Link to post

Hello Physicsman,

You said, "Live price streaming stops when a market closes. As far as I know all markets are closed by Friday 9pm GMT, although there may be exceptions I don't know about."

I noticed on Yahoo Financial, in most cases streaming data for FOREX ends at 12:00am CST Saturday.  GMT is 6 hours ahead of CST, that would put it Saturday 6:00 am GMT.

Are these afterhours trades? If so, can we participate in afterhours trade?  Is it possible to trade after the streaming data from lightstream (https://push.cityindex.com) stops?

Thank you.

Share this post


Link to post

Another question on streaming. We have Bid, Offer, and Price in the streaming. I read Price was the price of the last trade. Is that for both Bid trades and Offer trades? Because depending on the direction, there is a price difference.

Share this post


Link to post

Hi SirNewton,

1) I'm not sure where Yahoo Finance are receiving their streamed prices from for those hours. You can only trade with us in within our open market hours. The GetMarketInformation call can query for the market hours we are open for each market you are looking to trade.

2) The Price field in the Prices stream is the Mid price. So you can check for the Bid, Offer or Mid price as you prefer. 

Kind Regards, PM

Share this post


Link to post

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
Sign in to follow this  
×