Create a simple buy & hold Python Algorithm
$10-30 USD
Pagato alla consegna
I need an Algorithm created using Python that will place up to 15 stocks to buy and hold forever.
It will also need to rebalance the entire portfolio every year on the 2nd of January.
That is it!
here is an example of 15 tickers to use. AMZN AAPL MA DIS XOM HD IBM INTC MRK NKE TRV PG UTX UNH VZ
Should only take about 10 minutes to create.
Example of some code.
def initialize(context):
[url removed, login to view] = sid(24)
[url removed, login to view] = sid(8554)
def handle_data(context, data):
if data.can_trade([url removed, login to view]):
order_target_percent([url removed, login to view], 0.25)
if data.can_trade([url removed, login to view]):
order_target_percent([url removed, login to view], -0.25)
Rif. progetto: #15853050