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
main.rs | |
// Prevents additional console window on Windows in release, DO NOT REMOVE!! | |
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] | |
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command | |
#[tauri::command] | |
fn greet(name: &str) -> String { | |
format!("Hello, {}! You've been greeted from Rust!", name) | |
} |
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
export function drawSquareGridPattern(ctx: CanvasRenderingContext2D, width: number, height: number) { | |
// Generate a random set of points | |
const numPoints = Math.floor(Math.random() * 20) + 10; | |
const points = range(numPoints).map(() => [Math.random() * width, Math.random() * height] as [number, number]); | |
// Create a Voronoi diagram from the points | |
const voronoiDiagram = voronoi().extent([[0, 0], [width, height]])(points); | |
// Find the four outermost edges of the Voronoi diagram | |
let topEdge: any, bottomEdge: any, leftEdge: any, rightEdge: any; |
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
export function drawRandomRoadPattern(ctx: CanvasRenderingContext2D, width: number, height: number) { | |
// Generate a random set of points | |
const numPoints = Math.floor(Math.random() * 20) + 10; | |
const points = range(numPoints).map(() => [Math.random() * width, Math.random() * height] as [number, number]); | |
// Create a Voronoi diagram from the points | |
const voronoiDiagram = voronoi().extent([[0, 0], [width, height]])(points); | |
// Draw the Voronoi diagram | |
ctx.strokeStyle = "white"; |
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 canvas = document.querySelector<HTMLCanvasElement>('#myCanvas')! | |
const ctx: CanvasRenderingContext2D | null = canvas.getContext("2d"); | |
export function drawBoundingBox() { | |
if (!ctx) return; | |
const side = Math.min(canvas.width, canvas.height); | |
const centerX = canvas.width / 2; | |
const centerY = canvas.height / 2; | |
const radius = side / 2; |
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 './style.css'; | |
const canvas = document.querySelector<HTMLCanvasElement>('#myCanvas')! | |
const ctx: CanvasRenderingContext2D | null = canvas.getContext("2d"); | |
const pointsWanted = 10; | |
export function drawBoundingBox() { | |
if (!ctx) return; | |
const side = Math.min(canvas.width, canvas.height); |
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 { Delaunay } from 'd3-delaunay'; | |
import './style.css'; | |
const canvas = document.querySelector<HTMLCanvasElement>('#myCanvas')! | |
const ctx: CanvasRenderingContext2D | null = canvas.getContext("2d"); | |
const pointsWanted = 5; | |
let points: ArrayLike<[number, number]> | Iterable<[number, number]> | any = []; | |
export function drawBoundingBox() { | |
if (!ctx) return; |
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 { range } from 'd3'; | |
import { voronoi } from 'd3-voronoi'; | |
import './style.css'; | |
const canvas = document.querySelector<HTMLCanvasElement>('#myCanvas')! | |
const refreshButton = document.querySelector<HTMLButtonElement>('#draw-road-button')! | |
const ctx: CanvasRenderingContext2D | null = canvas.getContext("2d"); | |
let points: ArrayLike<[number, number]> | any = []; | |
let octagonPoints: any = []; | |
let isShowing = false; |
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
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/ | |
// © LuxAlgo | |
//@version = 4 | |
study(title=" Support and Resistance Levels with Breaks",shorttitle = " Support and Resistance Levels with Breaks", overlay = true , max_bars_back=1000) | |
// | |
toggleBreaks = input(true, title = "Show Breaks" ) | |
leftBars = input(15, title = "Left Bars ") | |
rightBars = input(15, title = "Right Bars") | |
volumeThresh = input(20, title = "Volume Threshold") |
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 { AxiosInstance } from 'axios'; | |
import { SubmitTokenResponse } from './types'; | |
declare class TDAmeritrade { | |
CONSUMER_KEY: string; | |
client: AxiosInstance; | |
refreshToken: string | undefined; | |
constructor(consumerKey: string); | |
submitAuthToken(token: string, offline: boolean, redirectUri: string): Promise<SubmitTokenResponse>; | |
getNewAccessToken(): Promise<SubmitTokenResponse>; | |
getOauthLink(redirectUri: string): string; |