r_ticks(price1,price2)
The above will give you number of ticks between two prices.
Then divide the result by lay_price-1 to give you your fixed liability.
There are a number of options to use for the lt_ma. Read this in the manual
pdif_[minutes]
The absolute back price difference over the time specified by [minutes]. For
example, pdif_5 will return the value that back price changed by within the
last 5 minutes. This number can be negative or positive, depending on the
direction the price changed in. For example, if the price changed from 4.0 to
3.8, the difference will be -0.2.
lpdif_[minutes]
The absolute lay price difference over the time specified by [minutes]. For
example, lpdif_2.5 will return the value that lay price changed by within the
last 2.5 minutes. This number can be negative or positive, depending on the
direction the price changed in.
tdif_[minutes] he change of the back price over the time specified, in price ticks. For example, if the price has changed from 3.0 to 3.65 within 4 minutes, then
tdif_4 will return 13.
ltdif_[minutes]
The change of the lay price over the time specified, in price ticks. For example, if the price has changed from 6.0 to 5.1 within 11.5 minutes, then
tdif_11.5 will return -9.