# Pine Script – Strategy

A basic strategy using MACD, RSI, and Stochastic with breakout conditions for long and short entries.

Canonical: https://prismaticalgos.com/compendium/algo/2328-pine-script-strategy
Record ID: 2328
Catalog rank: 1029 (reading order, not performance)
Snapshot: 2026-10-31 15:46 UTC
Family: Mean Reversion & Counter-Trend (B)
Source: https://www.prorealcode.com/topic/conversione-della-strategia-dal-software-di-trading-pine-script/
Evidence label (unverified): source_code

## Scope and limitations

These are machine-extracted research records, not verified trading systems. Catalog rank measures specification detail and claimed evidence, not profitability. The catalog extraction pipeline did not independently backtest these records. Its separate selected testing ledger does not validate the wider corpus. Rules, labels and parameters can be incomplete or wrong; consult the original source and its reuse terms.

No endorsement, ownership claim or source-code reuse permission is implied.

## Extraction warnings

No automated warnings recorded; this is not validation.

## Recorded profile

- symbols: XAUUSD
- timeframes: any
- sessions: any
- market_regime: trending|ranging|volatile

## Indicators

- EMA: {"period": 21}; applied to: close
- Bollinger Bands: {"deviations": 2, "period": 20}; applied to: close
- MACD: {"fast_period": 12, "signal_period": 9, "slow_period": 26}; applied to: close
- RSI: {"period": 14}; applied to: close
- Stochastic: {"period": 14}; applied to: close

## Recorded long-entry rules

- mymacdLine > 0 AND rsiValue < 30 AND stochD < 20

## Recorded short-entry rules

- mymacdLine < 0 AND rsiValue > 70 AND stochD > 80

## Recorded exit rules

- IF NOT OnMarket AND longcondition2 THEN
- sl = 1000 - deltaTPSL
- BUY contratto CONTRACTS AT MARKET
- SET STOP PLOSS sl
- SET TARGET PPROFIT tp
- ENDIF
- IF NOT OnMarket AND shortcondition2 THEN
- sl = 1000 - deltaTPSL
- SELLSHORT contratto CONTRACTS AT MARKET
- SET STOP PLOSS sl
- SET TARGET PPROFIT tp
- ENDIF

## Recorded filters

- Not specified.

## Risk controls

- Stop loss: 500 - deltaTPSL
- Take profit: 1000 + deltaTPSL
- Position sizing: 2 contracts per trade
