Hi, I'm new in this community and I'm having problems in writing my first code. I have very little coding skills, most of it in VBA, so I will appreciate if someone can help me finish this.
This is the code:
def initialize(context):
context.security=sid(8554)
def handle_data(context, data):
for position in context:
s1 = 2*data[context.security].vwap(5)
l1 = data[context.security].vwap(10)
s2 = 2*data[context.security].vwap(6)-data[context.security].vwap(1)
l2 = data[context.security].vwap(11)-data[context.security].vwap(1)
total1= (s1-l1)
total2= (s2-l2)
if total1 > total2:
order(context.security,+100)
elif total1<total2:
order(context.security,-100)
I really don't know where is the problem.
Thanks for your help!