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 { DefaultLogger, WebsocketClient } from 'okx-api'; | |
// Optional: Inject a custom logger. | |
// This example overrides the default logger to also log "silly" (super verbose) messages, which are disabled by default | |
const logger = { | |
...DefaultLogger, | |
silly: (...params) => console.log('silly', ...params), | |
}; | |
const wsClient = new WebsocketClient( |
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
varName=./_sorted | |
if [ ! -d "$varName" ]; then | |
echo "Creating $varName"; | |
mkdir "$varName"; | |
fi | |
## array variable containing extensions | |
declare -a extensions=("dmg" "archives" "pdfs" "images" "php" "html" "js" "documents" "powerpoints" "excel" "java" "logs" "objc" "emails" "videos" "dbbackup") | |
declare -a images=("jpg" "JPG" "jpeg" "png" "PNG" "gif" "jpg" "svg" "webp") |
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
#!/usr/bin/env sh | |
. "$(dirname -- "$0")/_/husky.sh" | |
red=$(tput setaf 1) # ANSI escape code for red color | |
reset=$(tput sgr0) # ANSI escape code to reset color | |
#Commit message check | |
commit_msg=$(git log -1 --pretty=%B) |
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 { DefaultLogger, WS_KEY_MAP, WebsocketClient } from '../src'; | |
// or | |
import { DefaultLogger, WS_KEY_MAP, WebsocketClient } from 'bybit-api'; | |
const logger = { | |
...DefaultLogger, | |
silly: (...params) => console.log(new Date(), 'silly', ...params), | |
}; |
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 { DefaultLogger, WS_KEY_MAP, WebsocketClient } from '../src'; | |
// or | |
import { DefaultLogger, WS_KEY_MAP, WebsocketClient } from 'bybit-api'; | |
const logger = { | |
...DefaultLogger, | |
silly: (...params) => console.log(new Date(), 'silly', ...params), | |
}; |
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 client = new USDMClient({ | |
api_key: 'apikeyhere', | |
api_secret: 'apisecrethere', | |
beautifyResponses: true, | |
}); | |
async function start() { | |
try { | |
// if you don't have a position yet, and your account is set to one-way mode, just place a sell order to open a short position | |
const result = await client.submitNewOrder({ |
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
function psychologicalLine(candles, n) { | |
let sum = 0; | |
for (let i = 0; i < n; i++) { | |
if (candles[i].close > candles[i - 1].close) { | |
sum++; | |
} | |
} | |
return sum / n * 100; | |
} |
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
// © tsts123 | |
//@version=5 | |
indicator("Tiago / @AlgoTraderL : SR FVG Bands MATICUSDT") | |
l0h = hline(2.7, title="line0 4h s.l high", color=color.gray, linestyle=hline.style_solid) | |
l0l = hline(2.285, title="line0 4h s.l low", color=color.gray, linestyle=hline.style_solid) | |
fill(l0h, l0l, color=color.rgb(255, 156, 114, 79.75)) | |
if (barstate.islast) | |
label.new(bar_index, 2.7, text="4h 81 % | #98", size=size.normal, style=label.style_label_right, color = color.rgb(0, 0, 0, 100), textcolor = color.white) |
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
// © tsts123 | |
//@version=5 | |
indicator("Tiago / @AlgoTraderL : SR FVG Bands XRPUSDT") | |
l0h = hline(1.18, title="line0 4h s.l high", color=color.gray, linestyle=hline.style_solid) | |
l0l = hline(1.048, title="line0 4h s.l low", color=color.gray, linestyle=hline.style_solid) | |
fill(l0h, l0l, color=color.rgb(255, 156, 114, 75)) | |
if (barstate.islast) | |
label.new(bar_index, 1.18, text="4h 100 % | #389", size=size.normal, style=label.style_label_right, color = color.rgb(0, 0, 0, 100), textcolor = color.white) |
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
// © tsts123 | |
//@version=5 | |
indicator("Tiago / @AlgoTraderL : SR FVG Bands XRPUSDT") | |
l0h = hline(1.7287, title="line0 2h s.l high", color=color.gray, linestyle=hline.style_solid) | |
l0l = hline(1.6058, title="line0 2h s.l low", color=color.gray, linestyle=hline.style_solid) | |
fill(l0h, l0l, color=color.rgb(255, 156, 114, 98)) | |
if (barstate.islast) | |
label.new(bar_index, 1.7287, text="2h 8 % | #21", size=size.normal, style=label.style_label_right, color = color.rgb(0, 0, 0, 100), textcolor = color.white) |
NewerOlder