Cancel unmatched lay bet if best back price is greater?
-
- Posts: 1676
- Joined: Fri Nov 20, 2015 9:38 am
- Capture the price at which your unmatched bet is placed as a SV
- Use the "Cancel Bets" rule for everything <= the SV, if back price > SV
I usually set a signal when the bet is placed & reset it when the cancel bet rule runs, so it only places a bet if signal not set and only cancels if signal set.
From that, I realised I can set it in conditions directly of cancel bets.. Save the number of unmatched lay bets at best back price. Then cancel if unmatched bets at best back price = 0sionascaig wrote: ↑Thu Sep 19, 2024 9:54 pm- Capture the price at which your unmatched bet is placed as a SV
- Use the "Cancel Bets" rule for everything <= the SV, if back price > SV
I usually set a signal when the bet is placed & reset it when the cancel bet rule runs, so it only places a bet if signal not set and only cancels if signal set.
edit: Ah. Now it seems to cancel quicker than its able to register there is a bet there.
-
- Posts: 1676
- Joined: Fri Nov 20, 2015 9:38 am
Unmatched bets less than 0? How come not equal to zero?sionascaig wrote: ↑Fri Sep 20, 2024 8:50 amThat is where the signal helps.. Also an unmatched bets > 0 condition..
... I'm assuming you picked that up )
Ive never used signals so was avoiding it but best I learn how
-
- Posts: 1676
- Joined: Fri Nov 20, 2015 9:38 am
Unmatched bet amounts (I should have said) > 0 for the "cancel" rule... No point in it running if nothing to cancel...
It also helps if you have partial matches, the price moves away & you want to cancel residual amounts before a rinse & repeat (although, obviously the amount you are cancelling could be greater than 0 in that case)... Fill / kill also handy in these cases, depending on what you are doing & how long you want bets up for...
I want my bet gone when someone overtake me. BUT a condition I have set for my bet placement means I can't just use "back price greater than 1 second ago" type thingsionascaig wrote: ↑Fri Sep 20, 2024 9:40 amUnmatched bet amounts (I should have said) > 0 for the "cancel" rule... No point in it running if nothing to cancel...
It also helps if you have partial matches, the price moves away & you want to cancel residual amounts before a rinse & repeat (although, obviously the amount you are cancelling could be greater than 0 in that case)... Fill / kill also handy in these cases, depending on what you are doing & how long you want bets up for...
Never thought about the residual amounts!
Fill/kill ive been using as an interim but isn't as efficient that way
-
- Posts: 1676
- Joined: Fri Nov 20, 2015 9:38 am
Being at the front of the queue & cancelling bets when the price moves away can become a bit of a challenge when you have to deal with spoofing etc but at a simple level just do as above, i.e.
When the bet is placed capture the price is placed in the bet placement rule, say SV = "BetPrice"
AND
Use the Cancel rule with a condition that Best Back Price > BetPrice when you want to remove it.
Once you get that running then need to deal with someone else placing small amounts above you (do you want to jump ahead or not depending on size) and the situation when the money below you disappears and leaves you exposed...
Expect to spend a lot of time on developing / testing )
I suspect you're already using an almost identical .baf to me regarding when the money below disappears. I just need to fix my bet being left on the ladder and make sure I cancel efficiently rather than kill/fill.sionascaig wrote: ↑Fri Sep 20, 2024 10:16 amBeing at the front of the queue & cancelling bets when the price moves away can become a bit of a challenge when you have to deal with spoofing etc but at a simple level just do as above, i.e.
When the bet is placed capture the price is placed in the bet placement rule, say SV = "BetPrice"
AND
Use the Cancel rule with a condition that Best Back Price > BetPrice when you want to remove it.
Once you get that running then need to deal with someone else placing small amounts above you (do you want to jump ahead or not depending on size) and the situation when the money below you disappears and leaves you exposed...
Expect to spend a lot of time on developing / testing )
Will have a play with the settings youve suggested above later on today
Just realised what you meant. No I wanted to set it as unmatched bets at best back price =0 . If my unmatched bet is at the best back price I want ot to stay there. However, is someone jumps ahead of me, then unmatched bets at best back price would now =0 and therefore cancel my unmatched bet which is now sitting at 2nd best back pricesionascaig wrote: ↑Fri Sep 20, 2024 8:50 amThat is where the signal helps.. Also an unmatched bets > 0 condition..
... I'm assuming you picked that up )