I have a column within a dataframe that consists of either `1`, `0` or `-1`.
For example:

`<0,0,0,1,0,0,1,0,0,1,0,-1,0,0,1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,0,-1,0,0>`

How can I create a new column in that dataframe where it is a sequence of 1s from the first `1` to the first `-1`. And then starts again at `0` until the next `1`.

In this example, it would be:

`<0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1, 1,0,0>`

Essentially I’m trying to create a trading strategy where I buy when the price is `>1.25` and sell when goes below `0.5`. `1` represents buy and `-1` represents sell. If I can get it into the form above I can easily implement it.