Hi,
I am totally need to Python and quantopian. I am actually a C# developer. I am trying to build simple Dollar Cost Average strategy (it is strictly not a strategy as indexing is not meant to generate any Alpha. But the idea is to match the market the best we can where we want to keep commission and expense ratios to be extremely small).
Sure we can use a Vanguard Index fund in UK (were I am from), as Vanguard recently launched the fund in UK. But I work in Denmark and the EU version of the Vanguard Index fund is just too expensive. Plus I want give quantopian a try.
I figured I will buy VOO through Interactive Broker every month and use say 500 dollars as a capital.
what i have done so far (nothing really) is the following:
Initialize the context and get voo
def initialize(context):
context.voo = sid(40107) # VOO
/* I NEED THE FOLLOWING FUNCTION */ // Boolean test to see if today is a trading date for this strategy: the first def IsFirstTradingDateOfMonth(date)
def handle_data(context, data):
orderValue = 500 # 500 dollars we are going to put aside every month
if IsFirstTradingDateOfMonth(??) # <--- do i put data.date?? ....
amount = orderValue / data[context.voo].price
if amount > 0
order(sid(24), amount)