Hi, I'm new to this community and I`m currently trying to find a solution for a programming question. I just made an Alert that is detecting crossover with the 'signal' line. My problem is that I want to add another condition to trigger a buy signal. This condition is a crossover of the DMI- with the DMI+ line. The biggest problem is that I want a windows of time say like 8 days so if condition 1 (MACD) and 2(DMI) happen that will trigger a buy signal. Also, I wanted to know if it was possible to make a sell signal if DMI is losing momentum. Here is a scenario to explain a little but more what I mean. If the DMI retrace down to 10% that will trigger a sell signal. Here my MACD crossover detection : #pragma nocache #include_once "D:\Program Files (x86)\AmiBroker\Formulas\Custom\Indicator for Alert\ZeroLagMACD.afl" Buy = Cross( ZeroLagMACD, ZeroLagTRIG ); Buytext = "Good time to buy"; Sell = Cross( ZeroLagTRIG, ZeroLagMACD ); SellText = "Good time to sell"; Also I wanted to know if it was possible to mix my historical database with backfill or intraday data ? Thanks for your help !