Skip to content

Commit

Permalink
no compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lookfwd committed Aug 14, 2017
1 parent 29e5705 commit 07b82bc
Show file tree
Hide file tree
Showing 12 changed files with 485 additions and 489 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ path = "src/lib.rs"

[dependencies]
rustc-serialize = "0.3.16"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
time = "0.1"
rust-crypto = "^0.2"
curl = "0.2.16"
Expand Down
14 changes: 5 additions & 9 deletions apps/bittrexautobuy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ extern crate time;

use tropix::bittrex::bittrex::*;

use rustc_serialize::{Decodable, Decoder};
use rustc_serialize::json::{self, ToJson, Json};

use std::io;
use std::io::Read;
use std::thread::sleep;
use std::time::Duration;
use std::io::{BufRead};
Expand Down Expand Up @@ -73,20 +69,20 @@ fn main() {
println!("pair {} / {}", &firstcoin, &secondcoin);
println!("max position {}", &maxposition);
println!("frequency {} seconds", &frequency);
let mut xyz = 0;
let xyz = 0;
while xyz == 0 {


let order_book = get_orderbook(&the_secret_trimmed, &firstcoin, &secondcoin, "500");
for sell in order_book.sell {

if sell.Quantity > position_clone {
let the_trade = buy_limit(&the_api_key, &the_secret_trimmed, &firstcoin, &secondcoin, &position_clone.to_string(), &sell.Rate.to_string());
if sell.quantity > position_clone {
let the_trade = buy_limit(&the_api_key, &the_secret_trimmed, &firstcoin, &secondcoin, &position_clone.to_string(), &sell.rate.to_string());
println!("bought {}, {}", position_clone, the_trade);
break;
} else {
let the_trade = buy_limit(&the_api_key, &the_secret_trimmed, &firstcoin, &secondcoin, &sell.Quantity.to_string(), &sell.Rate.to_string());
println!("bought {}, {}", &sell.Quantity, the_trade);
let the_trade = buy_limit(&the_api_key, &the_secret_trimmed, &firstcoin, &secondcoin, &sell.quantity.to_string(), &sell.rate.to_string());
println!("bought {}, {}", &sell.quantity, the_trade);
break;
}
}
Expand Down
14 changes: 5 additions & 9 deletions apps/bittrexautosell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ extern crate time;

use tropix::bittrex::bittrex::*;

use rustc_serialize::{Decodable, Decoder};
use rustc_serialize::json::{self, ToJson, Json};

use std::io;
use std::io::Read;
use std::thread::sleep;
use std::time::Duration;
use std::io::{BufRead};
Expand Down Expand Up @@ -73,20 +69,20 @@ fn main() {
println!("pair {} / {}", &firstcoin, &secondcoin);
println!("max position {}", &maxposition);
println!("frequency {} seconds", &frequency);
let mut xyz = 0;
let xyz = 0;
while xyz == 0 {


let order_book = get_orderbook(&the_secret_trimmed, &firstcoin, &secondcoin, "500");
for buy in order_book.buy {

if buy.Quantity > position_clone {
let the_trade = sell_limit(&the_api_key, &the_secret_trimmed, &firstcoin, &secondcoin, &position_clone.to_string(), &buy.Rate.to_string());
if buy.quantity > position_clone {
let the_trade = sell_limit(&the_api_key, &the_secret_trimmed, &firstcoin, &secondcoin, &position_clone.to_string(), &buy.rate.to_string());
println!("bought {}, {}", position_clone, the_trade);
break;
} else {
let the_trade = sell_limit(&the_api_key, &the_secret_trimmed, &firstcoin, &secondcoin, &buy.Quantity.to_string(), &buy.Rate.to_string());
println!("bought {}, {}", &buy.Quantity, the_trade);
let the_trade = sell_limit(&the_api_key, &the_secret_trimmed, &firstcoin, &secondcoin, &buy.quantity.to_string(), &buy.rate.to_string());
println!("bought {}, {}", &buy.quantity, the_trade);
break;
}
}
Expand Down
Loading

0 comments on commit 07b82bc

Please sign in to comment.