Skip to content

Instantly share code, notes, and snippets.

@fatherofluqmaan
Last active August 31, 2021 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatherofluqmaan/8196ee731e4c6641d4fb2f4ce33b9452 to your computer and use it in GitHub Desktop.
Save fatherofluqmaan/8196ee731e4c6641d4fb2f4ce33b9452 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Script created by @fatherofluqmaan using Bash
# Utilising Interlace (s: https://github.com/codingo/Interlace)
# pycryptobot (s: https://github.com/whittlem/pycryptobot)
# notify (s: https://github.com/projectdiscovery/notify)
dte=$(date +"%Y-%m-%d %T")
dt=$(date +"%Y-%m-%d")
inF="./pairs.txt"
c=$(< "pairs.txt" wc -l)
a="$c"
echo "[+] This is a script for running pycyptobot on coinbase pro only"
sleep 1
mkdir -p raw-sim-outputs
mkdir -p interlace-results
echo "Enter number of parallel bots required"
read -r uT
echo "Enter required granularity (86400,21600,3600,900)"
read -r grn
echo "Enter suffix for file outputs (run1,cc,robin,moon,HODL)"
read -r nme
echo "[+] Current config.json file settings"
echo -e "\n"
cat config.json | grep -B30 '.telegram' | awk -F'\"telegram' '{print $1}' || cat config.json
sleep 3
echo "[+] Running simulations, total pairs count: $c"
interlace -tL "$inF" -threads "$uT" -c 'python3 pycryptobot.py --sim fast --market _target_ --granularity "$grn" 2> ./raw-sim-outputs/"$nme"-_target_-raw-out.txt' -v
echo "[+] Creating simulations results file with just the Margin information"
while IFS= read -r PP; do
cat ./raw-sim-outputs/"$nme"-"$PP"-raw-out.txt | grep "Margin.*" | sed -e "s@^@$dte-$grn-$PP @" >> ./interlace-results/"$nme"-interlace-results.txt
let "--c"
echo "Simulation results remaining: $c"
done < "$inF"
sort -u ./interlace-results/"$nme"-interlace-results.txt >> ./"$nme"-results_"$dt".txt
fte=$(date +"%Y-%m-%d %T")
echo -e "$dte: All $a interlace-simulations complete.\nDate Range: ~2wks approx. using --sim fast, file suffix is $nme" | notify -silent
interlace: https://github.com/codingo/Interlace)
pycryptobot: https://github.com/whittlem/pycryptobot)
notify: https://github.com/projectdiscovery/notify)
pairs.txt (a text file with coinbase pairs e.g. ETH-EUR)
@NeverVane
Copy link

at line 35 you should change
$nme-_target_-raw-out.txt'
to
'"$nme"'-_target_-raw-out.txt'

otherwhise the output it will be
-_target_-raw-out.txt

@fatherofluqmaan
Copy link
Author

at line 35 you should change
$nme-_target_-raw-out.txt'
to
'"$nme"'-_target_-raw-out.txt'

otherwhise the output it will be
-_target_-raw-out.txt

Cheers bud!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment