Hello Adam,
Yes, the '20' denotes the length of a rolling windows of trading days. To see what 'batch_transform is doing run this:
@batch_transform(window_length=4, refresh_period=0)
def get_data(datapanel):
Close = datapanel['close_price']
return Close
def initialize(context):
context.stocks =[sid(2)]
def handle_data(context, data):
Close = get_data(data)
if Close is None:
return
print Close
You will see that in daily mode the batch transform updates each day for a frequency of 0 and 1. Try a frequency of 2.
To add more exit signals imply use the 'or' syntax:
if exit_condition_1 or \
exit_condition_2 0r \
exit_condition_3:
order(stock, -position)
P.