This presentation discusses the development of adaptive trading systems that can operate in either trend mode or cycle mode. It begins with the philosophical background justifying market cycles and how they can be measured. It then demonstrates how to identify the current market mode using cycle phase calculations. Trading strategies are proposed to either follow trends when the market is trending or trade cycles when the market is ranging. Code examples are provided to program adaptive trend following and cycle trading systems in TradeStation. The systems are backtested on currency and stock market data with positive results.