Buy-and-hold strategy stats
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TradersForecast

//@version=4
strategy("Buy-and-hold strategy stats", overlay=true, pyramiding=1, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, process_orders_on_close=true)
minDate = input(timestamp("01 Jan 2010 0:0 -0500"), title = "Start Date/Time", type = input.time)
maxDate = input(timestamp("01 Jan 2030 0:0 -0500"), title = "End Date/Time", type = input.time)
revTrd = input(false, title="Short position? (else it defaults to LONG)", type=input.bool)

strategy.close_all()
if time >= minDate and time <= maxDate
    strategy.entry("My Long Entry Id", revTrd ? strategy.short : strategy.long)
