Author Topic: Time-dependent Statistics Criteria  (Read 260 times)

  • All members
  • Posts: 25
  • Karma: +0/-0
Time-dependent Statistics Criteria
« on: Fri, 11 May, 2018, 23:46 »
Hi,

I am thinking of making a new trigger but don't even know how to approach this. 

Basically, what I would like to do is to do live trading depending on how odds behave in a certain time window. For example, I would like to enter the market when odds in the last n minutes changed by less than x ticks. I was thinking of calculating standard deviation every n minutes but it seems hard and it might be some easier solution that you are aware of.

Any help is greatly appreciated. 

Thank you

  • Moderator
  • Posts: 2787
  • Karma: +229/-0
*
Re: Time-dependent Statistics Criteria
« Reply #1 on: Sat, 12 May, 2018, 05:46 »
Hi
these selection variables should do precisely that:

tdif_{minutes}
The change of the back price over the time specified, in price ticks. For example, if the price has changed from 3.0 to 3.65 within 4 minutes, then tdif_4 will return 13.
ltdif_{minutes}
The change of the lay price over the time specified, in price ticks. For example, if the price has changed from 6.0 to 5.1 within 11.5 minutes, then tdif_11.5 will return -9.

so your condition could be something like:
and selections trigger expression tdif_5 is between -10 and 10

there is also a selection parameter condition you could use:
and selections back ticks dif over n mins is between -10 and 10
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: 25
  • Karma: +0/-0
Re: Time-dependent Statistics Criteria
« Reply #2 on: Sun, 13 May, 2018, 04:32 »
Mark,

You are awesome. Thanks

  • All members
  • Posts: 25
  • Karma: +0/-0
Re: Time-dependent Statistics Criteria
« Reply #3 on: Mon, 14 May, 2018, 01:03 »
Mark,

A quick question. Is it possible not to check this criteria during HT break (footie markets)? 

  • Moderator
  • Posts: 2787
  • Karma: +229/-0
*
Re: Time-dependent Statistics Criteria
« Reply #4 on: Mon, 14 May, 2018, 06:05 »
Hi
the match_minute variable increments during 1st half stoppage time and then resets to 45. e.g. it goes
44, 45, 46, 47, (ht start) 45, 45, 45....(2nd half start) 46, 47, 48....

so you could use a condition block something like:

AND
     selections trigger expression match_minute is outside 44 and 50 
     and selections back ticks dif over n mins is between -10 and 10

or you could similarly use minutes since the off making an allowance for stoppage time:

 AND
     markets minutes since the off is outside 47 and 63
     and selections back ticks dif over n mins is between -10 and 10  

you would need to test to find your optimum "outside range"
     
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: 25
  • Karma: +0/-0
Re: Time-dependent Statistics Criteria
« Reply #5 on: Tue, 15 May, 2018, 10:20 »
Thanks Mark! The first solution seems to be working well for me. 

My final question would be about tdif_{n} variable. Does it accept high precision floats? Basically, I am thinking of creating a function that changes the value of n as a function of time.

So let's say it is 30th minute into the match, then I can calculate n= f(t=30) = 5 (let's say). What if my function returns a crazy number like 3.63463414?? Will tdif still accept it?

I have tried using {} and (), such as tdif_{func} and tdif_(func), to put my function (quadratic with respect to match_minutes) after tdif_ but my trigger does not fire. What would be the correct syntax?

Thank you for all your help

  • All members
  • Posts: 25
  • Karma: +0/-0
Re: Time-dependent Statistics Criteria
« Reply #6 on: Tue, 15 May, 2018, 19:58 »
Oh my god. I have found where the problem is. If you use any formula with tdif it will give you something like this"
14:54:28    Checking condition and Selection's Trigger Expression tdif_(match_minute*-0.0852+8.3) is between -20 and 11.
14:54:29Selection: Under 2.5 Goals, initial expr.: tdif_(match_minute*-0.0852+8.3), intermediate: tdif_+3.78184400, final: tdif_+3.78184400.
14:54:29Selection: Over 2.5 Goals, initial expr.: tdif_(match_minute*-0.0852+8.3), intermediate: tdif_+3.78184400, final: tdif_+3.78184400.
The problem here is that + in tdif_+3.78184400.

I have tried two conditions one was tdif_(0.5) -> working fine, and tdif_(+0.5) -> not working at all.
Any solution to this??

  • Moderator
  • Posts: 2787
  • Karma: +229/-0
*
Re: Time-dependent Statistics Criteria
« Reply #7 on: Wed, 16 May, 2018, 20:19 »
Hi
I've had a bit of a play and I think you need to use an absolute value and calculate the formula in a user variable. Adjust your between range accordingly. 

TRIGGER
set user variable, name: myvar, value: ABS(match_minute*-0.0852+8.3)
no conditions
execute: no more often than 0.2 sec

your trigger condition:
and selections trigger expression tdif_myvar is between 0.1 and 11 



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.