I have the following problem : I want to loop and give a condition based on a dataframe. More precisely, I would like the following condition : If the value in "volatility" is decreasing on 3 following days, then I should purchase bitcoin at the high price of the day, and sell bitcoin at the low price of the day.
Here is my dataframe :
I've written the code to compute the final value of my portfolio, but I can't manage to find the code that would apply the condition.
Thanks in advance
EDIT : I've been asking to use df.head().to_dict()