connerwsnodgrass

Backtest doesn't show any trades

FX:EURUSD   Euro / Dólar Americano
I have tried fixing my code to backtest my strategy and when I try to backtest it, it tells me that my code couldn't complete any trades. Please help I am in dire need.

Here is the code:

//@version=4
strategy("backtest #001", overlay=true, initial_capital=100000, currency='USD')

//backtest
fromYear = year > 2010
toYear = year < 2020
//inputs
mystoch = stoch(close, 14, 3, 3) >= 85
myema = ema(close, 200) >= ema(close, 200)
mybbw = bbw(close, 20, 2) >= 0.03

//closing inputs
mystochclose= stoch(close, 14, 3, 3) <= 40
myemaclose = ema(close, 200) <= ema(close, 197)
mybbwclose = bbw(close, 20, 2) <= 0.03

//problems
strategy.entry('buy', true, 1, when = (mystoch and myema and mybbw)? 1 : 0)
strategy.close("buy", when = (mystochclose and myemaclose and mybbwclose)? 1 : 0) , qty_percent = 50

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.