hi not sure if i need to start over or correct a few things but im stuck, not sure what i need to do ive tried changing a number of things like parenthesis,inputs etc.
heres the code:
//@version=5
strategy(title=“Moving Average Crossing”, overlay=true, initial_capital=2000, commission_type=“strategy.commission.percent”, commission_value=0.2)
//DATE AND TIME
fromMONTH = input(defval=1, title = “From month”, minval=1)
fromDay = input(defval=1, title = “From day”, minval=1)
fromYear = input(defval=2021, title = “From year”, minval=2014)
toMONTH = input(defval=1, title = “To month”, minval=1)
toDay = input(defval=1, title = “To day”, minval=1)
toYear = input(defval=2025, title = “To year”, minval=2014)
//DEFINITIONS
shortMa = sma(close, 20)
longMa = sma(close, 50)
//LOGIC
timeInRange = (time > timestamp(fromYear, fromMonth, fromDay, 00, 00)) and (time < timestamp(toYear, toMonth, toDay, 23, 59))
longSignal = crossover(shortMa, longMa) and timeInRange
ShortSignal = crossover(longMa, shortMa) and timeInRange
//POSITIONS
strategy.entry(Id=“longPosition”, long=true, qty=0.1, when=longSignal)
strategy.entry(id=“shortPosition”, long=false, qty=0.1, when=shortSignal)