-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified Arithimitic for Price Change Function
- Loading branch information
1 parent
55299cc
commit 09e74b0
Showing
3,297 changed files
with
220,395 additions
and
220,427 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,30 @@ | ||
from directory import Directory | ||
from company import Company | ||
from directory import selectionSort | ||
def probability_of_returns(og_date, directory): | ||
temp = Company('GOOG') | ||
date = temp.dates.index(og_date) | ||
next_date = date+8 | ||
results = directory.get_reversals_up(og_date) | ||
selectionSort(results[1], results[0],1) | ||
results = results[0] | ||
print(len(results)) | ||
probability = 0 | ||
for company in results: | ||
change = 0 | ||
|
||
change = company.get_average_rate(company.dates[date],company.dates[next_date],"PRICE") | ||
print(company, change) | ||
|
||
if change < 0: | ||
probability += 1 | ||
|
||
probability /= len(results) | ||
print(probability) | ||
def gains(og_date, directory): | ||
pass | ||
if __name__ == "__main__": | ||
x = Directory() | ||
probability_of_returns(20180618,x) | ||
probability_of_returns(20180619,x) | ||
probability_of_returns(20180620,x) |
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
Oops, something went wrong.