public static void RemoveCurrencyNonIncluded(UpdateDropDownList ddl, Kraken.Currency[] currency) { if (ddl == null || ddl.Items == null || ddl.Items.Count <= 0 || currency == null || currency.Length <= 0) { return; } var list = currency.ToList(); for (int i = 0; i < ddl.Items.Count; i++) { var nvalue = Kraken.ToCurrency(ddl.Items[i].Value); if (nvalue == null || !nvalue.HasValue) { continue; } var value = nvalue.Value; if (!currency.Contains(value)) { ddl.Items.RemoveAt(i); RemoveCurrencyNonIncluded(ddl, currency); return; } } }
protected virtual void FinishEffect(Point3D p, Map map, Mobile from) { from.RevealingAction(); int count = GetSpawnCount(); for (int i = 0; map != null && i < count; ++i) { BaseCreature spawn; switch (Utility.Random(4)) { default: case 0: spawn = new SeaSerpent(); break; case 1: spawn = new DeepSeaSerpent(); break; case 2: spawn = new WaterElemental(); break; case 3: spawn = new Kraken(); break; } Spawn(p, map, spawn); spawn.Combatant = from; } Delete(); }
public void CalculateArbitrationTests_12() { ArbitrationHunter hunter = new ArbitrationHunter(null); Kraken kraken = new Kraken(); ArbitrationOpportunity opportunity; Bitstamp bitstamp = new Bitstamp(); OrderBook askBook = new OrderBook(); OrderBook bidBook = new OrderBook(); kraken.OrderBook = askBook; bitstamp.OrderBook = bidBook; //Test case 12: Part of ask order is fulfilled, not profitable after taking into account transfer fee //IMPORTANT NOTE! This test assumes Kraken has a trade fee of 0.0005, if that changes, this test *MIGHT* fail! kraken.TradeFee = 0.0m; bitstamp.TradeFee = 0.0m; askBook.Asks.Add(new Order(1.1m, 400.0m)); askBook.Asks.Add(new Order(0.8m, 402.0m)); askBook.Asks.Add(new Order(1.0m, 410.0m)); bidBook.Bids.Add(new Order(0.6m, 400.25m)); bidBook.Bids.Add(new Order(1.0m, 399m)); bidBook.Bids.Add(new Order(2.8m, 398m)); opportunity = hunter.CalculateArbitration(kraken, bitstamp, 99m, 999999m, 0.01m, true); //Make sure opportunity was not found, as it is not profitable when taking into account transfer fee Assert.IsTrue(opportunity == null); //Calculate arbitration again, but this time, don't take into account the transfer fee. An opportunity should be found this time. opportunity = hunter.CalculateArbitration(kraken, bitstamp, 99m, 999999m, 0.01m, false); Assert.IsTrue(opportunity != null); }
public void KrakenGetOpenOrdersTest() { Kraken kraken = new Kraken(); //If there is any problem connecting to the exchange, this will throw an error. List <Dictionary <string, dynamic> > openOrderList = kraken.GetAllOpenOrders(); }
public void KrakenAccountInformationUpdateTest() { Kraken kraken = new Kraken(); //If there is any problem connecting to the exchange, this will throw an error. kraken.UpdateBalances(); }
public void KrakenQueryOrderTest() { Kraken kraken = new Kraken(); //If there is a problem, this will throw an error. kraken.GetOrderInformation("O6HJVS-6SU7A-EX5TVD"); }
public void KrakenMinimumBuyTest_Price() { Kraken kraken = new Kraken(); //Amount doesn't do anything in this situation; just picked the minimum amount to be safe kraken.Buy(kraken.MinimumBitcoinOrderAmount, -1m); }
private static async Task MainAsync(string[] args) { Kraken kraken = new Kraken(krakenKey, krakenSecret, 2500); var time = await kraken.GetServerTimeAsync(); //var assets = await kraken.GetAssetInfoAsync(); //var assets = await kraken.GetAssetPairsAsync(); //var ticker = await kraken.GetTickerAsync("XXBTZEUR"); //var ohlc = await kraken.GetOHLCAsync("XXBTZEUR", 1440); //var orderbook = await kraken.GetOrderBookAsync("XXBTZEUR"); //var trades = await kraken.GetRecentTradesAsync("XXBTZEUR"); //var spread = await kraken.GetRecentSpreadAsync("XXBTZEUR"); //var accountBalance = await kraken.GetAccountBalanceAsync(); //var tradeBalance = await kraken.GetTradeBalanceAsync(); //var openOrders = await kraken.GetOpenOrdersAsync(); //var closedOrders = await kraken.GetClosedOrdersAsync(); //var orders = await kraken.QueryOrdersAsync(new string[] { "x" }); //var trades = await kraken.GetTradesHistoryAsync(); //var openPositions = await kraken.GetOpenPositionsAsync(new string[] { "x" }); //var ledgers = await kraken.GetLedgersAsync(); //var volume = await kraken.GetTradeVolumeAsync(new string[] { "XXBTZEUR", "XXBTZUSD" }, true); //var order = new KrakenOrder(); //order.Pair = "XXBTZEUR"; //order.Type = "buy"; //order.OrderType = "market"; //order.Volume = 0.01m; //order.Validate = true; //var result = await kraken.AddOrderAsync(order); //var depositMethods = await kraken.GetDepositMethodsAsync(asset: "ZEUR"); //var depositStatus = await kraken.GetDepositStatusAsync("ZEUR", "Fidor Bank AG (SEPA)"); }
public override void Create() { Name = "Island"; var water1 = new Water(); var water2 = new Water(); var water3 = new Water(); var earth = new Earth(); Elements = new Element[] { water1, water2, water3, earth }; foreach (var element in Elements) { element.Create(); } var kraken = new Kraken(); var leviathan = new Leviathan(); var merfolk1 = new Merfolk(); var merfolk2 = new Merfolk(); var merfolk3 = new Merfolk(); Creatures = new Creature[] { kraken, leviathan, merfolk1, merfolk2, merfolk3 }; foreach (var creature in Creatures) { creature.Create(); } }
public void GetTotalBalances() { ItBit itbit = new ItBit(); Anx anx = new Anx(); Bitstamp bitstamp = new Bitstamp(); Kraken kraken = new Kraken(); //Btce btce = new Btce(); Bitfinex bitfinex = new Bitfinex(); itbit.UpdateBalances(); anx.UpdateBalances(); bitstamp.UpdateBalances(); bitfinex.UpdateBalances(); //TODO: Fix these! Should be calls to UpdateTotalBalances! kraken.UpdateBalances(); //btce.UpdateBalances(); Decimal itBitBtcAmount = itbit.TotalBtc; Decimal itBitFiatAmount = itbit.TotalFiat; Decimal anxBtcAmount = anx.TotalBtc; Decimal anxFiatAmount = anx.TotalFiat; Decimal bitstampBtcAmount = bitstamp.TotalBtc; Decimal bitstampFiatoAmount = bitstamp.TotalFiat; Decimal bitfinexBtcAmount = bitfinex.TotalBtc; Decimal bitfinexFiatAmount = bitfinex.TotalFiat; //TODO Fix these! They should be the total amounts! Decimal krakenBtcAmount = kraken.AvailableBtc; Decimal krakenEurAmount = kraken.AvailableFiat; //Decimal btceBtcAmount = btce.AvailableBtc; //Decimal btceEuroAmount = btce.AvailableFiat; }
public void KrakenMinimumBuyTest_Amount() { Kraken kraken = new Kraken(); //Price doesn't do anything in this situation; just picked an absurdely low price to buy at kraken.Buy(kraken.MinimumBitcoinOrderAmount - 1, 1m); }
public void Setup() { _waterSpell = new WaterSpell(CardType.Spell, ElementType.Water, 20, "Nasser Spell", 0, 1); _kraken = new Kraken(CardType.Monster, ElementType.Water, 170, "Krakie dakie do whatcha gonna do", CardProperty.Kraken, 1); _goblinFire = new Goblin(CardType.Monster, ElementType.Fire, 100, "Gobster the Robster", CardProperty.Goblin, 1); _goblinNormal = new Goblin(CardType.Monster, ElementType.Normal, 100, "Gobster the Robster", CardProperty.Goblin, 1); }
public void CalculateArbitrationTests_23() { ArbitrationHunter hunter = new ArbitrationHunter(null); Kraken kraken = new Kraken(); ArbitrationOpportunity opportunity; Anx anx = new Anx(); OrderBook askBook = new OrderBook(); OrderBook bidBook = new OrderBook(); kraken.OrderBook = askBook; anx.OrderBook = bidBook; kraken.TradeFee = 0.25m; anx.TradeFee = 0.35m; askBook.Asks.Add(new Order(1.0m, 405.0m)); bidBook.Bids.Add(new Order(0.78m, 410.0m)); opportunity = hunter.CalculateArbitration(kraken, anx, 0.09m, 30.01m, 0.01m, false); //Make sure opportunity was found correctly Assert.IsTrue(opportunity != null); Assert.IsTrue(opportunity.BuyExchange == kraken); Assert.IsTrue(opportunity.SellExchange == anx); Assert.IsTrue(opportunity.BuyPrice == 405m); Assert.IsTrue(opportunity.SellPrice == 410m); Assert.IsTrue(opportunity.BuyAmount == 0.07391398m); Assert.IsTrue(opportunity.SellAmount == 0.07391398m); Assert.IsTrue(opportunity.TotalSellCost == 30.1986652387m); //Note, because Kraken rounds to 4 decimal places, the total buy cost and profit will be different that what is calculated on the sheet Assert.IsTrue(opportunity.TotalBuyCost == 30.01m); Assert.IsTrue(opportunity.Profit == 0.1886652387m); }
public void btnCompress_Click(object sender, EventArgs e) { try { if (CurrentNodeId > 0) { var result = Kraken.Compress(CurrentNodeId); if (result != null && result.success) { // Opslaan in Umbraco result.Save(); // Umbraco Media tree verversen Helper.refreshMediaSection(CurrentNodeId); } } } catch (KrakenException kex) { var ct = new umbraco.BasePages.ClientTools(Page); ct.ShowSpeechBubble(umbraco.BasePages.BasePage.speechBubbleIcon.error, "Optimization error", Helper.GetEnumDescription(kex.Status)); } catch (Exception kex) { var ct = new umbraco.BasePages.ClientTools(Page); ct.ShowSpeechBubble(umbraco.BasePages.BasePage.speechBubbleIcon.error, "Unexpected internal error", "Image could not optimized"); } }
public void createAllMonstercards() { ICard card1 = new Dragon(100); ICard card2 = new FireElf(60); ICard card3 = new WaterGoblin(40); ICard card4 = new Knight(80); ICard card5 = new Kraken(80); ICard card6 = new Ork(70); ICard card7 = new Wizard(90); Cardname desiredName1 = Cardname.Dragon; Cardname desiredName2 = Cardname.FireElf; Cardname desiredName3 = Cardname.WaterGoblin; Cardname desiredName4 = Cardname.Knight; Cardname desiredName5 = Cardname.Kraken; Cardname desiredName6 = Cardname.Ork; Cardname desiredName7 = Cardname.Wizard; Assert.AreEqual(desiredName1, card1.name); Assert.AreEqual(desiredName2, card2.name); Assert.AreEqual(desiredName3, card3.name); Assert.AreEqual(desiredName4, card4.name); Assert.AreEqual(desiredName5, card5.name); Assert.AreEqual(desiredName6, card6.name); Assert.AreEqual(desiredName7, card7.name); }
public void DecodeStepThrows(byte[] rawData, string message) { var kraken = new Kraken(); var exception = Assert.Throws <DecoderException>(() => kraken.Decompress(rawData, 393294)); Assert.Equal(message, exception.Message); }
public void KrakenMinimumSellTest_Amount() { Kraken kraken = new Kraken(); //Price doesn't do anything in this situation; just picked an absurdely high price to sell at kraken.Sell(kraken.MinimumBitcoinOrderAmount - 1, 99999m); }
public KrakenAttackState(Boss boss) : base(StateIds.Attacking, boss) { NextStateIds.Add(StateIds.Idle); NextStateIds.Add(StateIds.Stunned); NextStateIds.Add(StateIds.Hurt); random = new System.Random(); kraken = boss as Kraken; }
public override void TStart() { base.TStart(); kraken = this.transform.parent.GetComponent <Kraken>(); prefab = Resources.Load("Prefabs/Enemies/Kraken") as GameObject; tentacleAtk = GetComponent <TentacleAttack>(); initialHealth = stats.health; }
public Client(Kraken exchange, ICurrencyFactory currencyFactory, ISymbolFactory symbolFactory) { Exchange = exchange; CurrencyFactory = currencyFactory; SymbolFactory = symbolFactory; RateLimiter = new BinanceRateLimiter(); }
public void Constructor_WithParameters_ReturnsTrue() { //Arrange Kraken leviathan = new Kraken("KRAKEN", 800, element.WATER, 100); //Assert Assert.AreEqual(leviathan.Name, "KRAKEN"); }
public void KrakenMinimumTransferTest() { Kraken kraken = new Kraken(); //Give less than the minimum amount to ensure we can an error //Address isn't needed here, just give a random string kraken.Transfer(kraken.MinimumBitcoinWithdrawalAmount - 1, "fakeAddress"); }
public void Constructor_Base_ReturnsTrue() { //Arrange Kraken leviathan = new Kraken(); // Assert Assert.IsTrue(leviathan.Name == "Leviathan"); }
public void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { // Begin de installatie! Kraken.Install(); } }
private void FinishEffect(Point3D p) { int count = Utility.RandomMinMax(5, 7); if (Hue != 0x8A0) { count += Utility.RandomMinMax(1, 2); } Map map = this.Map; Leviathan lev = new Leviathan(); lev.MoveToWorld(p, map); for (int i = 0; map != null && i < count; ++i) { BaseCreature spawn; switch (Utility.Random(4)) { default: case 0: spawn = new SeaSerpent(); break; case 1: spawn = new DeepSeaSerpent(); break; case 2: spawn = new WaterElemental(); break; case 3: spawn = new Kraken(); break; } int x = p.X, y = p.Y; for (int j = 0; j < 20; ++j) { int tx = p.X - 5 + Utility.Random(11); int ty = p.Y - 5 + Utility.Random(11); Tile t = map.Tiles.GetLandTile(tx, ty); if (t.Z == p.Z && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, p.Z), map)) { x = tx; y = ty; break; } } spawn.MoveToWorld(new Point3D(x, y, p.Z), map); if (spawn is Kraken && 0.2 > Utility.RandomDouble()) { spawn.PackItem(new MessageInABottle(map == Map.Felucca ? Map.Felucca : Map.Trammel)); } } Delete(); }
public void KrakenUpdateTradeFeeTest() { Kraken kraken = new Kraken(); //If there is any problem connecting to the exchange, this will throw an error. kraken.SetTradeFee(); Assert.IsTrue(kraken.TradeFee > 0); }
void Start() { checkpointTitles.Add("Arrival to the Floe"); checkpointTitles.Add("Ice Corridors"); checkpointTitles.Add(string.Empty); checkpointTitles.Add("The Kraken"); krakenScript = FindObjectOfType <Kraken> (); }
public KrakenAttackState(Boss boss) : base(StateIds.Attacking, boss) { NextStateIds.Add(StateIds.Idle); NextStateIds.Add(StateIds.Stunned); NextStateIds.Add (StateIds.Hurt); random = new System.Random(); kraken = boss as Kraken; }
public void Start() { kraken = gameObject.GetComponentInParent <Kraken>() as Kraken; if (closedEyeRenderer == null) { closedEyeRenderer = GetComponent <MeshRenderer>() as MeshRenderer; } closedEyeRenderer.enabled = false; }
void Start() { checkpointTitles.Add ("Arrival to the Floe"); checkpointTitles.Add ("Ice Corridors"); checkpointTitles.Add (string.Empty); checkpointTitles.Add ("The Kraken"); krakenScript = FindObjectOfType<Kraken> (); }
public void KrakenAccountInformationUpdateTest() { Kraken kraken = new Kraken(); //If there is any problem connecting to the exchange, this will throw an error. kraken.UpdateAccountInformation(); //Only need to ensure UpdateAccountInformation updates trade fee, as btc and fiat balances are allowed to be zero. Assert.IsTrue(kraken.TradeFee > 0.0m); }
public void HasPreyInterFaceProperties() { //arrange Kraken WeakKraken = new Kraken(); //act string input = "Oh no!"; //assert Assert.Equal(input, WeakKraken.TheFirstFiveSeconds(input)); }
void Awake() { HealthPoints = maxHealthPoints; tentaculeAnim = gameObject.GetComponent<Animator>() as Animator; kraken = gameObject.GetComponentInParent<Kraken>() as Kraken; harpoonImpact = GetComponent<AudioSource>(); Dead = false; waterLevel = WaterLevel.Instance; material = gameObject.GetComponentInChildren<SkinnedMeshRenderer>().material; initialColor = material.color; rangeDetector = GetComponent<SphereCollider>() as SphereCollider; animationSpeedMod = ((float)Utils.Instance.Rng.NextDouble() - 0.5f)*0.75f + 1f; tentaculeAnim.speed = animationSpeedMod; }
public void Start() { kraken = gameObject.GetComponentInParent<Kraken>() as Kraken; if(closedEyeRenderer == null) closedEyeRenderer = GetComponent<MeshRenderer>() as MeshRenderer; closedEyeRenderer.enabled = false; }
void Awake() { kraken = GameObject.FindGameObjectWithTag (Tags.kraken).GetComponent<Kraken> (); }