Author Topic: BACK and LAY Scalping with triggers  (Read 900 times)

Tags:
  • Administrator
  • Posts: 8821
  • Gender: Female
*
BACK and LAY Scalping with triggers
« on: 24 May 2022, 08:20 »
Triggers are smart enough to do automated scalping. Scalping is a betting technique in which you place back and lay bets at the edge of the currently traded price, to secure guaranteed profit regardless of the outcome.

Traders normally do scalping manually, using the Ladder. While you can also do this manually in MarketFeeder Pro, I recommend using triggers.
Triggers will place the opening bets, update them regularly to reflect the changing prices, and eventually execute a stop-loss just before the off if some of the bets are unmatched.

In this video, we’ll watch triggers do scalping in real-time mode on BetFair.

https://youtu.be/wmUjB_fBXrc

The triggers are placing bets with real money. It is hard to simulate scalping in Test Mode.

You can download the triggers and try them on your own:

https://marketfeeder.co.uk/learn/triggers/classic-scalping/
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: BACK and LAY Scalping with triggers
« Reply #1 on: 24 May 2022, 11:57 »
In a bid to learn how triggers work in general, let's look at one of the triggers here, "first backing", which places an opening back bet aiming to green it up later.



The trigger is set to be repeated no more often than once in 2 sec, and it has two actions:


1.    
cancel then back. The Price is set to r_ticks(lay_price, -offset_tcks). Here, r_ticks is a function that adds the specified number of ticks in the second argument to the price in the first argument. We have lay_price for the selection's lay price (internal variable) and offset_ticks for the number of ticks (a constant we defined in the triggers header). In other words, we back at the price that is offset_ticks lower than the selection's lay price.
 
 The Amount of the bet is
bet_size - back_matched. Here, bet_size is a constant for the initial size of bet, and back_matched is the total amount of your matched back bets on this selection. Why not just use bet_size? Because we intend to be re-posting our bet at a new price once the market moves up or down. Some part of the bet can be matched at any time, and the rest of it may remain unmatched. To avoid placing the same amount over and over, we must deduct the amount that has been already matched.

2.    
set user variable. We need this action to safely loop the trigger. It writes the current time into the variable last_bl_time. Next time the trigger repeats its action, it will make sure to wait for several seconds since last_bl_time, otherwise we risk producing a bunch of duplicate bets we don't need.
Let's open the trigger's conditions.


First comes a condition block. You probably remember that a block contains several conditions or nested condition blocks that are connected with an identical logical operator, such as "AND" or "OR."

  • The selection's rank (e.g. 1 for first favourite, 2 - for 2nd favourite, and so on) must fall within the values defined in the constants.
  • AND this trigger must not have placed bets in this market (i.e. running for the first time)
OR
  • The trigger has placed bets on this selection before. This condition insures you against the possible change of the selection's rank and falling out of the required range after some bets have already been placed on it.
  • AND the price of the selection's latest unmatched back bet (internal variable bu_backp) is no longer equal to the lay price minus offset_tcks, i.e. the market has moved
  • AND the lay offer at the current price is at least one bet_size greater than what we placed as the initial bet (back_unmatched is the sum of unmatched back bets). We don't want to keep cancelling and re-placing our own bet, do we? Someone else must pour some money in at that price, and that's when the trigger will kick in and outplay them.

Second part of the conditions:



  • If a mere penny remains till the intended bet_size, we won't be pursuing that bet, as the exchange is not happy about you betting pennies
  • AND the selection must have a sufficient gap between its back and lay prices (the number of ticks is max_gap), otherwise scalping just won't work out, and instead bets will be placed at around current back and lay prices
  • AND enough time must be left till the beginning of the event
  • AND at least 3 seconds must pass since the last moment the trigger executed its actions. Now, remember the second trigger action "set user variable"? It comes into play now: the formula (now_time – XXX)/mf_second returns the number of seconds that have passed since the time recorded in the variable XXX (insert the actual name of the variable). Each time the trigger "first backing" repeats, it sets last_bl_time to a new value of time, thus waiting out till the exchange registers our bet and updates all the variables that our calculations depend on.

This is just one trigger out of the multitude that can be created to fulfill betting strategies. Yet even breaking down one trigger into simple pieces gives you more clarity on how to approach common problems in online betting. Don't shy away from experimenting with the conditions on your own, play around with constants and check what come out of it.


For a safe testing environment without the risk for your account to be blocked by BetFair, use Time Machine.

Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

 

Please note, BetFair is seems to be currently OFFLINE