Author Topic: stake from file, or Excel file  (Read 942 times)

Tags:
  • All members
  • Posts: 237
  • Karma: +1/-0
stake from file, or Excel file
« on: Tue, 11 July, 2017, 20:14 »
Hi,

Is it possible to get a stake for a bet, from an excel cell, or a text file?

I am using a strategy, on test, and I have not yet had any success with the way the fibonacci works in MFP, and I would prefer to develop my own way of doing this, through an app, and I can be assured that it is exactly correct, and also there is no concerns about other bets and results affecting the calculation.

So, if I am able to get the stake from a text file, or excel cell, this would be much preferred.

Is this possible?

If anybody is going to advise that I do fibonacci through MFP, I would prefer not.

I am not concerned about resource use by using excel, I know for some reason it is quite heavy with MFP, but I am not too concerned about this.

Thanks

Mark.

  • Moderator
  • Posts: 2799
  • Karma: +230/-0
*
Re: stake from file, or Excel file
« Reply #1 on: Tue, 11 July, 2017, 21:43 »
Hi
from an imported text file containing selection names and related values you would use imported_ variable
e.g.
"selection name"<tab>stake1<tab>stake2
"Jack Be Quick"<tab>10<tab>5

in the above selection Jack Be Quick the variable imported_1=10 and the variable imported_2=5
in your trigger amount field use imported_1 if you wanted to use the first imported value

to use a value from an Excel cell, e.g. Sheet1!B3
cell_Sheet1_B3
you can use this in conditions as well, e.g.
selections back price is greater than cell_Sheet1_B3

MFP must be connected to the workbook containing the cell referred to



 


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: 237
  • Karma: +1/-0
Re: stake from file, or Excel file
« Reply #2 on: Tue, 11 July, 2017, 22:17 »
Hi Mark,

Many thanks for your response, just tried it with a trigger, set a user variable and set the value as cell_mySheet_B1 - Beautiful!! shows up in view user variables.

Now, I want to tackle the file approach, so its more portable, with a view that I can share my trigger with someone else, who has no excel, and he runs his MFP on a server, and is not able to reference excel, so could be easier to use a text file. (remember I need to use an app to update the excel sheet if excel is the way I have to go)

Now, your explanation is straight forward, and using a "selection name", then this looks simple enough to use imported_1, extracting its value.

BUT, I need to be able to set the selection as the favourite, with an SP bet, and its Odds <= 2.0, I can do the SP part of it no problem, but, not sure how to set the text file, simply as the favourite?

Can you help with this?

Thanks.

Mark.

  • Moderator
  • Posts: 2799
  • Karma: +230/-0
*
Re: stake from file, or Excel file
« Reply #3 on: Wed, 12 July, 2017, 06:04 »
Hi
betting trigger conditions to include:
and selections rank is equal to 1
and selections back price is equal or less than 2.00
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: 237
  • Karma: +1/-0
Re: stake from file, or Excel file
« Reply #4 on: Sun, 16 July, 2017, 16:38 »
Hi,

OK, just so you know, I am using the LittleAcorns strategy (which I purchased some years ago) - I wasnt able to succesfully use the trigger that was created for me. Can't remember if it was you, mcbee, or Oxa.

The trigger, and all of its logic work perfectly, and if we were in an environment where I was only betting using LittleAcorns, then all would be fine, but, I use MANY strategies, and as a result, the bank figure that is used cannot be recalculated properly, so, for example, if my LittleAcorns system has bet on a selection, once its criteria has been met, then, I also have another 2 systems going, that produce a loss, and my LittleAcorns bet is a winner, and the net result, is a loss, then the trigger will calculate it as a loss. This is a very simple description, but hopefully those reading can see the issue.

So, I decided to get involved and make sure that there are no ongoing calculations on a bank, using a fibonacci system, because of the above. I decided to lok at doing the following, from the beginning of the cycle..

Set the initial stake, then if the criteria is met, this bet is placed, and once the bet has been placed, write the bet to a text/csv file.

I developed an application to check the result of a bet on a selection within a text file

So, for example, the textfile will contain the following:

["market_name"],["r_1_sel_name"]  --> save as c:\...LASel.txt.

My app will then go and check to see if the horse won or lost.

If the horse wins, then the stake needs to go up to the next level, based on the fibonacci series

All of the above is very easy - what I want to be able to do, is update a text file, with the next stake value. So, my thinking is a text file with the following entry...

["r_1_sel_name"](tab)10

And, the only thing I update is the 10, to the next stake level, and I can have a user variable set such that its value will be imported_1

Of course, that does not work, when I import, I get the message "nothing imported"

I can't add in selections, because I only want to be using the favourite

Hope its clear what I want to do. I am sure this is very simple.

Thanks

Mark.


  • Moderator
  • Posts: 2799
  • Karma: +230/-0
*
Re: stake from file, or Excel file
« Reply #5 on: Wed, 19 July, 2017, 07:05 »
Hi
thought long and hard about this and I don't think it's feasible to read a value from a text file without a related selection name.
as you have tested, you can use a value from an Excel cell, however, the text file import process requires a selection name and then any values you wish to import for that selection, you cant have variables in the text file, and you cannot have a text file with just the stake to read.

I appreciate you not wishing to use MFP for your staking calculations although I do think what you want to do can be achieved using MFP triggers without using the win/lose history variables by setting and updating your own user variables for your bank, staking etc.

just a couple of things I noted to mention to you that may be of help:
a market's winner name is available in the variable winner_name as soon as the market is settled by Betfair although I see you developed an external app to determine the winner name of a market you bet in.
also MFP has a built-in function: fibonacci(step, increment, start) which will return a number in the sequence, you can use this function in formulas, trigger conditions etc.
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: 237
  • Karma: +1/-0
Re: stake from file, or Excel file
« Reply #6 on: Wed, 19 July, 2017, 07:49 »
Hi MarkV,

Thanks for the efforts/thought..

Here is what I am going to try..

I will set a write to file trigger, where it will write a selection to a file, using ["r_1_sel_name"], at 6 minutes before the off

AND I will also do it for r_2, r_3, r_4, at the same time, and set the trigger to NOT overwrite

That way, I can have 4 entries for selections, with the horse name

and now that I actually have the selections, I can then use the app that I will write, to add in a (tab)<stake> to each of these

so, I will now have, for example..

horseA(tab)10
horseB(tab)10
horseC(tab)10
horseD(tab)10

I will use an import, and hopefully, this will import the selections...

I will also need some help to give me the correct instruction to do what I want to do...

NEXT, I will have a trigger to fire at between 3 and 5 minutes before the off, that will be able to extract the stake from ANY of the 4 entries above. My thinking is that it can get any of the above, and cannot fail, because surely all 4 of those will not become a nun runner...

The only thing I want to extract, is the <stake> value, in the case above, it is 10

My final selection will be ["r_1_sel_name"] whose back price is <= 2.0

I want to use the Amount value, to be imported_1, imported_2, imported_3 or imported_4

I am not sure which is the correct way to do this...

I effectively want to have another trigger which will extract the stake value from any of the 4 above

Set MFP to import c:\....sels.txt

So, in summary of the steps above...
execute these in order...
TRIGGER 1 writesel1:
6 minutes before the off
write text file c:\....sels.txt   --> no rewrite
["r_1_sel_name"]
TRIGGER 2 writesel2:
6 minutes before the off (after the prev trigger)
write text file c:\....sels.txt   --> no rewrite
["r_2_sel_name"]
TRIGGER 3 writesel3:
6 minutes before the off (after the prev trigger)
write text file c:\....sels.txt   --> no rewrite
["r_3_sel_name"]
TRIGGER 4 writesel4:
6 minutes before the off (after the prev trigger)
write text file c:\....sels.txt   --> no rewrite
["r_4_sel_name"]

My app will poll, to check for a new entry in the sels.txt file, once it finds this, add to each line (tab)<stake>

I now have 4 selections, with the intention of extracting the <stake> value

At the time of the expected bet, set the condition in a trigger to lay_price <= 2.0 && lay_price >= 1.5

write a trigger to give me a stake value, using any of the 4 above...

Once the bet is placed, my app will then delete entries from the text file, and will wait for the next set of entries, and the cycle will continue...

Hopefully, this is possible?

Do you have any suggestions? (apart from give up, its not possible!)

Thanks

Mark.

  • Moderator
  • Posts: 2799
  • Karma: +230/-0
*
Re: stake from file, or Excel file
« Reply #7 on: Thu, 20 July, 2017, 07:50 »
Hi
that should be ok, but use one trigger with multiple actions to write the file, see 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.