-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c0ed67
commit a921bf6
Showing
2 changed files
with
15 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,18 @@ | ||
mod connection; | ||
use connection::Functions; | ||
use connection::Command; | ||
|
||
use connection::{Command, Functions}; | ||
use std::env; | ||
|
||
fn main() { | ||
let mut functions = Functions::new(None); | ||
let args: Vec<String> = env::args().collect(); | ||
let host = args.get(1).cloned().unwrap_or_else(|| String::from("192.168.1.153")); | ||
|
||
let mut functions = Functions::new(host); | ||
let mut command = Command::default(); | ||
command.action = "ACCOUNT".to_string(); | ||
|
||
let command = Command { | ||
action: "ACCOUNT".to_string(), | ||
action_type: None, | ||
symbol: None, | ||
chart_tf: None, | ||
from_date: None, | ||
to_date: None, | ||
id: None, | ||
magic: None, | ||
volume: None, | ||
price: None, | ||
stoploss: None, | ||
takeprofit: None, | ||
expiration: None, | ||
deviation: None, | ||
comment: None, | ||
chart_id: None, | ||
indicator_chart_id: None, | ||
chart_indicator_sub_window: None, | ||
style: None, | ||
}; | ||
|
||
|
||
match functions.command(command) { | ||
Ok(value) => println!("Value: {}", value), | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
} | ||
} |