Page 1 of 1

Is there "Crosses" condition in Rule Manager?

Posted: Wed Dec 21, 2022 6:05 pm
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")?

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

Posted: Mon Jan 23, 2023 4:45 pm
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)]

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

Posted: Sat Jan 28, 2023 10:28 pm
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. :)

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

Posted: Wed Mar 22, 2023 8:32 am
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

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

Posted: Mon Jul 03, 2023 3:46 am
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.

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

Posted: Sat Jul 08, 2023 3:59 pm
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

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

Posted: Sat Jul 29, 2023 7:45 pm
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 !

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

Posted: Fri Aug 04, 2023 7:37 am
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

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

Posted: Fri Jan 26, 2024 10:42 am
by Tomasz Kot
Has the "crosses" condition been already implememented as mentioned above?
If so, where can it be found?

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

Posted: Sat Jan 27, 2024 6:18 pm
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.