Skip to content

Instantly share code, notes, and snippets.

View ttt733's full-sized avatar

Trevor Thackston ttt733

View GitHub Profile
@ttt733
ttt733 / rq_vae_bot.py
Last active March 29, 2022 15:18
To be placed in the "notebooks" dir of RQ-VAE
import uuid
import discord
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import torch
import torchvision
import clip
import random
@ttt733
ttt733 / AlpacaForGoogleSheets.gs
Created February 14, 2020 16:35
Alpaca for Google Sheets - Sample Script
var PositionRowStart = 17;
// Submit a request to the Alpaca API
function _request(path,params,data) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Account & Portfolio")
var isPaper = sheet.getRange("E3").getValue()
var apiKey = sheet.getRange("E4").getValue()
var apiSecret = sheet.getRange("E5").getValue()
if (!apiKey || !apiSecret) {
@ttt733
ttt733 / ShortProgram.cs
Created July 23, 2019 20:22
Shorting with the Alpaca API in C#
using Alpaca.Markets;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
// With the Alpaca API, you can open a short position by submitting a sell
// order for a security that you have no open long position with.
namespace ShortingExample
@ttt733
ttt733 / short_orders.py
Last active July 15, 2019 16:43
Shorting with the Alpaca API
import alpaca_trade_api as tradeapi
import time
if __name__ == '__main__':
"""
With the Alpaca API, you can open a short position by submitting a sell
order for a security that you have no open long position with.
"""
# First, open the API connection
@ttt733
ttt733 / MeanReversionPaperOnly.cs
Last active July 17, 2022 16:19
Mean Reversion Trading Algorithm (Alpaca)
using Alpaca.Markets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace Examples
{
class MeanReversionPaperOnly
{