-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Finance refactor #2561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintain 8000 ers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finance refactor #2561
Changes from 1 commit
e979cf0
84c36a9
3870503
4c46a73
94c4560
3509b99
2849ff9
be2b523
5b6a7d5
121d171
ad1d8f0
2554482
0d80a21
82677ac
71fa112
0b7541e
f84dfae
d64fab6
dc01685
c8b03ee
302d1e6
f498bd0
c77a8a3
3f43253
13204a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ function calcCommon(gd, trace, x, ya, ptFunc) { | |
|
||
// we're optimists - before we have any changing data, assume increasing | ||
var increasing = true; | ||
var cPrev = null; | ||
|
||
var cd = []; | ||
for(var i = 0; i < x.length; i++) { | ||
|
@@ -69,8 +70,14 @@ function calcCommon(gd, trace, x, ya, ptFunc) { | |
var ci = c[i]; | ||
|
||
if(xi !== undefined && oi !== undefined && hi !== undefined && li !== undefined && ci !== undefined) { | ||
// increasing carries over from previous if ci===oi | ||
increasing = (ci === oi) ? increasing : ci > oi; | ||
if(ci === oi) { | ||
// if open == close, look for a change from the previous close | ||
if(cPrev !== null && ci !== cPrev) increasing = ci > cPrev; | ||
8000 // else (c === cPrev or cPrev is null) no change | ||
} | ||
else increasing = ci > oi; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this fix exactly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is code that used to be in |
||
|
||
cPrev = ci; | ||
|
||
var pt = ptFunc(oi, hi, li, ci); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. you mean
BADNUM
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call, yes
BADNUM
-> dc01685