Alien Algorithms logo
Alien_Algorithms
Institutional Imbalance FrameworkLiquidation Heatmap
Pricing
Pine3D Visual EngineNeuraLib ML Runtime
Order Flow AnalysisFair Value GapsOrder BlocksMarket StructureLiquidity Engineering
OrderFlow Tools
Alien Algorithms logoALIEN_ALGORITHMS

TradingView market-structure systems and open-source Pine Script infrastructure for order flow, fair value gaps, order blocks, liquidity, and advanced chart research.

Copyright 2026 Alien Algorithms. Trading tools are analytical software, not financial advice.

Terms, Privacy, and Refund Policy

Community

DiscordJoin the community, get support and share your experience
Founder on XFollow Hawk_FinanceTradingViewAlien_Algorithms published scripts

Products

Institutional Imbalance FrameworkLiquidation HeatmapNeuraLibPine3D

Guides

Order Flow AnalysisFair Value GapsOrder BlocksMarket StructureLiquidity Engineering
Neural Network Runtime for TradingView

Deep Learning
Directly in
TradingView

An ultra-low latency tensor computation and deep neural runtime engineered natively for Pine Script v6. Execute dynamic forward-backward propagation, register symbolic math tapes, and compile complex non-convex neural topologies directly on live candlestick feeds.

Bypass clumsy external broker bridges, web sockets, and high-overhead execution APIs. NeuraLib runs client-side inside the TradingView engine, achieving sub-millisecond weight inference.

Code ExamplesRead the Codex
Built-in automatic differentiation engine. No server dependencies.
Graph Visualization
R3F ACTIVE
Compiling Synapse Shaders...
Left-Click + Drag to OrbitModel: 3-Layer Sequential
Huber Loss
Loss Math
Auto-Diff
Backprop Strategy
AdamW Decay
Optimizer Core

NeuraLib SYSTEM ARCHITECTURE

NeuraLib is designed to powernext-generation indicatorsinside PineScript v6

NeuraLib is for the full workflow: features, targets, scaling, batches, training, validation, and inference. The value is not a prepackaged signal; it is a runtime developers can build on.

Automatic Differentiation
& Symbolic Math Tapes

No complex math required. NeuraLib’s autograd engine automatically tracks and compiles derivative gradients under the hood, allowing you to train complex networks with a single function call.

Unified Neural Graph

Build any network topology from standard feed-forward structures to recurrent networks. NeuraLib automatically compiles your design into an optimized mathematical model that executes instantly on chart feeds.

Pre-Built Activations

Instantly plug in popular machine learning activations including ReLU, Leaky ReLU, Sigmoid, and Tanh, pre-optimized for rapid calculations.

Zero-Overhead Memory

Runs entirely within TradingView's memory limits. It automatically recycles old calculation data, keeping your charts responsive and fast.

TENSOR_GRADIENT_MATRIX_VOXELS4 x 4 x 4 ELEMENT TENSOR
Assembling Tensor Matrix...
AUTOGRAD MORPH ACTIVEACTIVATION WAVE: SINE-COSINE
TEMPORAL_VALIDATION_MODULESTATUS: HOLDOUT_SPLIT_ACTIVE
Initializing Holdout Split...
TEMPORAL LEAKAGE PROTECTIONINTEGRITY: 100%

Chronological Holdout
& Validation Guardrails

Prevent the most critical mistake in financial machine learning: look-ahead leakage. NeuraLib separates training batches from the newest held-out rows, then evaluates validation data through profiles fit on the training side only.

01

Training-Only Scale Profiles

trainBatch() computes the model input side first. validationBatch() returns the held-out tail, but keeps scaling anchored to the same training-side feature and target profile.

02

Forward Holdout Lifecycle

Validation rows are the newest chronological rows after the training prefix. As new bars are pushed, prior validation rows naturally graduate into the training side while the freshest rows become the new holdout tail.

03

Target Offset Labeling

Rolling datasets can select a target row after each feature window with targetOffset. That is a forward label offset, not a separate no-data barrier between training and validation.

Finance-Native Losses
& Optimizer Control

NeuraLib includes standard regression and classification losses alongside trading-oriented objectives such as directional, quantile, multi-horizon weighted, and Sharpe-style loss. Optimizers are selected through the same compile flow, from SGD and momentum through RMSProp, Adam, and AdamW.

Robust & Directional Losses

Use Huber for outlier-tolerant regression, directional loss for sign-aware training, and quantile or multi-horizon weighting when the label structure needs asymmetric emphasis.

Selectable Optimizer States

Compile models with SGD, Momentum, RMSProp, Adam, or AdamW. AdamW adds decoupled weight decay when regularization is needed, but it remains one option in the optimizer set.

Sharpe-Style Loss Preset

Use presetSharpe() when the experiment should score predicted returns through a risk-adjusted objective instead of plain point error. It sits alongside the standard loss suite, not in place of it.

GRADIENT_DESCENT_LANDSCAPENON-CONVEX OPTIMIZATION SURFACE
Calculating Loss Contours...
ADAMW GRADIENT PATHVALLEY TARGET: GLOBAL MINIMUM
ADVANCED MODELS EXPANSION

State-of-the-Art Deep Learning Models

NeuraLib_Models adds Conv1D temporal networks, LSTM and GRU recurrent models, Transformers with Self Attention, and Reinforcement Learning utilities directly onto normal nl.Sequential chains. The model still trains, validates, predicts, and manages weights through the same core NeuraLib runtime.

NeuraLib_Models
import after core
.temporalConvStack().globalAvgPool1d().duelingQHead()

Conv1D Temporal Models for Market Windows

active graph

Build Pine Script sequence models that extract local structure from rolling market windows, compress temporal activations with 1D pooling, and route them into compact prediction or action-value heads.

Shape Contractarray.from(8) = 4 steps x 2 features
1state_window
2temporalConvStack
3globalAvgPool1d
4duelingQHead
5qDown / qNeutral / qUp
Fluent Chain
.input(array.from(8), "state_window")
.temporalConvStack(4, 2, 2, 2, 1)
.globalAvgPool1d(3, 2)
.duelingQHead(4, 3)
Available Methods
temporalConvStack()globalAvgPool1d()globalMaxPool1d()duelingQHead()
Flattened sequence guard
Conv1D pattern extraction
Q-head compatible output
Core Runtime Remains In Charge

The expansion supplies architecture blocks. Core NeuraLib still owns tensors, datasets, scaling, optimizers, losses, validation, prediction, and weight updates.

DEVELOPER CODEX // GET STARTED

Easy to Integrate

NeuraLib encapsulates complex matrix mathematics into clean, developer-focused interfaces. Spin up a dense sequential layer map and compile learning schedules in a few straightforward lines.

ModelSetup.pin
//@version=6
// Core Layer Setup - NeuraLib Sequential Model
import Alien_Algorithms/NeuraLib/1 as nl

var nl.Model model = nl.newSequential(
    name = "E-Mini SP500 Trend Predictor",
    optimizer = nl.optimizer.adamw(lr = 0.002, weightDecay = 1e-4)
)

if barstate.isfirst
    model.add(nl.layers.dense(inputs = 8, units = 16, activation = nl.activation.leaky_relu()))
    model.add(nl.layers.dropout(rate = 0.15))
    model.add(nl.layers.dense(inputs = 16, units = 8, activation = nl.activation.tanh()))
    model.add(nl.layers.dense(inputs = 8, units = 1, activation = nl.activation.linear()))
    
    // Fit compile parameters using Huber directional loss
    model.compile(loss = nl.loss.huber(delta = 1.0))
RESEARCH LIFECYCLE

Build the research loop explicitly

A NeuraLib experiment is not a one-line prediction call. The useful loop is to define the data contract, collect clean rows, train against a chronological holdout, and only then route predictions into indicator logic.

Runtime Chain
datascaletrainvalidateinfer
01
compile()

Declare the experiment contract

Fix the feature width, target shape, model architecture, loss, optimizer, and training gate before rows start flowing through the script.

model contract
02
pushRow()

Collect and scale valid rows

Build feature and target rows from confirmed chart data, then push them into WindowDataset or RollingDataset so invalid rows are rejected and scaler profiles stay controlled.

dataset boundary
03
trainBatch() / evaluate()

Train against a holdout tail

Request trainBatch() and validationBatch(), update weights only on the training side, and evaluate the held-out side without letting validation data rewrite the model.

validation boundary
04
predict()

Infer, inspect, and iterate

Scale live inputs, run predict(), inverse-scale outputs when needed, then compare prediction behavior, training loss, and validation loss before changing the experiment.

inference boundary
INSTANT ALGORITHMIC DEPLOYMENT

Infrastructure for Intelligent Tools
Start Coding Today

Gain immediate TradingView access to the NeuraLib ML Engine. Build self-learning indicators, deploy neural network architectures, and stop hard-coding static logic.

Get AccessRead the Codex

Quant conceptualized and built by Alien_Algorithms.