Limit deals per higher time frame - potential backtesting error

i have query regarding this option. I am using 15 minutes RSI indicator which triggers when the RSI is below 100. 2nd indicator is on daily time frame (and triggers easily daily). i am using DCA strategy with one base order and 7 safety orders. limit of deals per higher time frame set by me is 15. Gainium app
While the both the indications are triggered almost daily but i see that on few days more orders are triggered where as on other limited orders are triggered. Cannot understand why. I am sharing JSON file of my strategy. and also shared backtest results.
BB% 97 RSI 15 50X.json (9.9 KB)

Just a note, i am using cross margin with 50X lvg but backtest is based on isolated margins hence showing lot of liquidation events. Hope its not backtesting error.

We have received your bug report and will update you shortly. Thank you for providing the strategy JSON file and backtest results. I see you’ve included a link to your backtest. Could you please also provide the URL of the bot you are referencing?

https://app.gainium.io/bot/680fde1579e1142f5472b12f

Just to add the bot is not triggering despite all conditions are met.

If the daily trigger opens a time frame then your RSI should trigger a new deal every 15 minutes; thus 48 deals per day. How many do you get? Does the maximum of (parallel) deals restrict how many deals really get opened?

i set the limit of 15 deals but with same conditions (both daily & 15mins indicators were suppose to trigger in same manner daily) on other dates the backtest data shows that lesser deals were opened.

From your response i understood that deal means any complete trade irrespectvie of number of safeties consumed?

below is my bot setting:-Exchange: BINANCEUSDM

Pair: BTCUSDT

Leverage: 50

Margin type: isolated

Liquidation events: 225

Max recommended leverage: 1

Strategy: long

Base order: LIMIT 0.032622942 % of total USDT

Deal start condition: Technical indicators

Indicator groups logic: OR

Group: 1

Indicator 1: Bollinger Bands %B (BB %B) 20 use percentile rank lookback 148 candles 1 day Lower than 100 percentile rank ma type VWMA 20 std devs 2

AND
Indicator 2: RSI 7 15 minutes Lower than 100

Max deals per higher timeframe: 15

Max number of open deals: 1

Take profit: Percentage

Target: 0.61%

Not use SL

DCA type: Scaled

Scale type: Percentage

Config: 7 orders 0.065245883 % of total USDT every 0.27% with step scale 1.69% and volume scale 2%

Theoretically both conditions should be met in same manner daily with only thing limiting number of deals is " Max deals per higher timeframe: 15"

i expected that on closure of a deals the bot should have opened next deals but on checking the backtest there is a variation in daily deal opening data.

Check the difference in number of deals between 13 Mar 2020 & 14 Mar 2020.The last deal on 14 Mar 2020 closed at 08:45hrs as shown in the table.

So question is, why 9th deal not opened on 14 Mar 2020 ?

What i figured out is that, since deals are require to open every 15 mins in a day (max 48 deals per day). Total deals per day in my case are 15 & 15 mins x deal limit (15)=225 mins. So daily opening of deals window available to me is 3 hrs 45 mins. The daily candle opens at 0500 hrs as per our timezone (UTC+5); so no new deal will open after 0845 hrs.

Please confirm is my understanding is right.

In most cases if bot have multiple timeframe indicators it will load higher timeframes immediately and wait for lower timeframe results in real time. However if its not possible, bot will wait for higher timeframe to closed to get its result. This what happened with your bot. It wait for UTC day candle to be closed.

I updated the logic of backtester. It should calculate real opened deals instead of start deal signals.
Real bot already has updated logic. If deal not opened (for example because of max deals limit) trigger is not going to be calculated against those 15 deals

1 Like

How can deals be started and stopped at the same time?

Yes, the bot should always know how many deals are currently open (for every pair) in order to act according to the maximum (parallel) deals.

This is a backtest. it can be that way.

Doesn’t every trade require at least two candles if every action happens on a candle close?

No, can be on one candle if TP fixed and high price of candle is higher

When does it need a close confirmation? When it is based on indicators?

It doesnt need any confirmation. If TP order is a limit order and its price is lower than high of candle - deal will be closed.

1 Like