Complex Automation Tips

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm

I have a pretty basic strategy I'd like to automate but it will require a plethora of rules to account for all sorts of events. I would usually do this with Excel but I am keen to dive deeper with my understanding of automation for something simple like this so what would be the best way to create a piece of automation that requires stepping from one rule to the other, much like the attached picture.
130299524_671113886926520_7124569125586156997_n.jpg
For example, if I am at step 'b', I only want either step 'e' or step 'f' to trigger. This is a simple diagram to what is actually involved. Off the top of my head, there may be close to 100 'steps'. Also, from an efficiency pov, I'll be wanting to keep this bot from getting laggy and slow. Are stored values the way to go? Does anybody please have a template for a step-to-step type of system similar to what I'm thinking of by any chance? Or at the very least, any suggestion based on past experiences when creating something a little bit more complex.
You do not have the required permissions to view the files attached to this post.
Anbell
Posts: 2407
Joined: Fri Apr 05, 2019 2:31 am

CallumPerry wrote:
Sun Dec 06, 2020 7:22 pm
I have a pretty basic strategy I'd like to automate but it will require a plethora of rules to account for all sorts of events. I would usually do this with Excel but I am keen to dive deeper with my understanding of automation for something simple like this so what would be the best way to create a piece of automation that requires stepping from one rule to the other, much like the attached picture.

130299524_671113886926520_7124569125586156997_n.jpg

For example, if I am at step 'b', I only want either step 'e' or step 'f' to trigger. This is a simple diagram to what is actually involved. Off the top of my head, there may be close to 100 'steps'. Also, from an efficiency pov, I'll be wanting to keep this bot from getting laggy and slow. Are stored values the way to go? Does anybody please have a template for a step-to-step type of system similar to what I'm thinking of by any chance? Or at the very least, any suggestion based on past experiences when creating something a little bit more complex.
You can use the 'group of conditions' function to cover lots of situations.

Also, I'm not sure that you need to worry about efficiency too much. I doubt that you could slow down the automation if you tried.

And, yes, stored values and history lists are very helpful, depending on what you are trying to do.
Jukebox
Posts: 1576
Joined: Thu Sep 06, 2012 8:07 pm

At first you'll think I'm being flippant by posting this link - but it might help you visualise what you call a "step" really is.

https://blog.bandaequals.com/cereal-box-computer/
eightbo
Posts: 2263
Joined: Sun May 17, 2015 8:19 pm

Anbell wrote:
Sun Dec 06, 2020 7:29 pm
You can use the 'group of conditions' function to cover lots of situations.

Also, I'm not sure that you need to worry about efficiency too much. I doubt that you could slow down the automation if you tried.
I managed to slow my pc down with a file on a version of BA before the grouping and 'Apply to selection EVERY' changes but haven't since.

@callum this sounds like a standard SV project.
Automation projects will usually become more complex from their start point so it concerns me that you have 'close to 100 steps' in the planning phase.
I'm not saying it won't be worthwhile but you should keep in mind that troubleshooting can become a more gruelling endeavour with large projects and as such you should seriously consider the return on investment for you resources spent with the project.

If you still want to go ahead, good planning is essential for large projects. It's almost like the time spent in planning compounds when you don't spend as much time troubleshooting when doing things on the fly. Create a table for all the SVs needed and use dif. prefixes for each section / phase and just make general notes wherever you can in case you need to come back to a section and so on if you don't do these sorts of things already.

In terms of materialising it, I would suggest creating the full skeleton complete with SVs (use dummy criteria if needed and remove it later) & once you've confirmed all the areas link together correctly start adding in your criteria at each level and complete them one at a time.

Best of luck with it

edit: forgot to mention even if the project fails, you will probably level up your skill in the creation of automation files department which will of course carry over into your future projects so don't be too put off by anything I've said.  Consider sidelining the project & looking for a smaller one that contains similar logic but has fewer moving parts; use that as a practice run then come back to the main course.
User avatar
MemphisFlash
Posts: 2339
Joined: Fri May 16, 2014 10:12 pm

you could do it using signals, then treat the signal as a series of "If Then" statements.
If signal is true move to next step, if signal is false do something else.
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm

Thank you guys for the replies!

@Anbell – Thank you, I’ll take a look at ‘Group of Conditions’

@Jukebox – Good visualisation. Up to now, I have used ‘select case’ with VBA which is excellent as if I were at i.e. step ‘f’, it would naturally cycle through and check if A-E were active without going through the A code and then the B code and then the C etc in its entirety. This is what I’d like to do with automation also.

@eightbo – I’ve got my whiteboard out and a pen and paper to draft up my skeleton plan; I think I have now accounted for as much as I’d like for Version 1 of the bot. I hear your warning and think I will spend tomorrow creating a simpler plan to test the flags moving from one step to the next. I’ve had a glance at some more of the rules I can select. What is the difference between ‘Apply to EVERY selection’ and ‘Apply to ANY selection’? Being transparent with the bot, a lot of the ‘steps’ are just precautions for the price moving away before being matched or getting partially matched and having staggered entries/exits adjust accordingly to the main strategy which probably only has around 3 clear stages. I’ve done this manually so am familiar with the strategy already.

All of these rules only work on one runner in my plan so I’m going to choose the favourite but would one of these rules (ANY selection/EVERY selection) allow the bot to work on multiple runners simultaneously? What about if runner 1 was at stage A and runner 3 was at stage G?

@MemphisFlash – Cheers, I’ll check out the signals. I imagine the bot working like a set of traffic lights in a city centre. There’s loads everywhere which is complex but each are quite simple. I can only pass traffic light A if I’m on the road it’s situated on AND it turns green.
sionascaig
Posts: 1687
Joined: Fri Nov 20, 2015 9:38 am

CallumPerry wrote:
Sun Dec 06, 2020 11:24 pm

All of these rules only work on one runner in my plan so I’m going to choose the favourite but would one of these rules (ANY selection/EVERY selection) allow the bot to work on multiple runners simultaneously? What about if runner 1 was at stage A and runner 3 was at stage G?
Not had any problems here other than trying to remember the difference between ANY & EVERY...!

Whilst testing the ANY aspect could always stick in a backprice < x (or similar) type condition to limit the number of runners.. And make sure your conditions, stored values, signals whatever are selection dependent v's market (unless you specifically want market level condition - had a bit of fun trying to debug that one)...
User avatar
jimibt
Posts: 4202
Joined: Mon Nov 30, 2015 6:42 pm

for my 2 cents worth. my approach on BA automation since the early days has been to isolate the working parts down to component level where each unit looks for an optional input and requires to exit with an output. initially, i did this with signals which literally meant that i had to have status code from 0-nn (i.e. using the signals as flags to drive certain functions. in your sceanario, it would have meant that component A would output either a 1,2 or 3 in order to drive the next step. your next steps would open up by examining the value from the signal (if it exisited) rinse and repeat.

with the advent of Stored Values, this became a lot more flexible and meant that text object values could be used which meant that a given component would only trigger if a concrete text value (on the sv) was present. Again, the addition of groups made the organisation of this a lot simpler and thus a flowchart approach, similar to what you've presented, is possible.

of course, in a programming language such as .net or py etc, you can separate these concerns much more efficiently. in a few cases, i've actually had to do this in the past and then use excel as the interface between BA and .net code. However, i'm more than certain that 90%+ of automation tasks can be unertaken in BA automation if you strategically plan down to component level. it's when the code tries to do too many things in the same *rule* that you then find your options getting too interdependent. in short, 1 input, one function, 1 output... simple :D

[tip] - i know it's only an example scenario you've uploaded, but you should use directional arrows to identify the flow. you may also find that you recursively go back/loop inside a component, so bear that in mind with your notation also. and of course, every option would have a *no dice* option which effectively halts the rule until the next iteration from the defined starting point. ;)
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm

Just checking back into this thread as a reminder to myself to learn more about Automation rules in the New Year and also to say thanks for the last few messages I've not replied to yet. The complex rules I'd initially planned out I have semi-working in Excel now. Keen to complete this before the New Year and then transfer it over to Automation so I'll be bugging this area a lot more frequently. Merry Christmas!
Post Reply

Return to “Bet Angel - Automation”