Obtener (O2GO, CS)

From FxCodeBaseWiki

(Redirected from Get MMR (O2GO, CS)/es)
Jump to: navigation, search

El ejemplo muestra cómo obtener el valor de MMR para un particular cuenta/oferta. La muestra imprime los valores de MMR para todas ofertas y todas cuentas.

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace Sample.MMR
    class Program
        static FXCore.CoreAut mCore;
        static FXCore.TradeDeskAut mDesk;        
        static void Main(string[] args)
                if (args.Length < 2)
                    Console.WriteLine("usage: sample.MMR.exe user password");
                //create an o2go object and log in                
                mCore = new FXCore.CoreAut();
                mDesk = (FXCore.TradeDeskAut)mCore.CreateTradeDesk("trader");                
                mDesk.Login(args[0], args[1], "http://www.fxcorporate.com", "Demo");
                //enumerate all accounts and offers, for each pair offer + account show the MMR value
                FXCore.TableAut accounts = (FXCore.TableAut)mDesk.FindMainTable("accounts");
                FXCore.TableAut offers = (FXCore.TableAut)mDesk.FindMainTable("offers");
                FXCore.TradingSettingsProviderAut tradingSettings = (FXCore.TradingSettingsProviderAut)mDesk.TradingSettingsProvider;
                foreach (FXCore.RowAut account in (FXCore.RowsEnumAut)accounts.Rows)
                    string account_id = (string)account.CellValue("AccountID");
                    Console.WriteLine("====Account {0}====", account_id);
                    foreach (FXCore.RowAut offer in (FXCore.RowsEnumAut)offers.Rows)
                        string instrument = (string)offer.CellValue("Instrument");
                        Console.WriteLine("The MMR for {0}: {1}", instrument, tradingSettings.GetMMR(instrument, account_id));
            catch (Exception e)
                Console.WriteLine("{0}", e.ToString());

Este Artí­culo en Otros Idiomas

Language: English  • Español
Personal tools