Author Topic: last_lost without last_lost  (Read 4364 times)

Tags:
  • All members
  • Posts: 3337
  • Karma: +272/-0
last_lost without last_lost
« on: Wed, 13 June, 2012, 20:09 »
Hi
How can I apply a staking plan to individual trades in markets which have not yet been settled, and therefore win/lose history variables are absent? Specifically, this would be used for repetitive pre-event trading. In other words, how can I calculate a figure equivalent to last_lost immediately after the last trade, in order to recoup any loss in the last trade in the next trade, but without the use of win/lose history variables?
Your help will be much appreciated.
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.

  • Nerd
  • Élite
  • Posts: 589
  • Karma: +27/-1
  • Gender: Male
  • I think I could be on to something here!
*
Re: last_lost without last_lost
« Reply #1 on: Wed, 13 June, 2012, 20:28 »
Anyone who has seen a couple of my posts will know I am not a fan of loss recovery.

In a perfect world, where all races begin in the right order I would have a global variable to store the PnL on say the FAV if that is what I was trading on, when the market turns in play.
If less then zero then plan for loss recovery. If greater then zero, then you are green on the FAV and happiness.

hope this points you in the right direction.
Fortune favors the brave!

  • All members
  • Posts: 3337
  • Karma: +272/-0
Re: last_lost without last_lost
« Reply #2 on: Wed, 13 June, 2012, 20:59 »
much obliged 1oser
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.

  • Administrator
  • Posts: 8952
  • Karma: +337/-2
  • Gender: Female
*
Re: last_lost without last_lost
« Reply #3 on: Thu, 14 June, 2012, 13:48 »
Hi
How can I apply a staking plan to individual trades in markets which have not yet been settled, and therefore win/lose history variables are absent? Specifically, this would be used for repetitive pre-event trading. In other words, how can I calculate a figure equivalent to last_lost immediately after the last trade, in order to recoup any loss in the last trade in the next trade, but without the use of win/lose history variables?
Your help will be much appreciated.

What would be your method for determining the winner then?
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Usuários brasileiros, bem vindos ao nosso WhatsApp chat!

Присоединяйтесь к нашей официальной группе ВКонтакте!

  • All members
  • Posts: 3337
  • Karma: +272/-0
Re: last_lost without last_lost
« Reply #4 on: Thu, 14 June, 2012, 14:04 »
What would be your method for determining the winner then?
Hi
No winner, but I see your reason for asking. Just repetitive back/lay trades on a single selection up to event start, similar to some of the example hedging triggers.
So I back and hedge lay. I have either a loss or a profit on that trade. How can I determine a figure equivalent to last_lost or last_won for that trade, considering the market will not be settled, and win/lose variables are not available for use. As 1oser suggested, a variable holding a running profit/loss will suffice, but I am stuck on the make up of that variable.
Once I know the profit/loss on the last trade, I can close the block and repeat the trigger with an appropriate staking plan. All this takes place before event start. All positions are closed before event start.
example:
if I back at 1.98 and lay at 1.91 that trade is profitable. How do I determine the profit on that trade as soon as the lay bet is matched?
if I back at 1.98 and lay at 2.02 that trade is a loss. How do I determine the loss on that trade as soon as the lay bet is matched?  
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: 215
  • Karma: +4/-0
*
Re: last_lost without last_lost
« Reply #5 on: Thu, 14 June, 2012, 15:26 »
...
if I back at 1.98 and lay at 1.91 that trade is profitable. How to I determine the profit on that trade as soon as the lay bet is matched?
if I back at 1.98 and lay at 2.02 that trade is a loss. How do I determine the loss on that trade as soon as the lay bet is matched?  
...
MarkV,

if the markets are not yet settled you cannot calculate profit_loss. What does your trigger before the off? Greenout / Spread loss? If yes, you can calculate the expexted P/L after greenout / spread loss with block of 3 triggers:

1.) set myexpectedpl to 0 for favourite only
2.) if Selection's profit_loss is greater than 0 and lay_price>1:
               set myexpectedpl to myexpectedpl + profit_loss/lay_price
3.) if Selection's profit_loss is less than 0 and back_price>1:
               set myexpectedpl to myexpectedpl + profit_loss/back_price


After execution this block, myexpectedpl has the expexted value if you do a simple greenout /spread loss. If you trade only 1 selection, to keep formula simple, selection 1, and never do a bet on selection 2, your expexted pl calculates as follows:

1.) if s_1_profit_loss > s_2_profit_loss
             
      set myexpectedpl to s_1_profit_loss-(s_1_profit_loss-s_2_profit_loss)/s_1_lay_price


2.) if s_1_profit_loss <= s_2_profit_loss
             
      set myexpectedpl to s_1_profit_loss+(s_2_profit_loss-s_1_profit_loss)/s_1_back_price

 

  • All members
  • Posts: 3337
  • Karma: +272/-0
Re: last_lost without last_lost
« Reply #6 on: Thu, 14 June, 2012, 16:03 »
Hi Martin
Yes the hedge is distribute loss, which greens or reds up each trade.
I was looking at g_ticks or r_ticks to calculate the trade p/l, but I think your suggestion of expectedpl is exactly what I am after.
Very much appreciated.
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.

  • Administrator
  • Posts: 8952
  • Karma: +337/-2
  • Gender: Female
*
Re: last_lost without last_lost
« Reply #7 on: Fri, 15 June, 2012, 12:14 »
Mark,

The formula for the profit or loss from a trade (either green-up or distributing loss) is very simple, namely lay amount - back amount.

So to know the total amount of money you would win or lose from all the trades performed on a selection, write lay_matched - back_matched. To only get the result of the latest trade, try bm_laya - bm_backa.
Of course, this only works if all bets are matched.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Usuários brasileiros, bem vindos ao nosso WhatsApp chat!

Присоединяйтесь к нашей официальной группе ВКонтакте!

  • All members
  • Posts: 3337
  • Karma: +272/-0
Re: last_lost without last_lost
« Reply #8 on: Wed, 20 June, 2012, 22:25 »
Mark,

The formula for the profit or loss from a trade (either green-up or distributing loss) is very simple, namely lay amount - back amount.

So to know the total amount of money you would win or lose from all the trades performed on a selection, write lay_matched - back_matched. To only get the result of the latest trade, try bm_laya - bm_backa.
Of course, this only works if all bets are matched.
Oxa, on these trades I am indeed looking for fully matched bets, therefore your 'back to basics' advice makes sense. Thank you.
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.