//@version=6
strategy("TradersPost Trade Replay Strategy", overlay=true,
default_qty_type=strategy.fixed,
default_qty_value=1,
initial_capital=10000,
commission_type=strategy.commission.cash_per_order,
commission_value=0.0)
// ============================================================================
// DESCRIPTION & USAGE
// ============================================================================
// This strategy replays historical execution data exported from TradersPost.
// 1. Run: python tools/traderspost-to-pine.py <your_traderspost_export.csv>
// 2. Copy the generated trade arrays and paste them below into the DATA section.
// 3. Add this strategy to your TradingView chart matching the traded symbol & timeframe.
// ============================================================================
// ============================================================================
// GENERATED TRADE DATA SECTION (PASTE OUTPUT FROM traderspost-to-pine.py HERE)
// ============================================================================
// Replace the sample arrays below with the generated output:
var array<int> tradeTimes = array.from(0)
var array<int> tradeDirections = array.from(0)
var array<float> tradePrices = array.from(0.0)
var array<int> tradeQtys = array.from(0)
// ============================================================================
// EXECUTION ENGINE
// ============================================================================
var int currentIndex = 0
int totalTrades = array.size(tradeTimes)
// Process all trades whose timestamp has passed up to the current bar
if totalTrades > 0 and currentIndex < totalTrades
while currentIndex < totalTrades and time >= array.get(tradeTimes, currentIndex)
int targetDirection = array.get(tradeDirections, currentIndex)
float targetPrice = array.get(tradePrices, currentIndex)
int targetQty = array.get(tradeQtys, currentIndex)
if targetDirection == 1
strategy.entry("TP_Long", strategy.long, qty=targetQty, comment="TP Long Entry")
else if targetDirection == -1
strategy.entry("TP_Short", strategy.short, qty=targetQty, comment="TP Short Entry")
else
strategy.close_all(comment="TP Flat Exit")
currentIndex += 1
// Visual markers for execution replay
plot(currentIndex > 0 ? strategy.position_avg_price : na, "Replay Position Avg Price", color=color.new(color.blue, 40), style=plot.style_linebr)
Overview
TradersPost Trade Replay Strategy iterates through hardcoded timestamp, direction, price, and quantity arrays generated by an external conversion tool. When the current bar timestamp matches an array entry, the script triggers long entries, short entries, or closes open positions accordingly. It plots a line for the average position price. Because trade data is stored in static script arrays, execution relies entirely on external logs without dynamic indicator logic or default stop-loss management.
TradersPost historical trade execution replay
Array-based timestamp and order direction handling
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
Doge SMA is a long-only moving-average crossover strategy drawn on the price chart. It calculates a fast and a slow simple moving average of close and enters a long position when the fast average crosses above the slow average, but only inside a user-defined s
This script is an empty strategy template for Pine Script developers. It declares a version 4 strategy named Basic Strategy Boilerplate with the short title Strategy Boilerplate and sets overlay to true so any future plots would appear on the price chart. It d
This strategy calculates and plots a fast Exponential Moving Average (EMA) and a slow EMA directly on the main price chart. It enters long trades when the fast EMA crosses above the slow EMA and exits when the fast EMA crosses below the slow EMA. Inputs allow
2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the
This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can
This overlay strategy offers two selectable entry modes: a Bollinger squeeze on typical price and a simple moving-average cross. It filters trades by weekday, session, date range, and an optional news window, and can restrict direction or invert the side. Risk