Trend Following Exits

In trend following exits in course futures trading what is we are trying to do.



Is volatility std devation of past 40 days.



price_data_PA['volatility'] = price_data_PA.close.diff().rolling(

    volatility_window).std()



is it same as taking latest 40 days close price and standard deviation of those recent 40 days. But in video it said we dont move the stop if price is moving below but in the case above it will move below as 40 days is not fixed and keep rolling.

Hi Deepak,



There can be multiple ways to exit a trend-following strategy. In the Jupyter Notebook, we are exiting the trade based on the pullback value, which is only calculated when there is an uptrend in the case of a long position and downtrend in the case of a short position. The exit conditions have been defined in the notebook in terms of the pullback value.



Hope this helps!



Thanks,

Akshay