Skip to content

Instantly share code, notes, and snippets.

@baont
baont / git_branch.sh
Created February 22, 2022 16:37 — forked from dciccale/git_branch.sh
Bash script to get the current git branch and last commit
#!/usr/bin/env bash
# checks if branch has something pending
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
}
# gets the current git branch
function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
decimal = min decimal # vd 1 2 3 4 thì lấy 1
sum_buy = 0
sum_sell = 0
1. Xác định có long được ko?
# tìm depth mà sum_buy > 1.5*sum_sell
depth_i = -1
for depth = 0 to 100:
sum_buy += usdt sum buy at depth, decimal
decimal = min decimal # vd 1 2 3 4 thì lấy 1
sum_buy = 0
sum_sell = 0
# tìm depth mà sum_buy > 1.5*sum_sell
depth_i = -1
for depth = 0 to 100:
sum_buy += usdt sum buy at depth, decimal
sum_sell += usdt sum sell at depth, decimal