Skip to content

How to configure TradingView Pine Script strategies by hand?

How to configure TradingView Pine Script strategies by hand?

Section titled “How to configure TradingView Pine Script strategies by hand?”

TL;DR
Use the strategy Properties tab to adjust capital, order sizing, commission, leverage, and recalculation without editing code.

DifficultyBeginner
Time to implement10-15 min
CategoryStrategy Basics

Not every tweak requires changing code. TradingView’s UI settings let you tailor a strategy to different symbols, capital sizes, or broker conditions while keeping the underlying script identical.

SettingPurpose
Initial CapitalStarting equity for the backtest.
Base CurrencyCurrency used for equity, P/L, and commission.
Order SizeDefault sizing mode (contracts, cash, percent of equity).
PyramidingMax number of entries per direction.
CommissionPer-trade fee model (fixed, per contract, percent).
Verify Price for Limit OrdersExtra ticks beyond price touch before filling limits.
SlippagePer-order price slippage in ticks.
Margin (Long/Short)Leverage configuration for both sides.
Recalculate after Order is FilledRe-run strategy mid-bar once fills occur.
Recalculate on Every TickForce intrabar evaluation at tick granularity.
  1. Open the Properties tab
    Right-click the chart → Settings or click the settings gear on the strategy’s legend, then select Properties.

  2. Adjust key parameters
    Tune capital, order size, commission, and leverage to match your scenario.

  3. Save presets as needed
    The same strategy can run with different settings per chart; use “Make default” if you want new charts to inherit these values.

//@version=5
strategy("Manual settings demo", overlay=true)
fastLen = input.int(10)
slowLen = input.int(30)
fast = ta.ema(close, fastLen)
slow = ta.ema(close, slowLen)
plot(fast, "Fast EMA", color=color.green)
plot(slow, "Slow EMA", color=color.red)
if ta.crossover(fast, slow)
strategy.entry("Buy", strategy.long)
if ta.crossunder(fast, slow)
strategy.entry("Sell", strategy.short)
Why this works.
  • The same simple EMA strategy can mimic different brokers by altering Properties.
  • No code changes are required to test cash vs. percent sizing or to add commission and slippage.
  • Recalculation options let you explore intrabar behaviour without rewriting logic.
  • Manual settings override defaults from strategy(); document what you change so others can reproduce results.
  • Pyramiding affects both code-driven orders and manual overrides—make sure it aligns with your logic.
  • High slippage or commission values can drastically alter performance; use realistic numbers.
  • Recalculate on every tick increases computation; reserve it for strategies needing tick-level accuracy.

Why does my strategy stop trading after a few losses?

Section titled “Why does my strategy stop trading after a few losses?”

If order size is cash- or percent-based, equity declines can reduce buying power. Adjust initial capital, leverage, or order sizing to ensure trades can still execute.

They’re stored per script per chart. Use “Make default” if you want new chart instances to inherit your preferred configuration.

  • The Properties tab offers fast, code-free adjustments to capital, sizing, fees, and margin.
  • Manual tweaks complement strategy() arguments—use both to build flexible scripts.
  • Align manual settings with real-world broker conditions for realistic backtests.

Adapted from tradingcode.net, optimised for Algo Trade Analytics users.