Is there "Crosses" condition in Rule Manager?

Post Reply
Tomasz Kot
Posts: 72
Joined: Sun Dec 18, 2022 8:09 pm

Is there "Crosses" condition in Rule Manager?

Post by Tomasz Kot »

Is there an option in the Rule Manager to do an action when one EMA crossess another EMA (ideally differentiating cross "from top" and cross "from bottom")?
NakedMarkets
Posts: 248
Joined: Tue Feb 22, 2022 11:06 am

Re: Is there "Crosses" condition in Rule Manager?

Post by NakedMarkets »

At the moment, there is no rule dedicated to crosses conditions but it can be done by defining the following rule.
As an example, we'd like to set a condition to pause the backtest when the SMA 20 (below) crosses the SMA 50 (above).

Here is the related core rule :

[Indicator Value SMA 20 (position 0)] < [Indicator Value SMA 50 (position 0)] AND [Indicator Value SMA 20 (position 1)] > [Indicator Value SMA 50 (position 1)]
Since you compare the value between the last bar and the previous last bar positions, you can check if the SMA cross occurs.

And you can reverse the SMA indicator values, if you want to catch the conditions "from top" :
[Indicator Value SMA 50 (position 0)] < [Indicator Value SMA 20 (position 0)] AND [Indicator Value SMA 50 (position 1)] > [Indicator Value SMA 20 (position 1)]
Tomasz Kot
Posts: 72
Joined: Sun Dec 18, 2022 8:09 pm

Re: Is there "Crosses" condition in Rule Manager?

Post by Tomasz Kot »

Thank you for the solution!

If in the future updates there could be condition of crossing it would make it even simplier, so I think it could be a nice addition. :)
atradni
Posts: 10
Joined: Mon Mar 13, 2023 4:59 pm

Re: Is there "Crosses" condition in Rule Manager?

Post by atradni »

Thanks! I was just looking for something like this! Was about to ask if a "crossing rule" will be implemented or not. Cheers
BrownButterfly
Posts: 1
Joined: Mon Jul 03, 2023 3:39 am

Re: Is there "Crosses" condition in Rule Manager?

Post by BrownButterfly »

atradni wrote: Wed Mar 22, 2023 8:32 am Thanks! I was just looking for something like this! Was about to ask if a "crossing rule" will be implemented or not. Cheers
Same here. It would be very very helpful to have a cross option.
Admin
Site Admin
Posts: 194
Joined: Mon Feb 21, 2022 3:03 pm

Re: Is there "Crosses" condition in Rule Manager?

Post by Admin »

Since many want this rule, we will create it. It will be included in the next release since it's pretty easy to implement,
Thanks for your suggestions
Dedroo
Posts: 1
Joined: Wed Jul 26, 2023 2:26 pm

Re: Is there "Crosses" condition in Rule Manager?

Post by Dedroo »

Hi, I managed to program the crossover rule but I still have a problem.

When I backtest my short and long rule alone, everything is perfect, but when I add both rule in the same backtest, nothing follow my rule anymore.
Could someone help me ?

Thanks !
NakedMarkets
Posts: 248
Joined: Tue Feb 22, 2022 11:06 am

Re: Is there "Crosses" condition in Rule Manager?

Post by NakedMarkets »

Hello,
Sure, we can help you. Could you share with us your rules to see how they are implemented ?
You can send them by email at support@naked-markets.com if you want,
Thanks
Tomasz Kot
Posts: 72
Joined: Sun Dec 18, 2022 8:09 pm

Re: Is there "Crosses" condition in Rule Manager?

Post by Tomasz Kot »

Has the "crosses" condition been already implememented as mentioned above?
If so, where can it be found?
NakedMarkets
Posts: 248
Joined: Tue Feb 22, 2022 11:06 am

Re: Is there "Crosses" condition in Rule Manager?

Post by NakedMarkets »

The crosses condition has not yet been added in the rules since it's possible to do it by comparing previous value.
However, we have to add it in the close future because we said it, even if it's a bit trickier than expected.
Post Reply