Buongiorno,

ho provato a scrivere un ts da utilizzare su azioni che entrasse con un numero di azioni calcolate in base allo stop loss ed alla volatilità del momento calcolata con l'atr. Per farlo ho trovato nel manuale la funzione set contracts. il sistema però entra in backtest con un numero di azioni in base all'amount indicato in beetrader. non riesco a capire dove sbaglio....

ecco il listato

# REQUIRED_BARS is used to adjust how many periods will be used to initialize calculations. Default value is 50 periods.
# Un-comment and edit the line below to set your own value.
# SET REQUIRED_BARS = 50

SET STOP_LOSS = 500
SET CONTRACTS = ABS(500/(AverageTrueRange(5, Simple)))

SET A = CLOSE> SimpleMovingAverage(CLOSE, 200)
SET b = RelativeStrengthIndex(CLOSE, 2)<10
A AND B