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 argparse | |
| import json | |
| import os | |
| from datetime import datetime, timedelta | |
| from alpaca.data.historical.option import OptionHistoricalDataClient | |
| from alpaca.data.historical.stock import StockHistoricalDataClient | |
| from alpaca.data.requests import ( | |
| OptionChainRequest, | |
| StockLatestTradeRequest | |
| ) |
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
| from alpaca.data.historical import StockHistoricalDataClient | |
| from alpaca.data.requests import StockSnapshotRequest | |
| from alpaca.data.enums import DataFeed | |
| from alpaca.data.historical import OptionHistoricalDataClient | |
| from alpaca.data.requests import OptionChainRequest, StockBarsRequest, OptionBarsRequest, OptionSnapshotRequest, OptionLatestQuoteRequest | |
| from alpaca.data.enums import OptionsFeed | |
| from alpaca.trading.enums import ContractType, AssetClass | |
| from alpaca.trading.enums import QueryOrderStatus, OrderSide, OrderClass, TimeInForce, OrderStatus, OrderType, PositionIntent | |
| from alpaca.trading.client import TradingClient | |
| from alpaca.trading.requests import GetOrdersRequest, LimitOrderRequest, TakeProfitRequest, StopLimitOrderRequest, GetOptionContractsRequest, OptionLegRequest, ReplaceOrderRequest |
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
| from alpaca.data.historical import StockHistoricalDataClient | |
| from alpaca.data.requests import StockSnapshotRequest | |
| from alpaca.data.enums import DataFeed | |
| from alpaca.data.historical import OptionHistoricalDataClient | |
| from alpaca.data.requests import OptionChainRequest, StockBarsRequest, OptionBarsRequest, OptionSnapshotRequest | |
| from alpaca.data.enums import OptionsFeed | |
| from alpaca.trading.enums import ContractType, AssetClass | |
| from alpaca.trading.enums import QueryOrderStatus, OrderSide, OrderClass, TimeInForce, OrderStatus, OrderType, PositionIntent | |
| from alpaca.trading.client import TradingClient | |
| from alpaca.trading.requests import GetOrdersRequest, LimitOrderRequest, TakeProfitRequest, StopLimitOrderRequest, GetOptionContractsRequest, OptionLegRequest |
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
| #include <iostream> | |
| #include <vector> | |
| #include <unordered_map> | |
| #include <random> | |
| #include <chrono> | |
| #include <cstdint> | |
| #include <limits> | |
| #include <cstring> | |
| #include <cstdlib> | |
| #include <cstdio> |
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
| #include <SDL3/SDL.h> | |
| #include <SDL3/SDL_main.h> | |
| #include <iostream> | |
| #include <cmath> | |
| #include <vector> | |
| #include <random> | |
| // Linearly interpolate between two points | |
| inline SDL_FPoint lerp(const SDL_FPoint& a, const SDL_FPoint& b, float t) { | |
| return SDL_FPoint{ |
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
| #include <SDL3/SDL.h> | |
| #include <SDL3/SDL_main.h> | |
| #include <cmath> | |
| #include <vector> | |
| // Calculates the X and Y screen coordinates for a circle centered anywhere | |
| void get_arbitrary_circle_point_trig( | |
| float centerX, float centerY, |
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
| #include <SDL3/SDL.h> | |
| #include <SDL3/SDL_main.h> | |
| #include <cmath> | |
| struct Vec3 { | |
| float x, y, z; | |
| }; | |
| typedef struct { | |
| Vec3 position; |
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
| #include <SDL3/SDL.h> | |
| #include <SDL3/SDL_main.h> | |
| #include <cmath> | |
| // Calculates the X and Y screen coordinates for a circle centered anywhere | |
| void get_arbitrary_circle_point_trig( | |
| float centerX, float centerY, | |
| float radius, float angle_radians, | |
| float* out_x, float* out_y | |
| ) { |
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
| #include <SDL3/SDL.h> | |
| #include <SDL3/SDL_main.h> | |
| typedef struct { | |
| SDL_FPoint position; | |
| SDL_FColor color; | |
| } LocalVertex; | |
| // 3d cube shape | |
| static constexpr LocalVertex BLUEPRINT[] = { |
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
| #include <SDL3/SDL.h> | |
| #include <iostream> | |
| #include <cstdint> | |
| #include <cassert> | |
| #include <cmath> | |
| #include <cstdlib> | |
| #include <cstring> | |
| #include <vector> | |
| #include <utility> | |
| #include <algorithm> |
NewerOlder