Backtester Utility
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Am_ContentCreator_
//@version=5

//!!!!!!!!!!!!!!!Requires Editing for fulfilling your Requirements!!!!!!!!!!!!!!!//
//!!!!!!!!!!!!!!!Requires Editing for fulfilling your Requirements!!!!!!!!!!!!!!!//
//!!!!!!!!!!!!!!!Requires Editing for fulfilling your Requirements!!!!!!!!!!!!!!!//

//!!!!!!!!!!!!!!!Hide you chart for using the indicator!!!!!!!!!!!!!!//
//!!!!!!!!!!!!!!!Hide you chart for using the indicator!!!!!!!!!!!!!!//
//!!!!!!!!!!!!!!!Hide you chart for using the indicator!!!!!!!!!!!!!!//

//NAME=//Backtester Utility//

//USAGE=//This program is useful for manual backtesting of your trading strategies.
//      //It is highly recommended to edit the program according to your requirements//

//SPECIALITY=//Backetesting Feature requires the user to buy Paid Plans but instead we can use this Indicator

//PROPERTIES=//This Indicator Hides the Price action and also the indicator plot after acertained time//
             



//NOTE=//This program is not created for the intention of Direct usage, This is purely Educational Content. This is not any Investment Advise//

indicator(title="Backtester Utility",shorttitle="BU",overlay=true)

//Here I am using simple EMA crossver strategy//

//INPUT//(Change or add Inputs according to your strategy)

src  = open

len1 = input.int(40,title ="Short Length")
len3 = input.int(65,title ="long Length")

//CALCULATION//(Change or add Calculation according to your strategy)

// Input variables for the date and time/////Do not change this/////

hideAfterYear = input(2023, 'Hide After Year')
hideAfterMonth = input(12, 'Hide After Month')
hideAfterDay = input(5, 'Hide After Day')
hideAfterHour = input(0, 'Hide After Hour')
hideAfterMinute = input.int(0, 'Hide After Minute',step=5)

// Convert user inputs to timestamp/////Do not change this/////

hideFromTime = timestamp(hideAfterYear, hideAfterMonth, hideAfterDay, hideAfterHour, hideAfterMinute)

//ema//

//👇Change name ////////////////////👇also change this calculation according to your requirement//
ema1 = time >= hideFromTime ? na : ta.ema(src,len1)
ema3 = time >= hideFromTime ? na : ta.ema(src, len3)
//Do not change any other syntax in above , it will result in error//

crossBL13_ema = ta.crossover(ema1,ema3)
crossBR13_ema  = ta.crossunder(ema1,ema3)

//PLOT//(Change or add plots according to your strategy)

plotshape(ema1 ? crossBL13_ema : na , color=color.aqua, location=location.bottom , size=size.huge , style = shape.arrowup)
plotshape(ema3 ? crossBR13_ema : na , color=color.yellow, location=location.top , size=size.huge , style = shape.arrowdown)

// Convert user inputs to timestamp
hideAfterDate = timestamp(hideAfterYear, hideAfterMonth, hideAfterDay, hideAfterHour, hideAfterMinute)

// Determine if the current bar's timestamp is after the specified date and time
isAfterHideDate = time > hideAfterDate

// Plot the candles only if the bar's timestamp is before the specified date and time
plotcandle(isAfterHideDate ? na : close, open, high, low, color=color.black)
