"thanks for advice,but thats not enough. it still places bets if market goes to the wrong direction :/but is it possible to make condition like for instance "back amount of 3 best prices are 2 times higher-lower than amounts of 3 best lay prices"?"
back volume is the sum of the three amounts offered at the best back prices.
lay volume is the sum of the three amounts offered at the best lay prices.
so the condition selections Lay volume is less than back_volume*2
It's not clear what you mean when you say the market goes in the wrong direction. Your initial betting conditions should only bet if the market is in the right direction and then only repeat under those conditions IF the price is lower than your last back bet, which was the condition I first posted.