Bot entering trades when unexpected

Bug info:

The last two deals on this live bot started when conditions were unmet. In both cases, the MAR was below the criterion (1.002), and there had been no crossing of BB. Here is the most recent deal.

The image shows the actual values of the indicators in question on the bar before the deal opened. Apart from these two deals, all previous deals have opened under the correct conditions.

I’d appreciate some advice on this. Thanks in advance.

That’s the usual behavior. The trigger is evaluated at bar close and starts the current action on the next bar. I.e., whatever the trigger is, it will happen at least one bar later than we wanted it to in most cases. This is to make sure that the condition is really met and that the result can be reproduced by backtests that don’t know the interbar data. If the trigger would start an action before that, it could be that at the end of the current candle, the condition wouldn’t be true anymore. Also in this case you would wonder why an action was executed. With closed candlestick actions you can at least see it in the chart history.

1 Like

Hi. Thanks for your response. It’s true that if the trigger conditions are met the deal opens on the next bar. However, in these two cases, the conditions were not met. MAR (0.989) is well below the value required (1.002). A BB crossing is also required, but it did not happen either. Any idea why the deal opened?

The indicator’s values are wrong. There might be a problem retrieving data from the exchange. In this case, we already released a fix that should help.

But I cant see anything suspicious in logs. I checked latets value of the indicator. Its accurate.

Thanks @aressanch. The issue remains, even after a hard refresh, restart, etc. I also tried using the indicators in the Trading Terminal to look at the values for that bar. They match the values in the bot view. I tried looking at a different exchange (ByBit) with the same pair for the same bar. MAR was also less than 1. Of course, there is no reason why they would be the same, but I thought it would be interesting to see any differences. Perhaps some information you can use to figure it out. Thanks for your time.

I have found a problem in loading data from okx. At that day, there was a problem with real time updates from okx, indicator fallback to laod data from exchange, and was returned empty candle. Fixed okx candle request.

2 Likes