Author Topic: Formula for setting a maximum stop loss in lay market [TCKT15072013FML]  (Read 5839 times)

Tags:
  • All members
  • Posts: 26
Hi,

I have set a variable for maximum stop loss (lay)

maxLay = 20

when my stop loss triggers I want it to take the best available price and not be put straight in at  the highest value, would the below formula be correct.

The formula I am trying to create will put a Lay bet into the market at the current lay price plus 2 ticks upto the maxlay of 20, or if the market has passed 20 then 20 will be put into the market.

IF(r_ticks(original_price, 2)<maxlay, (r_ticks(original_price, 2), maxlay)

Regards

James

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Formula for setting a maximum stop loss in lay market
« Reply #1 on: 15 Jul 2013, 17:15 »
hi
yes that would work,BUT it would be easier to put 20.00(or your maxlay variable) in the price box, then betfair will match at the best price available up to 20.00(or the value of your variable)


mcbee
Please read the following  disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 26
Re: Formula for setting a maximum stop loss in lay market
« Reply #2 on: 15 Jul 2013, 21:20 »
Thanks,

I am placing a lay bet though not a back bet so putting in my max straight away will just offer it straight up to be matched.

Example - present lay odds are 4.0 - my stop loss triggers I want to enter at 4.2 or upto a max of 20 so that my offer is the bets market price.

The way you suggest would put my max straight into the market and I would not be getting the best odds and would instead be offering odds far outside the market.

present offer 4 - my offer 20

I think my formula may be slightly incorrect, what I want to do is offer a lay price 2 ticks better than the present market price upto a maximum limit.

Having only just started to get to grips with formulas I am a little out of my depth.

IF(r_ticks(original_price, 2)<maxlay, (r_ticks(original_price, 2), maxlay)

Regards

James


  • All members
  • Posts: 26
Re: Formula for setting a maximum stop loss in lay market
« Reply #3 on: 15 Jul 2013, 21:51 »
Would this be the correct formula to use ?


IF(r_ticks(back_price, 2)<maxlay, (r_ticks(back_price, 2), maxlay)

Example: best back price is presently 4.0 and my stop on a trigger has triggered

IF back price plus 2 ticks is lower than maxlay (user variable) THEN place a laybet at 4.2 upto a maximum of maxlay.

I think I was confusing myself with the fact that lay bets are offered to be backed and vice versa.

Regards

Console

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Formula for setting a maximum stop loss in lay market
« Reply #4 on: 15 Jul 2013, 23:37 »
hi
yes, your formula would work.
i see now what you are trying to do with the back plus 2 ticks, getting better value if the lay odds are to far apart from the back odds.


mcbee
Please read the following  disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 26
Re: Formula for setting a maximum stop loss in lay market
« Reply #5 on: 16 Jul 2013, 19:26 »
I have run the above formula today and it has failed to trigger, do you think I have missed some brackets out of the equation ?

Regards

Console

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Formula for setting a maximum stop loss in lay market
« Reply #6 on: 16 Jul 2013, 20:42 »
hi
yes, if you have copied and pasted this   IF(r_ticks(back_price, 2)<maxlay, (r_ticks(back_price, 2), maxlay)

you are 1 bracket ) missing


mcbee
Please read the following  disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 26
Re: Formula for setting a maximum stop loss in lay market
« Reply #7 on: 16 Jul 2013, 20:59 »
Would I be correct in thinking the missing bracket should be at the end to complete the formula correctly ?


IF(r_ticks(back_price, 2)<maxlay, (r_ticks(back_price, 2), maxlay))


Regards




  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Formula for setting a maximum stop loss in lay market
« Reply #8 on: 16 Jul 2013, 22:25 »
hi
correct.
because you have the   (r_ticks(back_price, 2), maxlay)
with the extra   (   at the beginning.


mcbee
Please read the following  disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 26
Re: Formula for setting a maximum stop loss in lay market
« Reply #9 on: 17 Jul 2013, 19:33 »
I dont seem to be having any luck with that formula so i tried a different approach.

IF best<maxlay, best, maxlay

This also doesnt seem to trigger, the only time I can get it to trigger is if I simply state "best"

Is there something I am missing ?

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Formula for setting a maximum stop loss in lay market
« Reply #10 on: 17 Jul 2013, 19:56 »
hi
could you include your trigger with the formula so that i can test it to see where the problem is.


mcbee
Please read the following  disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: Formula for setting a maximum stop loss in lay market
« Reply #11 on: 17 Jul 2013, 21:12 »
hi
i haven't tested it yet, but you cannot have best as a calculation figure, because best is anything from 1000 to 1.01 for lay betting, best tells betfair that you will except any price that is available at the time of the bet.
you should use      back_price


mcbee
Please read the following  disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

 

Please note, BetFair is seems to be currently OFFLINE