标签: betfair

语句必须用换行符或分号分隔

我实际上使用与官方Betfair Developer示例相同的代码,唯一的区别是我放置了APP_KEY_HERESESSION_TOKEN数据。

但与该网站不同的是,Visual Studio Code它在终端中给我一个错误和崩溃。

在此输入图像描述

终端响应:

line 11
    print json.dumps(json.loads(response.text), indent=3)
          ^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)

https://docs.developer.betfair.com/display/1smk3cen4v3lu3yomq5qye0ni/Getting+Started

在此输入图像描述

我缺少什么以及我需要改变什么来解决这个问题?

python betfair visual-studio-code

13
推荐指数
2
解决办法
10万
查看次数

不包含定义,也没有接受第一个类型参数的扩展方法

我已经查看了这个问题的一些解决方案,但它们似乎与我所遇到的不同.

我试图打电话的方法:

namespace BetfairAPI
{
    public class CBetfairAPI
    {
        public ArrayList placeBets(ArrayList betList, double stakeSize)
        {
            // code to betList maniplulate

            return betList;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我打电话的方法:

namespace Bot
{
    public partial class Form1 : Form
    {
            private void makeBets(MarketSummary mkt, double odds, double stakeAmt)
            {
                ArrayList betList = new ArrayList();

                // code to build "betList"

                ArrayList bets = MyBetfair.placeBets(betList, stakeAmt);

            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我收到的错误:

错误1'BetfairAPI.CBetfairAPI'不包含'placeBets'的定义,
并且没有可以找到接受类型'BetfairAPI.CBetfairAPI'的第一个参数的扩展方法'placeBets'(您是否缺少using指令或程序集引用?)

我在CBetfairAPI类中使用任何其他方法都没有问题.如果我执行"CBetfairAPI",则placeBets()不会出现在Visual Studio的下拉菜单中.(所有其他方法和领域都这样做).

谢谢你的帮助.

c# betfair

8
推荐指数
1
解决办法
9万
查看次数

有没有人有c#代码来使用betfair api?

我正在创建ac#windows应用程序,使用betfair exchange webservice显示当前的体育市场价格,我使用了

getmarketpricescompressed()

返回如下所示的价格字符串的方法:

106093239~GBP~ACTIVE~0~1~~true~5.0~1343114432333~~N:7337~1~6992.56~2.16~~~false~~~~|2.16~1036.19~L~1~2.14~97.18~L~2~2.12~5.0~L~3~|2.18~467.36~B~1~2.2~34.12~B~2~2.22~162.03~B~3~:414464~2~102181.96~1.86~~~false~~~~|1.85~2900.33~L~1~1.84~1831.59~L~2~1.83~1593.73~L~3~|1.86~58.83~B~1~1.87~1171.77~B~2~1.88~169.15~B~3~
Run Code Online (Sandbox Code Playgroud)

我不知道如何正确解压缩此字符串,因为我现在使用此代码:

GetMarketPricesCompressedReq price_req1 = new GetMarketPricesCompressedReq();
            price_req1.header = header2;
            price_req1.marketId = marketid_temp;
            price_req1.currencyCode = "GBP";
            GetMarketPricesCompressedResp price_resp = new GetMarketPricesCompressedResp();
            price_resp = bfg2.getMarketPricesCompressed(price_req1);
            //MessageBox.Show(price_resp.errorCode.ToString());
            //richTextBox1.Text = "";
            //richTextBox1.Text = price_resp.marketPrices;
            string prices = price_resp.marketPrices;
            richTextBox1.Text = price_resp.marketPrices;
            string[] ab1 = prices.Split('|');
            string[] temp = ab1[1].Split('~');
            textBox3.Text = temp[0];
            textBox4.Text = temp[4];
            textBox5.Text = temp[8];
            temp = ab1[2].Split('~');
            textBox6.Text = temp[0];
            textBox7.Text = temp[4];
            textBox8.Text = temp[8];
            temp = ab1[3].Split('~');
            textBox9.Text = temp[0];
            textBox10.Text = …
Run Code Online (Sandbox Code Playgroud)

c# betfair

6
推荐指数
1
解决办法
2547
查看次数

编写C++ SOAP(多线程)客户端应用程序 - 没有gSOAP

我正在编写一个多线程C++(Linux)SOAP客户端来与Betfair API进行交互.我最初试图掌握gSOAP,但我无法使用多个WSDL文件使其正常工作,所以我暂时放弃了.我已经实现了自己的类来存储数据和使用RapidXML解析/生成XML - 我唯一需要建议的是用于HTTPS传输方面的内容.我已经使用OpenSSL和libcurl实现了一些初始测试应用程序,这些工作正常,但我遇到了多线程方面的一些问题,它们比C++更多C,而且老实说我正在寻找一些更新的东西.所以我的问题是 - 如果我从头开始重写,那么用于处理HTTPS传输的最佳工具是什么.我研究了以下几种可能性

  1. OpenSSL(已实施)
  2. libcurl(已实施)
  3. boost :: asio库(没试过,因为我还没有涉及Boost)
  4. 尝试使用套接字编程自己完成所有这一切(不热衷于这种方法)
  5. 试着强调gSOAP并浏览网页,以便让它发挥作用.
  6. 我还没有遇到过完全不同的东西.

基本上,鉴于上述情况,有人会建议在稳定性能和最小多线程问题方面使用最佳方法吗?或者有任何人有任何上述任何表现不佳的经验,并会阻止我使用它?我们将非常感激地提出任何建议和意见.

c++ linux https soap betfair

5
推荐指数
1
解决办法
4229
查看次数

为来自远程 api 的字典定义 elasticsearch 映射

我正在从betfair api-ng 获取marketcatalogue 数据,我想将其存储到elasticsearch (v1.4.4) 中。

来自API的数据包含大量属性和复杂类型。有一个名为runners的复杂类型,其中包含相关数据和Dictionary<string,string>. 我想定义这样的映射,以便它将数据存储在 Elasticsearch 中。示例映射如下:

"marketcatalogue" :{
    "properties":{
        "marketId":{"type":"string", "index": "not_analyzed" },
        "marketName":{"type":"string", "analyzer":"keylower" },
        "isMarketDataDelayed":{"type","boolean"},
        "description":{
            "persistenceEnabled":{"type","boolean"},
            "bspMarket":{"type","boolean"},
            "marketTime":{"type" : "date","format":"dateOptionalTime"},
            "suspendTime":{"type" : "date","format":"dateOptionalTime"},
            "settleTime":{"type" : "date","format":"dateOptionalTime"},
            "bettingType":{"type":"integer"},
            "turnInPlayEnabled":{"type","boolean"},
            "marketType":{"type":"string", "analyzer":"keylower" },
            "regulator":{"type":"string", "analyzer":"keylower" },
            "marketBaseRate":{"type":"double"},
            "discountAllowed":{"type","boolean"},
            "wallet":{"type":"string", "analyzer":"keylower"},
            "rules":{"type":"string"},
            "rulesHasDate":{"type","boolean"},
            "clarifications":{"type":"string"}
        },
        "runners":{
            "selectionId":{"type":"long"},
            "runnerName":{"type":"string", "analyzer":"keylower"},
            "handicap":{"type":"double"},
            "metadata":{

            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

}

元数据来自API Dictionary<string,string>,它可以包含以下数据:

<"TRAINER_NAME", "John">, <"WEARING", "Wearing one">,....
Run Code Online (Sandbox Code Playgroud)

将数据存储到类型中并不是什么大问题,但问题是如何定义字典的映射。

任何帮助都会节省我大量的时间,并使我能够更好地学习地图创建。

提前致谢。

c# dictionary betfair elasticsearch

5
推荐指数
1
解决办法
8559
查看次数

每15秒后获得一次

即使在我的专用服务器上,我也无法将cron时间设置为不到1分钟.我需要它每15秒运行一次因为它调用betfair api并且计算高度依赖于时间.请指教.

php hosting cron dedicated betfair

4
推荐指数
2
解决办法
7429
查看次数

我和betfair服务器之间的时差

我和betfair服务器时间差异大约为38-40秒.我不想在我的时间里使用一些dec/inc来管理.我希望与betfair服务器时间同步.请帮忙.

php time betfair

3
推荐指数
1
解决办法
619
查看次数

有没有办法在自定义 WHERE 子句完成时跳出 LINQ SELECT

我有一个 LINQ 语句,它使用自定义函数在压缩字符串中查找某些匹配的数据。

只有一场比赛,如果我做了一个 FOR 循环,我会在找到数据后添加一个“中断”。但是,使用 LINQ 似乎会遍历所有记录以查找是否需要匹配(从 SQL/子集的角度来看这是有道理的)但是我想知道是否有办法使 LINQ 语句在完成时中断WHERE 子句,以便它在找到单个匹配项后不必继续搜索匹配记录。

我可以重新编写所有内容以使用 FOR 循环,但我想知道是否有一种方法可以限制 LINQ 语句在条件匹配的情况下在 X 次迭代后停止搜索。

代码如下

    IEnumerable<MarketDataType> queryMarkets =
            from m in Mdata
            where !String.IsNullOrEmpty(m)
            let field = m.Split('~')
            where (MatchMarket(field[5], BaseDate.AddMilliseconds(DaylightSavings + Convert.ToDouble(field[4])), field[1], racecourse, racedatetime, marketType))
            select new MarketDataType()
            {
                marketId = Convert.ToInt32(field[0]),
                marketName = field[1].Replace(ColonCode, ":"),
                marketType = field[2],
                marketStatus = field[3],
                eventDate = BaseDate.AddMilliseconds(DaylightSavings + Convert.ToDouble(field[4])),
                menuPath = field[5].Replace(ColonCode, ":"),
                eventHeirachy = field[6],
                betDelay = Convert.ToInt32(field[7]),
                exchangeId = Convert.ToInt32(field[8]),
                countryCode = field[9], …
Run Code Online (Sandbox Code Playgroud)

.net c# linq ienumerable betfair

3
推荐指数
1
解决办法
5195
查看次数

通用参数错误

嗨我试图修复此代码,以便编译,无法找到方法

错误:

Pro\AGeeksToy\Controls\LadderHeader.cs(218,98):错误CS0426:类型名称'menuData'在类型'AGeeksToy.CoreDataTypes.AGeeksToyToolStripMenuItem>中不存在

这是错误.

   private void ChangeStakingType(AGeeksToyToolStripMenuItem<EnhancedType<StakingTypeEnum>>.menuData newType)
    {
        this.StakeBox.StakingType.Value = newType.Data.Value;
    }
Run Code Online (Sandbox Code Playgroud)

AGeeksToyToolStripMenuItem类代码:

  namespace AGeeksToy.CoreDataTypes
{
    using System;
    using System.Windows.Forms;

    public abstract class AGeeksToyToolStripMenuItem<T> : ToolStripMenuItem, AGeeksToyMenu
    {
        public MouseButtons LastMouseButton;
        public MenuData<T> menuData;
        public static readonly VoidEventWithParam<MenuData<T>> RightClicked;

        static AGeeksToyToolStripMenuItem()
        {
            AGeeksToyToolStripMenuItem<T>.RightClicked = new VoidEventWithParam<MenuData<T>>();
        }

        protected AGeeksToyToolStripMenuItem(T obj, string text) : this(obj, text, null)
        {
        }

        protected AGeeksToyToolStripMenuItem(T obj, string text, Control ctrl)
        {
            base.DropDown.ImageList = IconManager.m_ImageList;
            this.menuData = new MenuData<T>(obj, ctrl);
            this.Text = text;
        }

        protected …
Run Code Online (Sandbox Code Playgroud)

c# reflector betfair

-3
推荐指数
1
解决办法
520
查看次数