> For the complete documentation index, see [llms.txt](https://docs.runbot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.runbot.io/strategy-boxes/indicators-box/signal-duration-rule.md).

# Signal duration rule

In the previous example, we have seen how to create a signal. But you also sometimes need to determine for how long the signal will exist.

If your strategy only has 1 signal, then you'll not need the signal duration feature. Because as soon as your signal is triggered, your strategy will immediatly execute the order.&#x20;

***

However, if your strategy requires 2 longs signals to execute an order, you might need a signal duration rule to meet the requirements.

\
It will depend of your type of signal trigger. For example, if you create a long signal with the "cross signal" feature, this will be activated only during the next candle. That can be a very short period of time and you might never meet the second long signal at the same time.

&#x20;

***

\
If you have a long signal from a "in zone" trigger, your signal might be longer, since the indicator can stay in that zone for many more candles/time, which makes things easier to meet others signals at the same time and then trade.

Click on "*add a new signal duration rule*" to add an existence time of your signal once it is created. \
You can either choose a duration time, like 1x1 hour candle or let the signal be activated until you trigger another specific signal. See next examples.&#x20;

***

*Ex 1: \[There is a minimum of 2 long signals]* \
*We want to open a long position only if we are triggering 2 longs signals at the same time.*

<figure><img src="/files/GeTho2xf5POqZm7VD5hL" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/lH0RMhRVJ4Tn1dzpeWdY" alt="" width="563"><figcaption></figcaption></figure>

*In that example, we want the RSI to cross up the level 20 and at the same time the Stochastic to be in the zone \[0;40] to execute a long order. The long signal from the RSI will be activated during 1 hour after it has been triggered. The long signal from the Stochastic will be activated only when it is in the \[0;40] zone.*

*-> If the Stochastic is in the zone at 35, and then later the RSI cross up the level 20, the bot will open a long position (the duration rule here doesn't matter).*

*-> If the RSI cross up the level 20 and then 1 hour later the Stochastic is still not in the zone \[0;40], the bot will not open any positon.*

*-> If the RSI cross up the level 20 and 45 minutes after the Stochastic just entered the zone, the bot will open a long position. That long is possible because the RSI signal is activated during 1 hour.* \
*Without this duration rule, the long signal would only be activated for 15 minutes (i.e. the next candle of the same period), so there would be no trade.*

<figure><img src="/files/gQS1J8BHRsLXv5mAcQPE" alt="" width="314"><figcaption></figcaption></figure>

It is also possible to create the signal not only for a specific time, but until another signal is triggered.&#x20;

\
In this example, as soon as a stop signal is triggered, the long signal is canceled.

<figure><img src="/files/9RVJzfyzSllmniudXAsD" alt="" width="375"><figcaption></figcaption></figure>

Another possibility, is to delay the activation of the long signal.\
In this example, we wait for 1 hour before placing a long signal.
