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
class Login extends React.Component { | |
componentWillMount() { | |
base.onAuth((user) => { | |
if(user) { | |
this.props.setUser(user.displayName, user.email, user.photoURL, user.uid); | |
} | |
}); | |
} | |
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
const inputs = { rsi: 8 }; | |
main['rsi_' + pair] = generateRSI(pair); | |
const generateRSI = pair => { | |
const closes = main.closes[pair]; | |
const len = closes.length; | |
const arr = []; | |
let prevAvgGain = 0, prevAvgLoss = 0; |
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
const inputs = { tenkan: -9, kijun: -26, senkou: -52, chikou: -26 }; | |
main['ichimoku_' + pair] = generateIchimoku(pair, false); | |
main['chikou_' + pair] = generateIchimoku(pair, true); | |
const generateIchimoku = (pair, isChikou) => { | |
const high = isChikou ? main.high[pair].slice(0, inputs.chikou) : main.high[pair]; | |
const low = isChikou ? main.low[pair].slice(0, inputs.chikou) : main.low[pair]; |
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
const getAvgSpread = prices => { | |
let totalQty = 0, totalPrices = 0; | |
for (let price in prices) { | |
const qty = prices[price]; | |
totalQty += qty; | |
totalPrices += parseFloat(price) * qty; | |
} | |
const avgPrice = parseFloat((totalPrices / totalQty).toFixed(8)); | |
return { avgPrice, totalQty }; | |
}; |
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
{"lastUpload":"2019-06-03T16:24:39.179Z","extensionVersion":"v3.2.9"} |
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
for (let i = 0; i < arr.length; i+=10) { | |
let str = ''; | |
for (let j = i; j < i + 10; j++) if (arr[j]) str += "'"+arr[j]+"', " | |
console.log(str); | |
} |
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
6. Liste de doublons d'une liste non ordonee | |
Entree: monTableau: int[] | |
Sortie: void | |
Procedure: listerDoublons(monTableau) | |
DEBUT | |
POUR i = 0 a monTableau.length - 1 | |
POUR j = 0 a monTableau.length - 1 | |
SI ( i != j && monTableau[i] == monTableau[j] ) |
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
package exercice1; | |
import java.util.ArrayList; | |
import java.util.stream.IntStream; | |
public class Exercice1 { | |
public static void main(String[] args) { | |
int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, -2, -3}; | |
System.out.println("Somme de tout les entiers: \t\t" + getSum(arr)); |
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
import java.io.File; | |
import java.io.IOException; | |
import java.text.DecimalFormat; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.commons.io.FileUtils; | |
import org.apache.hadoop.conf.Configured; | |
import org.apache.hadoop.util.Tool; | |
import org.apache.hadoop.util.ToolRunner; |
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
# Python 3.9 | |
import asyncio | |
import hashlib | |
import aiohttp | |
from aiofile import async_open, AIOFile, Reader | |
BASE_URL = 'https://data.binance.vision' |