Hi
not sure if this is for X-Feeder or MarketFeeder but this should work in both.
the formula for lay bet amount to green up a back bet at current lay price is: (bm_backp*bm_backa)/lay_price
to lay to green up a back bet at one tick higher than current lay price:
LAY
price: r_ticks(lay_price, 1)
amount: (bm_backp*bm_backa)/r_ticks(lay_price, 1)
you will need to put in conditions to check the trade is in profit e.g. back matched price must be greater than green up price:
selections trigger expression bm_backp is greater than r_ticks(lay_price, 1)
also bear in mind Betfair will match at best available price, so you will often be matched at lay price which makes the greening amount calculation slightly different.
try this in test mode and see what you think