Hi,
Within a strategy I wish to capture the prevailing market conditions at the time that a trade is open, such as volatility, volume and so on, with a view to feeding this back into the algo to identify the current prevailing market cylcle or change thereof. From this an algo could recognise what cycle the market is entering into (eg strong bull, range bound) and use a different set of stored parameters for the next trade.
For example, an algo goes long and after the position is opened the volatility begins to increase and the volume reduces. The next trade the aglo should take would use a more cautious set of parameters (a tighter stop loss, a smaller target profit, a shorter linear regression lookback period etc.)
Is this type of monitoring and feedback possible? The code I am currently using monitors Standard Deviation up to the point a position is opened. If volatility spikes during an open position then the same STD calculation used for the next trade should be on a shorter lookback period.
Thanks very much