Trade FOREX with FXCM

  • Award-Winning Platform
  • 24/7 Customer Support
  • Trade Directly on Charts
  • Free $50K Practice Account
Register


Results 1 to 4 of 4

Thread: Date and time questions

  1. #1
    panosd is offline Member
    Join Date
    Feb 2010
    Posts
    9

    Date and time questions

    Hello,

    Is there any way to get separate but directly date and time from fxcm when i'm trying to get history prices??? for example i want a datagrid with two columns one with date list and one with time. and if someone know how to get server default date and time format. thank's for your help in advance.

  2. #2
    panosd is offline Member
    Join Date
    Feb 2010
    Posts
    9
    i can get what i want by typing

    Code:
    Me.DataGridView1.Columns(1).DefaultCellStyle.Format = "d"
    Me.DataGridView1.Columns(2).DefaultCellStyle.Format = "HH:mm"
    but i was wondering if i can get this directly.

  3. #3
    Natalya is online now Member
    Join Date
    Apr 2009
    Posts
    749
    ForexConnect .NET uses DateTime data type. This type has methods to get a formatted date and time value ​​separately in rows.

    There are no individual fields in the objects that return a date and time strings separately (exception: O2GOfferRow.ValueDate). There is no standard type in .NET, that represents a date and time separately.

    Please see below the example on how to retrieve date and time from the DateTime type.
    Code:
    O2GResponseReaderFactory readerFactory = session.getResponseReaderFactory();
    O2GTablesUpdatesReader reader = readerFactory.createTablesUpdatesReader(e.Response);
    for (int ii = 0; ii < reader.Count; ii++)
    {
        O2GOrderRow order = reader.getOrderRow(ii);
        if (!order.AccountID.Equals(masterAccountId))
        {
            DateTime dt = order.StatusTime;
            Console.WriteLine("Orders tables updates: AccountID={0}, OrderStatus={1}, StatusDate={2}, StatusTime={3}", order.AccountID, order.Status, dt.ToShortDateString(), dt.ToShortTimeString());
        }
    }

  4. #4
    panosd is offline Member
    Join Date
    Feb 2010
    Posts
    9
    ok i see, thanks Natalya for your reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Disclaimer: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. Forex Capital Markets LLC. will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.