Skip to content

Instantly share code, notes, and snippets.

Title:

Lightweight Charts – Custom Order Flow & Market Depth Renderer

Description:

This project extends TradingView’s Lightweight Charts to visualize order flow and market depth directly on candlestick charts. Since Lightweight Charts doesn’t provide native support for order flow or depth visualization, this implementation demonstrates how to use custom primitives (ISeriesPrimitive) to draw bid/ask rectangles and real-time market depth overlays.

Why I Created It:

@aroirocks
aroirocks / ProfilePage.js
Created January 2, 2022 11:39
Profile page
import React, {useState, useRef} from 'react';
import {
TextInput,
View,
StyleSheet,
Text,
TouchableOpacity,
Image,
} from 'react-native';
import {Formik} from 'formik';
<Formik
validationSchema={singupValidationSchema}
enableReinitialize={true}
innerRef={formRef}
initialValues={{
name: user ? user.displayName : '',
email: user ? user.email : '',
number: user ? user.number : '',
}}
onSubmit={values => console.log(values)}>
@aroirocks
aroirocks / server.js
Created January 2, 2022 11:28
Twilio Server
const express = require("express");
const app = express();
const port = process.env.PORT || 8080;
const client = require("twilio")(
process.env.TWILIO_ACCOUNT_SID,
process.env.TWILIO_AUTH_TOKEN
);
app.use(express.urlencoded({ extended: true }));
@aroirocks
aroirocks / Signup.js
Last active January 2, 2022 11:37
Google Sign Up Button
import React, {useEffect} from 'react';
import {StyleSheet, Text, View, Button} from 'react-native';
import auth from '@react-native-firebase/auth';
import {GoogleSignin} from '@react-native-google-signin/google-signin';
GoogleSignin.configure({
webClientId:
'YOUR_CLIENT_ID',
});
@aroirocks
aroirocks / app.js
Created January 2, 2022 08:28
Boiler plate code
import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
const App = () => {
return (
<View style={styles.container}>
<Text>Hello world</Text>
</View>
);
};
@aroirocks
aroirocks / ffmpegArgs.js
Last active June 27, 2021 17:28
MPD Function
const mpdfile = (filename) => {
const file_path = `${__dirname}/Folder_file_was_saved/noaudio_${filename}`;
return new Promise((resolve, reject) => {
var args = [
"-dash",
"4000",
"-out",
`${__dirname}/Folder_file_was_saved/${filename}.mpd`, // Save MPD file destination
"-profile",
@aroirocks
aroirocks / resumable-node.js
Last active June 27, 2021 17:25
Resumable Js code server side
var fs = require("fs"),
path = require("path"),
util = require("util"),
Stream = require("stream").Stream;
module.exports = resumable = function (temporaryFolder) {
var $ = this;
$.temporaryFolder = temporaryFolder;
$.maxFileSize = null;
$.fileParameterName = "file";
const url = '/download';
downloadFile(url);
async function downloadFile(url) {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(response);
}