Author Topic: Problem with now_time_datestr  (Read 220458 times)

Tags:
  • All members
  • Posts: 19
Problem with now_time_datestr
« on: 15 Apr 2024, 17:41 »
Hi. Not sure what I'm doing wrong here help would be appreciated.
I have a trigger which is checking in its condition the value of now_time_datestr against a user variable containing a previous assignation of said variable. basically I'm looking for a date change between the last market where the trigger was run and the current one.
I've attached the trigger and the log. The condition check is not working correctly because the previous value of the date stored in variable dateString is not being preserved as a string. The intermediate and final values are different namely:



Checking condition or Favourite's Trigger Expression dateString is not equal to now_time_datestr.
17:19:54Selection: Phoenix Passion, initial expr.: dateString, intermediate: 15/04/2024, final: 0.00185277.
My condition against this value with the current date is therefore always true which means I'm always detecting a date change.
Is this something I've done wrong ? I don't understand why the intermediate value is a string but the final value has changed to a floating point.
Trigger and log attached. Cheers in advance.

  • All members
  • Posts: 19
Re: Problem with now_time_datestr
« Reply #1 on: 15 Apr 2024, 17:55 »
Sorry wrong attachment!! Attached here the two correct files apologies.

  • Moderator
  • Posts: 3642
*
Re: Problem with now_time_datestr
« Reply #2 on: 16 Apr 2024, 13:10 »
Hi
Yes it does seem to be parsing the date forward slashes as division.

My suggestion here is to use INTEGER(now_time). The decimal part of now_time is hrs, mins, secs so if the decimal is removed then you can compare the date.

set user variable dateString value: INTEGER(now_time)
and then in the condition:
or favourite's trigger expression dateString is not equal to INTEGER(now_time)
    
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: 19
Re: Problem with now_time_datestr
« Reply #3 on: 25 Apr 2024, 19:16 »
Thank you MarkV it's working that way - much appreciated.

 

Please note, BetFair is seems to be currently OFFLINE