|
I've tried to so some backtesting using basana to find that some BUY orders fail despite being "market orders". This should never happen in reality.
before placing the BUY order in
Then as part of the create_market_order, the actual price for the pair is recalculated (seems to use the "open" price for the next candle, but not sure). This re-calculation happens inside order.py -> MarketOrder in lines: In some cases, the value of ask above is lower that the recalculated price and this results in the order not being filled. Which screws up the backtest because it skips a buy and the sequent sell orders. In this case, I do not understand why order_size in terms of base pair needs to be passed to the create_market_order at all. It should be the order_size in terms of quote pair, isn't it? |
Replies: 1 comment 6 replies
|
Hola Juan, Note that the backtesting exchange uses the following liquidity strategy by default: https://basana.readthedocs.io/en/latest/backtesting_liquidity.html#basana.backtesting.liquidity.VolumeShareImpact
In any case, the DEBUG log should give you a clue of what is going on. Another option is to use this liquidity strategy: https://basana.readthedocs.io/en/latest/backtesting_liquidity.html#basana.backtesting.liquidity.InfiniteLiquidity Please let me know if that helps. |
Hola Juan,
Could you please set logging to DEBUG and include the output ? You can do so like this:
Note that the backtesting exchange uses the following liquidity strategy by default: https://basana.readthedocs.io/en/latest/backtesting_liquidity.html#basana.backtesting.liquidity.VolumeShareImpact
and that may affect you in two different ways:
In any case, the DEBUG log should give you a clue of what is going on.
Another option is to use this liquidity strategy: h…