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
using Alpaca.Markets; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading; | |
namespace Examples | |
{ | |
class MeanReversionPaperOnly | |
{ |
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 uuid | |
import discord | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from PIL import Image | |
import torch | |
import torchvision | |
import clip | |
import random |
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
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) { |
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
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 |
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 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 |