anthonym21 / pinescript-v5-instructions-merged

huggingface.co
Total runs: 43
24-hour runs: 0
7-day runs: 11
30-day runs: 16
Model's Last Updated: January 04 2026
text-generation

Introduction of pinescript-v5-instructions-merged

Model Details of pinescript-v5-instructions-merged

PineScript v5 Code Generator

A fine-tuned CodeGemma 7B model specialized in generating TradingView PineScript v5 code for trading indicators, strategies, and libraries.

Model Description

This model was fine-tuned on 5,000+ PineScript v5 examples from the PineScripts-Permissive dataset, which contains high-quality, permissively-licensed scripts from TradingView.

  • Base Model: google/codegemma-7b-it
  • Fine-tuning Method: QLoRA (4-bit quantization + LoRA adapters)
  • Training Data: 4,774 instruction/response pairs
  • Context Length: 4096 tokens
Intended Use

Generate PineScript v5 code for:

  • Technical indicators (RSI, MACD, Bollinger Bands, custom indicators)
  • Trading strategies with backtesting
  • Reusable libraries
  • Alert conditions
  • Custom visualizations
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_id = "anthonym21/pinescript-v5-instructions-merged"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

def generate_pinescript(prompt, max_tokens=1024):
    formatted = f"### Human: {prompt}\n### Assistant:"
    inputs = tokenizer(formatted, return_tensors="pt").to(model.device)

    outputs = model.generate(
        **inputs,
        max_new_tokens=max_tokens,
        temperature=0.7,
        top_p=0.9,
        do_sample=True,
        pad_token_id=tokenizer.eos_token_id,
    )

    response = tokenizer.decode(outputs[0], skip_special_tokens=True)
    return response.split("### Assistant:")[-1].strip()

# Example
code = generate_pinescript("Write a PineScript v5 RSI indicator with overbought/oversold zones")
print(code)
Example Prompts
Prompt Description
"Write a PineScript v5 indicator that shows RSI with dynamic overbought/oversold levels" RSI with adaptive levels
"Create a MACD crossover strategy with stop loss and take profit" Complete trading strategy
"Write a Bollinger Bands indicator with squeeze detection" Volatility indicator
"Create a multi-timeframe moving average indicator" MTF analysis tool
Training Details
Parameter Value
Epochs 3
Batch Size 2
Gradient Accumulation 8
Learning Rate 2e-4
LoRA r 64
LoRA alpha 128
Max Seq Length 4096
Quantization 4-bit (nf4)
Limitations
  • Generates PineScript v5 syntax; may not be compatible with older versions
  • Code should be reviewed and tested before live trading
  • Complex multi-indicator strategies may require refinement
  • Does not provide financial advice
Dataset

Training data sourced from mrmegatelo/PineScripts-Permissive :

  • 5,848 PineScript v5 scripts
  • Filtered to 4,774 high-quality examples
  • Includes indicators, strategies, and libraries
  • All scripts under permissive licenses (MPL-2.0, Apache-2.0)
Citation
@misc{pinescript-v5-instructions-merged,
  author = {Anthony Maio},
  title = {PineScript v5 Code Generator},
  year = {2025},
  publisher = {HuggingFace},
  url = {https://huggingface.co/anthonym21/pinescript-v5-instructions-merged}
}
License

Apache 2.0 (same as base model)

Runs of anthonym21 pinescript-v5-instructions-merged on huggingface.co

43
Total runs
0
24-hour runs
1
3-day runs
11
7-day runs
16
30-day runs

More Information About pinescript-v5-instructions-merged huggingface.co Model

More pinescript-v5-instructions-merged license Visit here:

https://choosealicense.com/licenses/apache-2.0

pinescript-v5-instructions-merged huggingface.co

pinescript-v5-instructions-merged huggingface.co is an AI model on huggingface.co that provides pinescript-v5-instructions-merged's model effect (), which can be used instantly with this anthonym21 pinescript-v5-instructions-merged model. huggingface.co supports a free trial of the pinescript-v5-instructions-merged model, and also provides paid use of the pinescript-v5-instructions-merged. Support call pinescript-v5-instructions-merged model through api, including Node.js, Python, http.

pinescript-v5-instructions-merged huggingface.co Url

https://huggingface.co/anthonym21/pinescript-v5-instructions-merged

anthonym21 pinescript-v5-instructions-merged online free

pinescript-v5-instructions-merged huggingface.co is an online trial and call api platform, which integrates pinescript-v5-instructions-merged's modeling effects, including api services, and provides a free online trial of pinescript-v5-instructions-merged, you can try pinescript-v5-instructions-merged online for free by clicking the link below.

anthonym21 pinescript-v5-instructions-merged online free url in huggingface.co:

https://huggingface.co/anthonym21/pinescript-v5-instructions-merged

pinescript-v5-instructions-merged install

pinescript-v5-instructions-merged is an open source model from GitHub that offers a free installation service, and any user can find pinescript-v5-instructions-merged on GitHub to install. At the same time, huggingface.co provides the effect of pinescript-v5-instructions-merged install, users can directly use pinescript-v5-instructions-merged installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

pinescript-v5-instructions-merged install url in huggingface.co:

https://huggingface.co/anthonym21/pinescript-v5-instructions-merged

Url of pinescript-v5-instructions-merged

pinescript-v5-instructions-merged huggingface.co Url

Provider of pinescript-v5-instructions-merged huggingface.co

anthonym21
ORGANIZATIONS

Other API from anthonym21