The best way (which applies to both) is to use a series of stored value conditions to test the money available at the best pricesAtm1981 wrote: ↑Thu Jun 13, 2019 3:22 pmHi how do I add the following rules:
-add a scratch trade to be taken if after my trade is matched for example back trade entered at top of range however the lay money increase more and back side money reduces so then I want to scratch trade or take 1-2 tick loss ?"
- Take back trade at top of range when money reduces on the lay side
- Take lay trade at bottom of range when money reduces on the back side and increase on the lay side
There is a servant that uses this and tests the money waiting at the best 3 prices so if you have a read of the following thread and maybe download it you'll see exactly how its set up.
viewtopic.php?f=58&t=18645
To translate that into this rule on the current back/lay rules you would add up to 6 SV conditions to test the 3 best back and 3 best lay prices before they are allowed to trigger.
Also on the signal tab of the back rule add a 'Set Signal' on selection (name it back)
and on the signal tab of the lay rule add a 'Set Signal' on selection (name it lay)
You'll see why you need this shortly
Regarding scratching, the best way here is to add 2x green up rules
On one of them add a signal set condition
is signal named 'back' on selection set with a value
you'll also need up to 6 SV to test the money waiting as you have done above.
Finally on the signal tab use 'Clear signal' named back on selection (thats so the whole loop can begin again)
Then do something similar for your lay rule but change the signal tab to 'Clear signal' named lay on selection
and of course you'll likely want to reverse the values used in the SV conditions
and that will do it