I am currently working on a task, where I should make trading decisions on the base of MA Crossovers.
I am thinking about an approach which involves a dictionary, however, I am still really inexperienced in how to create those.
My idea is to convert a list like following:
cross = [[2, 2], [3, 1], [6, 2], [9, 1], [12, 1]]
where: [time_index, buy_index]
such that, it leaves me with a directory like
{'0': 0, '1':0, '2':2, ... , '12':1 }
The values 0, 1, 2 are standing for: do nothing, buy and sell respectively.
Any help, idea or source to gather knowledge from is super appreciated!