This file contains hidden or 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
| //@version=5 | |
| indicator("", "", true) | |
| var string[] buys = array.from("2021-12-13","2021-12-03","2021-12-02","2021-11-22","2021-11-15","2021-11-08","2021-11-08","2021-02-26","2021-01-25","2021-01-22","2020-10-30","2020-10-29","2020-10-26","2020-09-25","2020-08-18") | |
| var string[] sells = array.from("2022-10-05","2021-10-25","2021-08-31","2021-01-13") | |
| bar_date = str.format_time(time, "yyyy-MM-dd", syminfo.timezone) | |
| plotchar(array.includes(buys, bar_date), "Buy", "B", location.belowbar, color = color.green, size = size.small) |
This file contains hidden or 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
| import styled, { keyframes } from 'styled-components' | |
| const rotate = keyframes` | |
| from { | |
| transform: rotate(0deg); | |
| } | |
| to { | |
| transform: rotate(359deg); | |
| } | |
| ` |
This file contains hidden or 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
| const asyncMiddleware = promise => { | |
| return (req, res) => { | |
| promise(req) | |
| .then(data => { | |
| res.status(200).json({ | |
| success: true, | |
| ...data | |
| }) | |
| }) | |
| .catch(e => { |
This file contains hidden or 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
| /* | |
| Common MouseEvents: | |
| mousedown | |
| mouseenter | |
| mouseleave | |
| mousemove | |
| mouseout | |
| mouseover | |
| mouseup | |
| */ |
This file contains hidden or 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
| <?php | |
| // PHP implementation of Pearson's product-moment correlation coefficient | |
| function corr($a, $b) { | |
| $sum_ab = 0; | |
| $sum_a = 0; | |
| $sum_b = 0; | |
| $sum_a_sqr = 0; | |
| $sum_b_sqr = 0; | |
| $n = min(array(count($a), count($b))); | |
| for ($i = 0; $i < $n; $i++) { |