license: cc-by-nc-4.0 library_name: pytorch pipeline_tag: image-classification tags:
finance
asset-pricing
stock-prediction
candlestick-charts
vision-transformer metrics:
accuracy
Candlestick ViT: 20-day return direction
A Vision Transformer that reads a 25-day candlestick chart of a US stock and predicts whether the stock's price will be higher 20 trading days later. It outputs P(up), which is used as a signal to rank stocks into long-short portfolios.
Code: GitHub repository
Weights file: best_vit_model_full_scratch.pth (PyTorch state_dict, 66 MB)
Author: Ikenna Odikamnoro. The project began as a group project in AI in Finance (COMM 486I).
Model
Architecture
torchvision vit_b_32, no pretrained weights, first 2 encoder layers only
Parameters
16,578,050
Output
2 classes: 0 = down, 1 = up
Input
224 × 224 RGB image, pixels scaled to [0, 1], no normalisation
Training
From scratch; cross-entropy; Adam, learning rate 1e-4, weight decay 1e-4; batch size 32; 10 epochs; best epoch by v…