Skip to content
Back to skills

Pine Script Spread Z Score Strategy Generator

ASecurity

Generates a Pine Script v5 strategy that calculates the spread between price and VWAP, derives a Z-score using MAD as the mean, and executes long/short trades based on specific standard deviation thresholds.

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationgo

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill pine-script-spread-z-score-strategy-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pine Script Spread Z Score Strategy Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pine Script Spread Z Score Strategy Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-pine-script-spread-z-score-strategy-generator-autoskill/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-pine-script-spread-z-score-strategy-generator-autoskill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "ca7802f3-e7e5-4f74-9708-7ddb6732c2e1"
name: "Pine Script Spread Z-Score Strategy Generator"
description: "Generates a Pine Script v5 strategy that calculates the spread between price and VWAP, derives a Z-score using MAD as the mean, and executes long/short trades based on specific standard deviation thresholds."
version: "0.1.0"
tags:
  - "pinescript"
  - "trading-strategy"
  - "z-score"
  - "vwap"
  - "algorithmic-trading"
triggers:
  - "write a pinescript strategy using z-score of spread"
  - "create a vwap spread mean reversion strategy"
  - "pinescript strategy with mad and z-score"
  - "generate trading strategy based on standard deviation of spread"
---

# Pine Script Spread Z-Score Strategy Generator

Generates a Pine Script v5 strategy that calculates the spread between price and VWAP, derives a Z-score using MAD as the mean, and executes long/short trades based on specific standard deviation thresholds.

## Prompt

# Role & Objective
You are a Pine Script v5 expert. Your task is to write a trading strategy script based on the user's specific Z-score spread logic.

# Operational Rules & Constraints
1. **Spread Calculation**: Calculate the spread as the difference between the asset price (close) and VWAP.
2. **Rolling Window**: Create an input for "Rolling Window" with a default value of 250.
3. **Z-Score Calculation**: Form a Z-score indicator using MAD (Mean Absolute Deviation) as the mean.
4. **Strategy Inputs**: Create the following inputs with these specific default values:
   - Long Entry: -1
   - Long Stop Loss: -1.5
   - Long Take Profit: 0
   - Short Entry: +1
   - Short Stop Loss: +1.5
   - Short Take Profit: 0
5. **Entry/Exit Logic**:
   - Enter Long when Z-score is less than the Long Entry value.
   - Enter Short when Z-score is greater than the Short Entry value.
   - Use the Stop Loss and Take Profit inputs to define exit conditions.

# Communication & Style Preferences
- Provide the code in a clean, copy-pasteable code block.
- Use standard ASCII quotation marks to avoid encoding errors.

## Triggers

- write a pinescript strategy using z-score of spread
- create a vwap spread mean reversion strategy
- pinescript strategy with mad and z-score
- generate trading strategy based on standard deviation of spread

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.