forked from keyianpai/hft
-
Notifications
You must be signed in to change notification settings - Fork 0
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
aae659d
commit 3dc1b14
Showing
10 changed files
with
104 additions
and
41 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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
time_controller : | ||
{ | ||
sleep_time = []; | ||
close_time = []; | ||
force_close_time = []; | ||
invalid_time = []; | ||
}; |
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
Binary file not shown.
Submodule lib-hft
updated
from eb4750 to 32c6e9
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "util/dater.h" | ||
#include <iostream> | ||
#include <string> | ||
using namespace std; | ||
|
||
std::string TransCoin(std::string ticker) { | ||
std::string date; | ||
if (ticker.find("this_week") != ticker.npos) { | ||
date = Dater::get_weekday_string(5); | ||
date.erase(std::remove(date.begin(), date.end(), '-'), date.end()); | ||
cout << date << endl; | ||
date = date.substr(2, 6); | ||
cout << date << endl; | ||
return ticker.replace(ticker.find("this_week"), sizeof("this_week"), date); | ||
} else if (ticker.find("next_week") != ticker.npos) { | ||
date = Dater::get_next_weekday_string(5); | ||
date.erase(std::remove(date.begin(), date.end(), '-'), date.end()); | ||
date = date.substr(date.find("20")); | ||
return ticker.replace(ticker.find("next_week"), sizeof("next_week"), date); | ||
} else if (ticker.find("this_quarter") != ticker.npos) { | ||
date = Dater::get_quarter_lastday_string(5); | ||
date.erase(std::remove(date.begin(), date.end(), '-'), date.end()); | ||
date = date.substr(date.find("20")); | ||
return ticker.replace(ticker.find("this_quarter"), sizeof("this_quarter"), date); | ||
} else if (ticker.find("next_quarter") != ticker.npos) { | ||
date = Dater::get_next_quarter_lastday_string(5); | ||
date.erase(std::remove(date.begin(), date.end(), '-'), date.end()); | ||
date = date.substr(date.find("20")); | ||
return ticker.replace(ticker.find("next_quarter"), sizeof("next_quarter"), date); | ||
} | ||
return ticker; | ||
} | ||
|
||
int main() { | ||
cout << TransCoin("'OKEX'/ETH-USDT-this_week"); | ||
} |