I'm having some trouble utilising the time variables.
I have triggers that open and close trades. Sometimes they close with the incorrect stake, which means they leave the trade with a larger PL on one side.
To get around this, I have created a trigger that waits a few minutes after the last matched bet, and then equalises the PL. Which works quite well in Time Machine.
The trigger above waits until
-There are no unmatched bets.
-There is at least 1 matched bet
-(now_time-bm_1_laytime) or (now_time-bm_1_backtime) is greater than 0.004
I came up with 0.004 by dumping out the times, and working out what they meant.
10:20:00 = 43487.4305563
10:25:33 = 43487.4344155
By the above, I concluded that 0.004 is about 5 mins.
Unfortunately, it doesn't work as expected.
As you can see below, the trade is executing instantaneously:
Would anyone be able to shed some light onto this, as I can't quite work out what I've done wrong?