Author Topic: price last traded at  (Read 2572 times)

Tags:
  • All members
  • Posts: 49
price last traded at
« on: 20 Jan 2013, 02:56 »
hi all

Would someone mind telling me how i would record the last price at which i have traded for a given index ?

I am making back and lay bets using the index so have a bunch of back and lays for index 1 and i need to know the traded price for the latest one - (whether it was a back or lay doesn't matter)

The last price at which i traded is what i base my next bet on so bm_layp and bm_backp arent that helpful because one of them isn't the last bet and if i include a condition of (last traded price is x ticks higher than bm_layp or bm_backp) one of these prices will activate the trigger despite not being relevant to what is going on in the market at that specific time.

I've tried user variables based on the time the bets were matched e.g (now_time - bm_laytime)/0.00001157 is greater than (now_time - bm_backtime)/0.00001157 but struggle with what to put as the value for the variable.

thanks






  • Desenvolvedores de trigger
  • Posts: 919
  • Gender: Male
*
Re: price last traded at
« Reply #1 on: 20 Jan 2013, 08:47 »
Hi

Will try to help

I think bm_type is what you need.

From manual explanation.....

"The type of the last non-SP matched bet placed on the selection.
The variable will return the index that corresponds with the type of
the bet. Thus, 1 stands for a lay bet, and 2 stands for a back bet. If
no matched bets found, this will return 0."

So...

First you need be sure u have any kind of bet. U can use this.

And selection index is equal to x
And selection trigger expression bm_number is greater than 0


Now, dont know how you intent to use it,but after u know there are bets placed in this index, using this formula will give u the last bet price u place, based on bm_type.

IF(bm_type=1,bm_layp,bm_backp)

Hope that fix your problem

pcal72
Desenvolvedor de triggers oficial Market Feeder pro

Também faço:
Cursos sobre Market Feeder pro (gratuitos)
Triggers (gratuitos para sempre)

Para saber informações contacte-me!

NOTA: TESTE SEMPRE OS SEUS TRIGGERS ANTES DE OS USAR COM FUNDOS REAIS!

  • All members
  • Posts: 490
  • Gender: Male
Re: price last traded at
« Reply #2 on: 20 Jan 2013, 11:50 »
What about an IF statement with a user variable as you say.
IF(bm_backp>0,bm_backp,bm_layp)
Affected by Trigger x [the one that fires the back or lay]
Improvise Adapt Overcome

  • All members
  • Posts: 49
Re: price last traded at
« Reply #3 on: 20 Jan 2013, 12:13 »
perfect - thanks for the replies

using the 'if' statement as the value of the trigger seems to have done the trick.

 

Please note, BetFair is seems to be currently OFFLINE