Author Topic: Nigel's New Trigger  (Read 5345 times)

Tags:
  • All members
  • Posts: 258
  • Gender: Male
Nigel's New Trigger
« on: 02 Apr 2014, 14:29 »
I have made some triggers in the past but need somebody to remake them for me so that I can see how others plan and set them out. By seeing other people's work and understanding it, I may possibly be able to learn more than I can by messing about on my own.

This is what I want, please ( the figures are provided as a rough guide only and would be changed when the trigger was actually used.)

(a) a horse should be backed subject to the following conditions :

(i) its starting price is equal or greater than 6,

(ii) its present back price has dropped to 4 and a back bet should be placed at this price.

(b) if the back price of the horse continues to shorten, a lay bet should be placed at 3.5,

(c) if the back price does not drop so as to allow the lay bet at (b) , a stop loss should operate if the price goes back out to 6.

There are two additional issues I would like to be able to understand more fully. These are :

(i) being able to express the above triggers in terms of "ticks", drops and rises, rather than using actual numbers, and,

(ii) being able to hedge for a profit instead of placing a straight lay bet as stated above.

A kind person helped me make this type of trigger and he incorporated a "fill or kill" feature. It might be useful as a topic for general discussion if the relevance of this feature was commented on by people who know far more about this than I do. In the fast moving markets which we find towards the end of horse races, is such a feature desirable or is it an unnecessary complication ?

I think that my request involves most of the factors needed when considering the creation of triggers for horse racing, backing, laying, hedging, stop loss and am certain that a proper understanding of individual triggers for each of these would allow me, and others, to design more complicated, and hopefully profitable, triggers by adding conditions of our choice.

Thanks.

Nigel


  • Moderator
  • Posts: 3597
*
Re: Nigel's New Trigger
« Reply #1 on: 03 Apr 2014, 06:57 »
Hi Nigel
I will help you with this trigger. I should have something for you to look at Friday pm.
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: 258
  • Gender: Male
Re: Nigel's New Trigger
« Reply #2 on: 03 Apr 2014, 08:36 »
Thanks, Mark. My "trigger" is not of commercial value but will be useful to everybody as a collection of"building blocks" which they can incorporate in their own strategies. The documentation relating to MFP was poor but is now improving dramatically. I was surprised to find that the simpler things I have asked for were not documented before. I'm sure that a great many people have trialed MFP and been frightened away by its complexity. Many examples of very simple triggers will encourage new users to persevere.

  • Moderator
  • Posts: 3597
*
Re: Nigel's New Trigger
« Reply #3 on: 04 Apr 2014, 14:02 »
Hi Nigel

Please find attached a trigger file for you.

Because you are hedging in-play, the biggest problem is gaps in the prices triggering a stop-loss prematurely. I know you have commented on this on numerous forum topics. I faced the same problem when testing, so I have added a condition to limit the gap between best back and best lay prices to a specific number of ticks which you can set in the constants. You will need to make a judgement between a suitable gap, or the possibility of the bets (back or lay) not being placed because of the gap condition. If you operate a hedge without a gap condition, the stop-loss could fire straight away. e.g. back matched at 4.00 best lay price is 7.8, stop-loss fires. In my opinion, these triggers work best where there is money waiting at all prices in the range you are trading.

There are two trigger blocks in the file. Only one should be enabled at any one time.

The first trigger block is back / lay / stop-loss as per your spec.
This trigger works as a "free bet". Backing and laying the same amount on the selection for a profit or loss on that selection with a zero profit or loss on all other selections.

The second trigger block is back / hedge.
This trigger will produce an equal profit or loss across all selections in the market.
I have activated the trailing stop-loss on this one, because it is much better at squeezing out some more profit. It will keep your position open all the time the profit is going in your favour, only closing it if the price goes against you by x ticks off your best position. If you don't want it, just untick  trailing stop-loss in the hedging trigger.

I have put in quite a few constants to allow you to easily adjust the various parameters:
ba - back amount
msp - minimum actual starting price
bp - back price to trigger the opening back bet
lp - lay price to trigger the lay bet for profit
sl - lay price to trigger the stop-loss lay bet
b_gap_ticks - max gap between best back and lay prices in ticks for the back bet
l_gap_ticks - max gap between best back and lay prices in ticks for the stop-loss lay bet
slt - stop-loss ticks for the trailing stop hedge

Please try the triggers out in test mode or in Time Machine.

Your question regarding fill or kill: I do not think FOK would be helpful in these triggers. You are not offering prices and changing them according to the market moves, nor are you chasing a price, e.g. to be at the front of the gap between best back and best lay prices. But, because these trigger are for in-play, you could consider changing the price box to "best" which will place you bets at the best available price in the market at the time of execution.

Hope this helps, and if you have any other questions please ask.

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: 258
  • Gender: Male
Re: Nigel's New Trigger
« Reply #4 on: 04 Apr 2014, 14:23 »
I am very grateful and will try the trigger later today. I understand that the thinking behind MFP is based on the manipulation of data, something like the program Excel. Many years ago I tried to learn the computer language BASIC. It was comparatively easy and I really liked the use of conditions  and the GOTO command. Is it at all possible for MFP to be used in a similar manner ? By this I mean is it possible to jump from one set of triggers to a completely different set if a particular condition is/is not met ?

I don't understand the concept of "blocks" as used in MFP. If I had three blocks of triggers, is it possible to use one and disregard the others if a particular condition was met/not met ? If it was possible it would greatly reduce the complexity of MFP.  Individual triggers would remain comparatively simple as they would not have to be written so carefully.

I don't know if I have explained myself properly here and apologse if I am confusing you. My simple brain wants things to be put into neat compartments and I don't like a large number of complex triggers in one block (place).

Again, thank you. I'll report back after testing and allow everybody to see your efforts which I am sure they will find helpful.

  • Moderator
  • Posts: 3597
*
Re: Nigel's New Trigger
« Reply #5 on: 04 Apr 2014, 15:08 »
Hi Nigel
Your description of "compartments" is indeed the same principle as "trigger blocks". The manual describes a block as a logical container for triggers.
If I could give an example:

BLOCK
delete un-needed markets triggers
set refresh rates triggers
BLOCK
back trigger
greenup trigger
stoploss trigger

The first block has nothing to do with the betting triggers, and is separated out for neatness. You can just as well include the delete markets and refresh rates triggers in the main block, but it could become confusing.

Another purpose of trigger blocks is to repeat a batch of triggers. Here is the principle behind a repetitive scalping trigger:

BLOCK repeat every 10 secs
back trigger
greenup trigger
stoploss trigger
close block trigger ensures no unmatched bets and all is OK to repeat

Lastly in today's lesson is the Basic GOTO command you mentioned.
there are a number of ways to do this including the Remember trigger action, but here is the easiest:
TRIGGER:
Action: activate trigger or block. Name: pre-off scalping trigger
Condition: markets minutes before the off is less than 120
TRIGGER:
Action: deactivate trigger or block. Name: pre-off scalping trigger
Action: activate trigger or block. Name: dutching trigger
Condition: markets minutes before the off is less than 1

In the above simplistic example we are scalping pre-off from 2 hours to 1 minute before the off, and then stopping scalping and running a dutching trigger a minute before the off.

We can have multiple trigger blocks in the same trigger file, some could be soccer, others racing, others greyhound etc. and can use triggers to call / activate / deactivate them. The possibilities are plentiful.
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.

  • Moderator
  • Posts: 3597
*
Re: Nigel's New Trigger
« Reply #6 on: 04 Apr 2014, 15:50 »
...further to the above, if you want to visually simplify a trigger file when you are working on it, you can collapse / expand the blocks as shown in the attached screenshot.
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: 258
  • Gender: Male
Re: Nigel's New Trigger
« Reply #7 on: 04 Apr 2014, 16:07 »
Thank you, Mark. You have taught me a great deal and I am very grateful. The triggers work. Of course, they are not profitable, not yet anyway, but I didn't want a "Golden Egg" and just wanted to see how you did the triggers and to learn by seeing your method.

I think that consideration should be given to incorporate some of the recent work on triggers in the manual itself. By giving people real triggers which work, it will encourage them to experiment and learn more for themselves.

If I lock this topic now will it still be available for all to see, please ? I will refer to this often in future and want to ensure it is available for me and not hidden away somewhere.

  • Moderator
  • Posts: 3597
*
Re: Nigel's New Trigger
« Reply #8 on: 04 Apr 2014, 16:18 »
Hi
Yes you can lock the topic and in due course it will be moved to Triggered Betting.
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