← All scripts

How to use Leverage and Margin in PineScript

by Peter_O · Strategy · Pine Script v4 · 1,315 likes

Verifiedbit-exact

How to use Leverage and Margin in PineScript by Peter_O, a Pine Script v4 strategy, converted with PyneComp and run with PyneCore on BINANCE:BTCUSDT 30m: 58,004 plotted values compared with TradingView, every one bit-identical; all 2,684 trades match TradingView's entry and exit timing.

Plot match vs TradingView100%

Accuracy

  • Trades compared2,684 TV / 2,684 Pyne
  • Whole-trade match100%
  • Entry timing match100%
  • Exit timing match100%
  • Net profit (TV / Pyne)-100,000 / -100,000
  • Plots compared2
  • Plotted values compared58,004
  • Identical to the bit100%
  • Worst gapsame double
  • Pearson correlation (min)1.000000

Run

  • Bars executed29,018
  • Run time1.78 s CPU
  • Per-bar time0.06 ms/bar CPU (per chart bar)

Data window

  • SymbolBINANCE:BTCUSDT
  • Timeframe30 min
  • From2025-01-01 00:00
  • To2026-08-28 12:30
  • Bars29,018

Source

  • Pine versionv4, converted to v6 by PyneComp
  • Script revisionv1
  • LicenseMPL-2.0

SHA-256178fe9c67f11d882f4a01c79337685f163a26a5b48fcec3077f2a16992816395

View on TradingView Permalink: How to use Leverage and Margin in PineScript

Measured 2026-09-27 · How this is measured · All scripts