It is an example:
price = (C+O)/2;
ind = BarsSince( Buy ); //Attempt to define a bar of last purchase
Buy = Cross(avr_f,avr_s);
Sell = price < Ref(price, -ind) OR price > Ref(price, -ind) + 2.5;
It does not work, but shows idea of use of the price of last transaction.
Excuse for my bad English.
Thanks.