Hi,
Feel a little bit embarrassed to post such trivial question but I sort of fried my brain on the equations today. The idea is as follows:
I back selection at odds X and want to cash out for 65% of the predicted profit (in case the pick wins), examples:
I back under at 2.40. I want to green when the profit is 0.65*(2.40-1) = 0.65*1.40 = 0.91
Similarly, if I back at 9.00. I want to lay when the potential profit is 0.65*8 = 5.2
I coded it this way, which I am not super happy about:
GREEN UP by ticks = 1
if selection trigger's expression is stake*(bm_backp-1)-(lay_price-1)*(bm_backp/(lay_price-0.05)*stake) is greater than 0.65*stake*(bm_backp-1)
So in general it works fine, but the problem is it waits for the lay_price to approach a certain value and if the market has poor liquidity I sometimes miss the green up opportunity.
What I would like to do is to place the appropriate lay bet shortly after the back bet has been matched and keep it there throughout the game. What would be the best way to do it?
Thank you,
LiAlH4