Page 1 of 1

Action executed once per candle

Posted: Fri Jan 26, 2024 10:33 am
by Tomasz Kot
Could you help me how to define an action that would be executed only once per candle?
For example I would like to pause the backtest at the moment (minute) that previous H1 candle high is broken for the first time.

Re: Action executed once per candle

Posted: Sat Jan 27, 2024 6:16 pm
by NakedMarkets
Hi,

There is no way at the moment to do it without false positive.
But if you are using it in a semi-automated backtesting process, you could define the following rule:
RuleBreakPreviousH1High.png
RuleBreakPreviousH1High.png (103.29 KiB) Viewed 1864 times

As you can see, this will trigger the rule when the M1 reaches the high of the previous H1 for a second time, if the price dropped just between the first and the second time.
So, you will have some occasional false positive cases but we think it's not an issue in a semi-automated process. If it's a full automated process, it could be an issue.
We could think about solving this use case by adding more conditional but the user would need to define the opposite condition (say to the software that the condition is reset when a new H1 candle is displayed).

Re: Action executed once per candle

Posted: Sun Feb 18, 2024 2:02 pm
by Tomasz Kot
I understand your logic, however when I try to use it as a rule it doesn't work as expected.

Please find screenshot and backtest attached below.
When you hit play, during the next candle the backtest should stop at the break of previous bullish candle high, but it will not.
Screen 2024-02-18 145609.png
Screen 2024-02-18 145609.png (79.09 KiB) Viewed 1293 times
GER30 - debug.bkt
(5.69 MiB) Downloaded 101 times