Author Topic: Need help - Write to a file  (Read 148 times)

Tags:
  • All members
  • Posts: 71
  • Gender: Male
Need help - Write to a file
« on: 14 May 2024, 12:46 »
Hello. I need some help in this trigger to write in a file some fields.

I managed to put this working but it won´t do what I want. First of all, it writes 2 files. One with the headers and the other with the fields that I want. But in this second file, it wrotes 2 line instead of 1. And in the name of the file I want the date but it returns another thing.

How can I fix this?

1- The file name with the date in the dd/mm/yyyy
2- 1 line instead of 2
3- 1 file only

Another thing, is that this trigger is to be used in a day in Horse Races. So, the idea is to have a file (.txt or .csv) that returns me the Headers and in each line the bet that was put in the markets in that day.

Example:

Date 



  • All members
  • Posts: 71
  • Gender: Male
Re: Need help - Write to a file
« Reply #1 on: 14 May 2024, 12:52 »
Sorry, I click to post by mistake.... I missed to put my files for you, to see what is wrong.

Example:

Date                 MarketName                                                                                SelectionName     SP        Stake
5/14/2024      Horse Racing / GB / Wolverhampton 29th Apr/ 17:30 6f Nov Stks       Marry The Night   5.00     10.00

  • Moderator
  • Posts: 3622
*
Re: Need help - Write to a file
« Reply #2 on: 17 May 2024, 18:11 »
Hi
Please try the attached trigger in test mode. The laying trigger is so I could test the trigger on a days markets. I have disabled it but you should put your laying trigger in the same place.

The trigger will write headers to the text file at the start of the day and will add entries to the file as each market goes in-play.
The name of the text file contains the date string.
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: 71
  • Gender: Male
Re: Need help - Write to a file
« Reply #3 on: 17 May 2024, 19:42 »
Thanks MarkV... 

It worked but that is only one thing that is not right. It doesn´t put the stake. I have the parameter [lay_sptotal] but it seems not working. Maybe it´s not the right parameter.


MarketName,SelectionName,SP,Stake
"17/05/2024","Horse Racing / IRE / Leopardstown 17th May / 18:40 Leopardstown 17th May - 1m4f Hcap - 1m4f Hcap","Rotolo",6.57,0.00

  • All members
  • Posts: 71
  • Gender: Male
Re: Need help - Write to a file
« Reply #4 on: 17 May 2024, 20:26 »
I already made it.. It´s the parameter [lay_matched]

 

Please note, BetFair is seems to be currently OFFLINE