Message from Python discussions

December 2018

— Don't use +=, use append() instead

— 

Yes i do that and it's working but the thing is that i want to deploy this formula and it is being difficult to me wich forloop use, look

— 

list_1 = [1, 2, 3, 4, 5, 6]
list_2 = []
for ...
your magic here, append elements to list_2

— 

HAO = (Open of previous bar + Close of previous bar) / 2
HAC = (Open + High + Low + Close) / 4
HAH = Highest of High, Open, or Close
HAL = Lowest of Low, Open, or Close

Message permanent page

— So i have a list with each Open, High, Low, Close

— And i try to do this:

for x in opens:
hsopens+=[(opens[-2]+closes[-2])/2]

— But my approach is not correct, i am trying to figure out how to solve this formula

— So i have the list of opens for example that is:
[232,12435,343,12312,5545]
and closes that is:
[9343,5452,2341,6767]
For example, and i want to deploy this formula

Message permanent page

— HAO

— I tought at first that opens[-2] would do the trick but i need to do it recursively trough all the list

Message permanent page

— So i think i need an aditional forloop

— Use simple list comprehension