Anyone want to join in on added functions

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
NotBothered
Posts: 173
Joined: Wed Jun 15, 2022 9:40 am

OK I hit up chatgpt 4 for few things to add into excel sheet

I am not a programming guy and these will need refinement but here are some of my ideas

Sub CountTicks()
Dim upTicks As Integer
Dim downTicks As Integer
Dim i As Integer

upTicks = 0
downTicks = 0

' Assuming you have your data in columns A (timestamps) and B (prices)
For i = Sheet1.Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
If Sheet1.Cells(i, "A").Value >= Now - TimeValue("00:00:30") Then
If Sheet1.Cells(i, "B").Value > Sheet1.Cells(i - 1, "B").Value Then
upTicks = upTicks + 1
ElseIf Sheet1.Cells(i, "B").Value < Sheet1.Cells(i - 1, "B").Value Then
downTicks = downTicks + 1
End If
Else
Exit For
End If
Next i

' Output the results
Sheet1.Cells(1, "C").Value = "Up Ticks: " & upTicks
Sheet1.Cells(2, "C").Value = "Down Ticks: " & downTicks
End Sub


import numpy as np

# Simulated odds data - replace this with your live data stream or data collection method
odds_data = [2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.30, 2.25, 2.20, 2.15]

def calculate_volatility(data):
"""
Calculate the standard deviation of the odds, which represents the volatility.
The input is a list of odds, and the output is the standard deviation.
"""
if len(data) < 2:
return 0 # Not enough data to calculate volatility
return np.std(data, ddof=1) # ddof=1 provides the sample standard deviation

volatility = calculate_volatility(odds_data)
print(f"The volatility of the odds is: {volatility:.4f}")


as we need measurements for our automations that can help filter good and bad trades

import time
from collections import deque

class OddsTracker:
def __init__(self, duration=30):
self.duration = duration
self.data = deque() # Use a deque to efficiently manage the data

def add_odds(self, odds, timestamp):
"""Add new odds to the dataset, including the timestamp."""
# Add the new data point
self.data.append((timestamp, odds))

# Remove outdated data points
while self.data and timestamp - self.data[0][0] > self.duration:
self.data.popleft()

def get_high_low(self):
"""Return the highest and lowest odds in the last 30 seconds."""
if not self.data:
return None, None # No data available

odds_values = [odds for _, odds in self.data]
return max(odds_values), min(odds_values)

# Example usage
tracker = OddsTracker(duration=30)

# Simulate adding data points
for _ in range(60): # Simulate for 60 seconds
current_time = time.time()
simulated_odds = np.random.uniform(1.5, 3.0) # Simulated odds value, replace with real data
tracker.add_odds(simulated_odds, current_time)
time.sleep(0.5) # Wait for half a second

if current_time % 1 == 0: # Check the high and low every second
high, low = tracker.get_high_low()
print(f"High: {high}, Low: {low}")


So if anyone can load these into Excel and upload the file so I/we can use it - then I will test it out for other things that maybe helpful .. then everyone can get some more features to look at with the main idea - figure out scalping

I cannot tell you now whether these functions are correct or useful till I see the values streaming .. and see how accurate I can make things - and what other things need to be added .. anyway yeah .....

If this does not interest you - then just move on - its only for people who want to get better at this..
sionascaig
Posts: 1074
Joined: Fri Nov 20, 2015 9:38 am

I'd be interested in anything comes out of this but see a few problems with the approach in general.

In the moment, the odds behaviour of a selection is not "well defined" in a statistical sense. As such it has no "expected value" and no "variance" - specifically there is no well defined probability function that can model it.

It is also highly correlated to all the other selections in the market to varying degrees.

As such (price being not well defined) you can' not calculate an average and hence a variance for a particular selection.

An example of this is a selection that just comes steadily in in price and goes off at the bottom of the range.

You can however get a feel for the volatility by looking at the highest & lowest traded price over a particular time period. I look at 10mins & 2mins and where VWAP is in relation to these bounds. Obviously the smaller the bounds the less the volatility.

Its quite straight forward to capture this information and display as "markers" on the ladder.

I'm pretty sure Dallas has some heatmap examples on forum that allows this kind of thing to be captured & presented in an intuitive way.

This is an example of markers used to display:

Dark yellow: BF high & low traded price
Light yellow: 10 min high & low price
Green border VWAP
Screenshot 2024-03-08 080623.png
You do not have the required permissions to view the files attached to this post.
NotBothered
Posts: 173
Joined: Wed Jun 15, 2022 9:40 am

I think the thing is to just get the basic parts done - so the spreadsheet is operational - then see how useful or how more defined something needs to become

so that it can then be put into the strategy

the starting point will not be the end point

BA is not my specialty - so thanks .... everything you mentioned/talked about needs to be considered.

It is just all existing automation in the forum is not functional for profit making - so I am just trying to move it towards 75-80% done - then people can choose their targets and finish the last 15 or so %
sionascaig
Posts: 1074
Joined: Fri Nov 20, 2015 9:38 am

okies...

There is a spreadsheet somewhere on forum already that can be linked to markets via BA to capture price movements ever second I think so it may have the data in a form that you can use already once connected up to markets. It is quite an old one so not sure if still maintained. From memory it could be used to replay a market (with limitations).

Found it : viewtopic.php?t=16014

I'm more into value betting atm rather than scalping (trading) and really looking at volatility and low / high bounds from that perspective. If come across anything interesting will let you know.
User avatar
Dallas
Posts: 22731
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

sionascaig wrote:
Fri Mar 08, 2024 8:11 am


Its quite straight forward to capture this information and display as "markers" on the ladder.

I'm pretty sure Dallas has some heatmap examples on forum that allows this kind of thing to be captured & presented in an intuitive way.

This is an example of markers used to display:

Dark yellow: BF high & low traded price
Light yellow: 10 min high & low price
Green border VWAP

Screenshot 2024-03-08 080623.png

Think this is probably the one you are thinking of (2nd example)
viewtopic.php?t=21252

But there is plenty of other that some ideas can be drawn off
viewtopic.php?t=21252
viewtopic.php?t=21300
viewtopic.php?t=24887
viewtopic.php?t=27278

Plus several more depending on exactly what it is you want to do with the VWAP/Price etc
NotBothered
Posts: 173
Joined: Wed Jun 15, 2022 9:40 am

thanks Dallas

I am more looking at values - that can be used to test - filter - trigger a bet

those are useful - but not the functions I want to draw from

I want to get to a fully functionally spreadsheet with all the information available to be drawn from - and as was already pointed out there maybe duplication non optimal settings to start with.

anyway I am still studying myself as to whether I can do it on my own - but I am happy to share the work so others can build into their own ideas - using the base options
sionascaig
Posts: 1074
Joined: Fri Nov 20, 2015 9:38 am

NotBothered wrote:
Fri Mar 08, 2024 10:52 am
thanks Dallas

I am more looking at values - that can be used to test - filter - trigger a bet

those are useful - but not the functions I want to draw from
Just in case you are missing the trick - if something can be captured as a Marker it can be used to trigger a bet )

(appreciate that you want to do your own analysis though - never really a downside to that)
NotBothered
Posts: 173
Joined: Wed Jun 15, 2022 9:40 am

yeah I got tired yesterday and made it hard to focus

maybe take today off thinking about this and re look at it tomorrow

the over riding thing - is I want to build something for 5,000 a day not 10 - so it requires a starting point and then progressing along as things become clearer.

appreciate your posts alot -- thanks
sionascaig
Posts: 1074
Joined: Fri Nov 20, 2015 9:38 am

I'd forgotten just how neat some of Dallas heatmaps are (although I have cannibalised bits).

They certainly seem to visually identify (or at least indicate) scenarios that you mention in previous posts.

Might be worth loading some up and fiddling about with if looking for inspiration. e.g. if there was one that was v good at identifying say a steamer then you have a head start terms of what to do with that information. Alternatively might help identify situations you want to avoid or indeed rule out certain indicators as not reliable enough.

Anyhow, its another possible starting point for the investigations.

(and thanks for picking them out Dallas - got me thinking again !)
User avatar
lavenham
Posts: 83
Joined: Thu Feb 28, 2013 10:24 am

Don't forget the Risk Meter - have a look at Peter's video on it for a few ideas and how it applies to different markets based on past data.
NotBothered
Posts: 173
Joined: Wed Jun 15, 2022 9:40 am

sionascaig wrote:
Fri Mar 08, 2024 8:11 am
I'd be interested in anything comes out of this but see a few problems with the approach in general.

In the moment, the odds behaviour of a selection is not "well defined" in a statistical sense. As such it has no "expected value" and no "variance" - specifically there is no well defined probability function that can model it.

It is also highly correlated to all the other selections in the market to varying degrees.

As such (price being not well defined) you can' not calculate an average and hence a variance for a particular selection.

An example of this is a selection that just comes steadily in in price and goes off at the bottom of the range.

You can however get a feel for the volatility by looking at the highest & lowest traded price over a particular time period. I look at 10mins & 2mins and where VWAP is in relation to these bounds. Obviously the smaller the bounds the less the volatility.

Its quite straight forward to capture this information and display as "markers" on the ladder.

I'm pretty sure Dallas has some heatmap examples on forum that allows this kind of thing to be captured & presented in an intuitive way.

This is an example of markers used to display:

Dark yellow: BF high & low traded price
Light yellow: 10 min high & low price
Green border VWAP

Screenshot 2024-03-08 080623.png
In relation to this : the problem is Scalping

finding markets that you can sell at the top and buy at the low but also just capture 2 ticks and exit

you need a certain amount of volatility within the range - but not too much where it blows through the price -- therefore you need several things working together to identify markets - get the readings and make a decision to enter or exit

having used VWAP - and knowing the highs and lows it only one part of it really - we need readings of the market to tell us whether it is good or not

Now you can look through every automation in this forum - and none of them provide this information even in piecemeal form -- what was displayed before is great but I am talking about more advanced information and decision tree.

It is early days really and I think if we do not find someone who knows how to do these things and wants to join in - I will just pay someone to get it all done the way I want it to work.

+ even then there is no guarantee it will work - it would require quite a bit of adjustment.

I am just a bit dissatisfied with whats available now -- is simply too vanilla in nature and the market sees right through it in a short space of time.
NotBothered
Posts: 173
Joined: Wed Jun 15, 2022 9:40 am

and one of the things that is important too miss

is races where people are using 1 analysis to bias the betting to one runner - it is pointless to scalp that runner as it only leads to loss - as I said all the elements used do not really counter this

so new ones are needed
NotBothered
Posts: 173
Joined: Wed Jun 15, 2022 9:40 am

like in this race the runner is 2.18 into 1.70 a breakout strategy would have worked but a scalper - very unlikely
User avatar
ODPaul82
Posts: 689
Joined: Sun May 08, 2011 6:32 am
Location: Digswell Herts

With the auto-generated VBA you've posted (I get it, you've said you're not a developer).

upTicks and downTicks have zero assigned, when a numeric data type is declared in a local function/sub it automatically is set to zero. If this were an automation to beat someone you've already lost microseconds to someone. There's no need to do that

Generally integer data types in VBA are long gone, as in 15+ years long gone, it should define long data types

Why not just use MATCH and VLOOKUP to determine the difference. Have a listing of all the prices then determine what they are and the difference from that.

Anytime that you use VBA you are giving up performance as it's an interpreted language. By using the inbuilt formula these are compiled and generally written in C++ (although from my contacts there they are re-writing stuff in rust). The in-built formulas are a hell of a lot quicker (and for anyone who says python is faster, please, honestly, let's discuss).
User avatar
Kai
Posts: 6230
Joined: Tue Jan 20, 2015 12:21 pm

NotBothered wrote:
Sun Mar 10, 2024 11:49 pm
like in this race the runner is 2.18 into 1.70 a breakout strategy would have worked but a scalper - very unlikely
terrible ranges to scalp
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”